=============
django-echo
=============

Django library for creating skills for the Amazon Echo (Alexa)

===========
django-echo
===========

Django library for creating skills for the Amazon Echo (Alexa)

===============
Getting Started
===============

django-echo is mainly composed of three classes:

- ``echo.skill.EchoSkill``: A subclass of Django's generic.View that handles routing intents and dealing with request data.
- ``echo.request.EchoRequest``: A small wrapper around the JSON data in the request from Amazon.
- ``echo.response.EchoResponse``: A subclass of Django's http.HttpResponse that knows how to generate a valid Amazon Echo response.


Creating a Skill
----------------
A skill is a class that subclasses EchoSkill that provides intent handlers::

    from echo.skill import EchoSkill

    class HoroscopeSkill(EchoSkill):
        def get_horoscope(self, sign):
            # Ignore the sign because astrology is bunk.
            return self.respond("Today you need to act first and ask questions later!")

On the Amazon side you would setup an intent called ``GetHoroscope`` that has
a ``sign`` slot, and when that intent is called this ``get_horoscope`` method
will be called with the slot data.

The ``self.respond`` is a helper method that essentially just acts as a
pass-through to ``EchoResponse``. You can also use SSML directly and
EchoResponse will set the response up correctly::

    self.respond("<speak>Today you need to ask questions first and act later!</speak>")

Then you just need to wire the skill up to your urls.py::

    from django.conf.urls import url

    from .views import HoroscopeSkill

    urlpatterns = [
        url(
            regex=r'^horoscope/$',
            view=HoroscopeSkill.as_view(),
            name='horoscope_skill'
        )
    ]

Add basic usage to readme
Add basic usage to readme
