Documentation

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 manage.py 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 https://github.com/heroku/heroku-buildpack-python
    
  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: https://devcenter.heroku.com/articles/optimizing-dyno-usage#concurrent-web-servers

    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
    

Models

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 https://demo.djangomachinelearning.com 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 manage.py changepassword data_scientist

Some notes:


Any questions? Contact US

We will respond within 24 hours