Skip to content

Running Verse locally

Paweł Adamczak edited this page Apr 3, 2017 · 3 revisions

Verse uses environment variables to manage configuration variables and you need at least SECRET_KEY set (either explicitly or in .env file) to run it locally. Redis is used for both caching and Celery queue so it needs to be running in the background.

It's run in production with the help of dokku, gunicorn and whitenoise, which means it's Heroku/Foreman/Honcho (and Procfile in general) compatible and can be run with one simple command of your choice:

$ export SECRET_KEY='...'
$ pip3 install -r requirements.txt
$ python verse/manage.py migrate
$ heroku local web
$ ...
$ foreman start
$ ...
$ honcho start
$ ...

You can also run it as a regular Django project, via manage.py runserver:

$ export SECRET_KEY='...'
$ pip3 install -r requirements.txt
$ python verse/manage.py migrate
$ python verse/manage.py runserver

Configuration

Verse uses python-decouple and dj-database-url to manage configuration variables. You can have a look at the settings file to see what values are configurable, but for reference here are the ones that I use locally:

$ cat .env
SECRET_KEY='...'
DEBUG=True
DATABASE_URL='postgres://localhost/verse'
REDIS_CACHE_URL='redis://127.0.0.1:6379/0'
CELERY_BROKER_URL='redis://127.0.0.1:6379/1'
GITHUB_TOKEN='...'

Clone this wiki locally