How to use Django ML Template Lite

1. Test the model on your local machine (assuming it's a mac)

(venv) [django_ml_lite]$ python runserver

2. Deploy this model to production (Heroku)

a. Set up your heroku account

b. (Inside of the project root dir) Run the following commands to set up your heroku environment for production

c. Deploy to Heroku (Finally the most exciting part! 😁)

  1. Tell heroku your app is based on python:
    heroku create <your-app-name> --buildpack
  2. Set up a random django security code

    heroku config:set PYTHONHASHSEED=random
    heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)"
  3. Set up concurrency (note: if you set this number high, you might run out of memory on a free heroku instance), for more details, visit:

    heroku config:set WEB_CONCURRENCY=1
  4. Turn off django debug for your website security
    heroku config:set DJANGO_DEBUG=False
  5. Deploy (might take a while)
    git push heroku master


This template ships with one machine learning model for you to check out and you can modify it to serve your own model.

Sentimental Analysis Prediction

You can Visit to test out the API.

Test users

This package ships with two existing users so you can go ahead and test it out. To change their passwords, in command line (project root dir), run the following and follow the prompt.

 python changepassword data_scientist

Some notes:

Any questions? Contact US

We will respond within 24 hours