Skip to content

Instantly share code, notes, and snippets.

@shekhar-kamble
Created December 24, 2018 19:35
Show Gist options
  • Save shekhar-kamble/ede03ff88bdb7a7529d02c8cf76ef51e to your computer and use it in GitHub Desktop.
Save shekhar-kamble/ede03ff88bdb7a7529d02c8cf76ef51e to your computer and use it in GitHub Desktop.

Setting up

Add Environment Variables

Create a file called config.env that contains environment variables in the following syntax: ENVIRONMENT_VARIABLE=value.

  • ADMIN_EMAIL: set to the default email for your first admin account (default is admin@example.com)
  • ADMIN_PASSWORD: set to the default password for your first admin account (default is password)
  • DATABASE_URL: set to a sqlite database uri (default is data-dev.sqlite)
  • FLASK_CONFIG: development or production.

Install the dependencies

$ pip install -r requirements.txt

Create the database

$ python manage.py recreate_db

Other setup (e.g. creating roles in database)

$ python manage.py setup_dev

Note that this will create an admin user with email and password specified by the ADMIN_EMAIL and ADMIN_PASSWORD config variables. If not specified, they are both admin@example.com and password respectively.

Add seed data to the database

$ python manage.py add_movie_data

Running the app

$ source env/bin/activate
$ gunicorn manage:app --worker-class=gevent --workers 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment