The following describes how to set up an instance of the site on your computer for development.
This guide assumes you have already installed and set up the following:
These docs assume a Unix-like operating system, although the site should, in theory, run on Windows as well. All the example commands given below are intended to be run in a terminal.
Clone this repository or your fork:
git clone https://github.com/mozilla/morgoth.git cd morgoth
Create a virtualenv for Morgoth and activate it:
virtualenv venv source ./venv/bin/activate
Whenever you want to work on Morgoth in a new terminal you’ll have to re-activate the virtualenv. Read the virtualenv documentation to learn more about how virtualenv works.
Install the dependencies using pip:
pip install -r requirements.txt
How to troubleshoot errors during
Install frontend dependencies and build the frontend code using npm:
npm install npm run build
Create a Postgres database for Morgoth. By default it is assumed to be named
If you use a different name for the database, or otherwise want to customize how you connect to the database, you may specify the database URL by adding the following to a
.envfile at the root of the repo:
Initialize your database by running the migrations:
python manage.py migrate
Create a new superuser account:
python manage.py createsuperuser
Once you’ve finished these steps, you should be able to start the site by running:
runsslserver.sh command automatically creates a self-signed
certificate in the
etc/ssl directory of the repository. When viewing the
site for the first time, you will have to create a certificate exception to
allow Firefox to accept the certificate and access the site over HTTPS.
The site should be available at https://localhost:8000/.