Setup Your Dev Environment

Now that all of the requirements are installed, it’s time to get your environment up and running.

Setup Your Database stores objects like courses, timetables, and students in a Postgres database. Let’s get one setup for you.

Let’s first initialize Postgres using the default user account postgres


If using Linux log into this account with

sudo -i -u postgres

Then, enter Postgres environment with

psql postgres


If you see an error in CentOS / Fedora, it’s most likely due to postgres is not running. Initialize it with sudo service postgresql initdb && sudo service postgresql start.

Here you can enter SQL to create/manipulate/access databases. Let’s create a database. Enter:


Then, create a database user, set myusername and mypassword to whatever you wish

CREATE USER myusername WITH PASSWORD 'mypassword';

Finally, grant all access to the created database to your new user, myusername:


Great. You are all set. Enter the following to quit psql:



If using Linux exit postgres by



For CentOS / Fedora, Change all occurances of ident to md5 in pg_hba.conf. You can modify the file through sudo vim /var/lib/pgsql9/data/pg_hba.conf. After you change it, restart postgres with sudo service postgresql restart.

Create Local Settings

Now that you have a database created, we need to inform Django of the configuration. Do so by creating a new file called and placing it in the semesterly/ directory within your workspace. You should find that there is already a similar file called found in the same folder.

The contents of this file should be:

DEBUG = True


    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'semesterly',
        'USER': 'myusername',
        'PASSWORD': 'mypassword',
        'HOST': 'localhost',
        'PORT': '5432',


Be sure to change the values of myusername and mypassword to the values you chose when creating your user!

Migrate Your Database

Now that Django knows about the database, it can conform the empty database to our schema. Simply execute:

python migrate

Edit your /etc/hosts

For development purposes, we map to http://localhost:8000. To do this locally, execute the following line of bash:

sudo sh -c "echo '' >> /etc/hosts"


If you add a school, be sure to add it to this file!

Set your Environment Type

Add the following line to either your ~/.bashrc or ~/.zshrc which tells webpack you are running a development environment:

export NODE_ENV=development

Then source ~/.bashrc or source ~/.zshrc

And make sure the following line returns “development”

echo $NODE_ENV

Install & Run Webpack

Webpack compiles our React componenets into one application-wide javascript bundle. We use ChromeDriver for automated browser testing.

To install them:

npm install -g webpack chromedriver

Then run it with:

npm run watch


Always leave npm run watch running. It will continuously watch your javascript files and recompile automatically after edits/changes.

Running the Server

Now, the moment you’ve all been waiting for! Let’s run the server! (Be sure to leave the last npm run watch command running)

python runserver

Navigate to, and if everything loads, you should be all set :). You did it!

Your Final Setup

Great work. Your local environment is all setup.

Don’t forget: whenever you’re working on you should have one terminal running the server (via python runserver), and one running webpack (via npm run watch).


Don’t forget to always work from your virtual environment! From the root directory, just execute source /venv/bin/activate to enter it.

Happy hacking! To fill up your database, be sure to checkout Loading the Database.