Skip to content

Setting up a local development server

tonnpa edited this page Mar 5, 2018 · 1 revision

Steps to create a local development server

Server-side components

  1. Install necessary server-side dependencies.

  2. Database: create role DATABASE_USER with login password DATABASE_PASSWORD, create database DATABASE_NAME, grant all permissions on the database to the role. All values are listed in the .env file on the server.

  3. Create virtualenv environment (follow steps in Server configuration).

  4. To create the database tables, we have to apply Django migrations:
    python manage.py migrate

  5. Retrieve the datasets from the civicdata server by copying the civicdata/assets folder:
    scp -r your_user_name@civicdata.lmc.gatech.edu:/home/pnguyen87/civicdata/assets path_to_project_root_folder

  6. To import the datasets from assets/datasets, run custom Django command:
    python manage.py import_data

Client-side components

  1. Install necessary client-side dependencies (follow steps in Client configuration).
  2. To create the bundle from the client-side code using webpack, run yarn build

Running the development web-server

Run command python manage.py runserver. For development, set ALLOWED_HOSTS=localhost and DEBUG=true in .env config file.