Skip to content

Local development instructions

Tom Nurse edited this page Nov 17, 2020 · 3 revisions

On a Linux/Mac machine

Creation

  1. Clone the repo and cd into it.
  2. Make sure you have python, pip, and prereqs for Pillow installed. We support python 3.4+ (with django > 2.0).
    • Mac: brew install python && sudo pip install virtualenv
    • Ubuntu: sudo apt-get install python{,-dev,-pip,-imaging,-virtualenv} build-essential
    • Other Linux: Ensure you have python, pip, virtualenv, and a compiler.
  3. Make a virtual environment to install libs without root in the 'env' folder: virtualenv env (use with --python=pythonX.Y to specify a python version)
  4. Install all libraries: pip install -r requirements_debug.txt
  5. Build the SQLite database: python manage.py migrate
  6. Make a superuser account: python manage.py createsuperuser

Using it

  1. Activate the virtual environment: source env/bin/activate
  2. Use it:
    • View on web: python manage.py runserver
    • Run tests: python manage.py test -n ('-n' bypasses database migrations)
    • REPL with data: python manage.py shell_plus

On Windows or any OS with PyCharm

  1. Install PyCharm Professional. There are free open-source/education licenses available.
  2. Clone the repo in the software
  3. Specify requirements file as "requirements_debug.txt"
  4. Add a new local virtualenv environment under interpreter settings.
  5. Select the virtualenv in project settings
  6. Sync the requirements to install dependencies.
  7. Make the `site_tmpl' folder a template folder in Project Structure.
  8. Create the database: Tools>Run manage.py task>"migrate"
  9. Create a superuser: Tools>Run manage.py task>"createsuperuser"
  10. Run server/tests/shell.