Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Alexa client in your browser. Django app.

Project Description

Alexa client in your browser. Django app. Talk to Alexa from your desktop, phone, or tablet browser.


This project depends on: - django-channels. - Snowboy

Install and configure those first.


Snowboy detects when the wakeword “Alexa” is uttered.

You must compile Snowboy manually. Copy the compiled snowboy folder to the top level of you project. By default, the folder structure should be:

├── ...
├── snowboy
|   ├──
|   ├──
|   └── resources
|       ├── alexa.umdl
|       └── common.res
└── ...

If the default folder structure does not suit your needs you can customize the wakeword detector.


pip install alexa_browser_client

Add alexa_browser_client to your settings INSTALLED_APPS.

Routing and urls

Add url(r'^', include('alexa_browser_client.config.urls')), to url_patterns.

Add include('alexa_browser_client.config.routing.channel_routing') to your channel_routing.


This app uses Alexa Voice Service. To use AVS you must first have a developer account. Then register your product here. Choose “Application” under “Is your product an app or a device”?

Ensure you update your

Setting Notes
ALEXA_BROWSER_CLIENT_AVS_CLIENT_I D Retrieve by clicking on the your product listed here
ALEXA_BROWSER_CLIENT_AVS_CLIENT_S ECRET Retrieve by clicking on the your product listed here
ALEXA_BROWSER_CLIENT_AVS_REFRESH_ TOKEN You must generate this. See here
ALEXA_BROWSER_CLIENT_AVS_DEVICE_T YPE_ID Retrieve by reading “Product ID” here

Refresh token

You will need to login to Amazon via a web browser to get your refresh token.

To enable this first go here and click on your product to set some security settings under Security Profile:

setting value
Allowed Origins https://localhost:9000
Allowed Return URLs https://localhost:9000/callback/

Then run:

./ create_amazon_refresh_token

Follow the on-screen instructions shown at http://localhost:9000 in your web browser. On completion Amazon will return your refresh_token. Set yourALEXA_BROWSER_CLIENT_AVS_REFRESH_TOKEN setting accordingly.


Once you have all the settings configured:

  • Run django: ./ runserver
  • Go to http://localhost:8000/alexa-browser-client/ and start talking to Alexa.



The default wakeword is “Alexa”. You can change this by customizing the lifecycle’s audio_detector_class:

# my_project/

import alexa_browser_client
import command_lifecycle

class CustomAudioDetector(command_lifecycle.wakeword.SnowboyWakewordDetector):
    wakeword_library_import_path = ''
    resource_file = b'path/to/resource_file.res'
    decoder_model = b'path/to/model_file.umdl'

class CustomAudioLifecycle(alexa_browser_client.AudioLifecycle):
    audio_detector_class = CustomAudioDetector

class CustomAlexaConsumer(alexa_browser_client.AlexaConsumer):
    audio_lifecycle_class = CustomAudioLifecycle

Then in your

from my_project import consumers

channel_routing = [

Unit test

To run the unit tests, call the following commands:

pip install -r requirements-dev.txt

To test a specific file, call the following command:

./scripts/ /path/to/

Other projects

This project uses Voice Command Lifecycle and Alexa Voice Service Client.

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(12.0 kB) Copy SHA256 Hash SHA256
py3 Wheel Oct 10, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting