Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Alexa.py ignored #33

Open
89jd opened this issue Jan 11, 2018 · 2 comments
Open

Alexa.py ignored #33

89jd opened this issue Jan 11, 2018 · 2 comments

Comments

@89jd
Copy link

89jd commented Jan 11, 2018

Hi,

I think I might be misunderstanding a little bit of how to set this up. But I have created a new app. I have then created the an alexa.py, and added the DjangoAlexa to urls.py; but it is still using the default alexa.py, e.g. not picking up the intents from my version of alexa.py.

Could you let me if there is a step I am missing outside of creating alexa.py in my app, adding the URLS. When I test on the alexa development console, I am always getting the default text: -

"text": "Welcome. What would you like to do next?"

@taberhsmith
Copy link

Jack,

This also confused me at first. The slides are a little helpful (it would be nice to have a more verbose explanation).. http://slides.com/rocktavious/django-alexa#/5/3

Here is what I did...

  1. make sure you add the environment variables for your skill. I at first thought this was in the settings.py, but it is not. You have to add these in your OS. Note that the part after "ALEXA_APP_ID_" tells django-alexa which django project to look under. In this case it is "my_app"
    On linux:
    export ALEXA_APP_ID_my_app=amzn1.echo-sdk-ams.app.e18a3326-4775-45f2-83n0-5eeg03832401

You also have to add the code from the lower code blocks (from http://slides.com/rocktavious/django-alexa#/5/3), as well as putting django_alexa into your installed apps (http://slides.com/rocktavious/django-alexa#/5/4) to your settings.py

  1. In your project, you have to tell your project where to put the alexa urls. So, in your project folder base urls.py (e.g. ~/django/my_app/my_app/urls.py) add this at the top:
    import django_alexa # to include django-alexa
    and then
    url(r'^', include('django_alexa.urls')),

  2. In my case, I could not get it to automatically load the alexa.py file, so I forced it to load by adding this line to my ~/django/my_app/my_app/init.py
    import alexa

These steps worked for me to get it to stop doing what you described.

I hope that helps.
T

@89jd
Copy link
Author

89jd commented Jan 21, 2018

That is great

Thanks for your help! This worked great, the only thing I changed was passed a string to the app paramater on the intent decorator

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants