Prerequisites: Python 3.6, Pipenv
cd
to the repo's directory- For the first run,
pipenv install
to download dependencies pipenv shell
- Copy
.env.example
to.env
and edit its contents as necessary - For the first run,
python manage.py migrate
to run DB migrations (create DB tables) - For the first run,
python manage.py createsuperuser
to create a superuser for testing - To run,
python manage.py runserver
- The admin interface can be accessed at
/admin
- To run tests,
python manage.py test
- After editing any model or pulling changes which include changes to migrations, you need to run migrations again (
python manage.py migrate
) - After adding/removing packages (editing Pipfile) or pulling changes which include changes to the Pipfile, you need to run
pipenv update
- To debug emails, you can run a simple SMTP server locally using
python -m smtpd -n -c DebuggingServer localhost:1025
. Don't forget to adjust your.env
file as follows:
...
EMAIL_HOST=localhost
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_PORT=1025
EMAIL_USE_TLS=False
...
Prerequisites: Node.js 8+
cd
to thearkav-is-web
directory- For the first run,
npm install
to download dependencies - To run using the dev server,
npm run serve
- When running in development, you may need to adjust the API base URL in
src/api.js
- The dev server supports hot-reload
- You can use Vue.js devtools Chrome extension to help with debugging
- To build the production bundle, run
npm run build
- To run tests,
npm run test
- To lint and fix code style problems, run
npm run lint
- The linter will also automatically fix code style problems when committing
- After adding/removing packages (editing
package.json
) or pulling changes which include changes to thepackage.json
file, you need to runnpm install
again
- Clone this repository and ensure you are on the master branch.
- Create a new feature branch in Git:
git checkout -b <branch_name>
(note: bugfixes can be pushed straight to master) - Work on your changes (commit your changes in Git, use descriptive commit messages)
- Don't forget to add tests; ensure all tests pass:
python manage.py test
- If you change any Django model class:
- Update Django migration files:
python manage.py makemigrations
- Migrate your current DB:
python manage.py migrate
- Update Django migration files:
- When done, ensure all of your changes are committed, then push your branch to Github:
git push -u origin <branch_name>
- On the Github website, create a new pull request from your branch to master.
- Wait for your pull request to be reviewed. If there is anything you need to fix, commit the fix and push it to Github.
- When the reviewer approves your change, your branch will be merged to master.
- Set up a database
- Use
pipenv install --deploy
to install dependencies - Copy
.env.example
to.env
and adjust its contents as necessary - Don't forget to
python manage.py migrate
- Don't forget to
python manage.py collectstatic
- Don't forget to
cd arkav-is-web
, thennpm run build
- Ensure
MEDIA_ROOT
directory is writable by Django - Run Django using a WSGI server, e.g. Gunicorn
- Set Gunicorn to run as a service, e.g. using systemd
- Ensure that the Gunicorn service loads environment variables from your
.env
file - Set up a reverse proxy (e.g. Nginx):
- Proxy
/api/
and/admin
to Gunicorn - Serve
STATIC_ROOT
directory contents according toSTATIC_URL
- Serve
arkav-is-web/dist
directory contents - Direct any mismatched URLs to
arkav-is-web/dist/index.html
- Set up HTTPS, e.g. using Let's Encrypt and Certbot
- Proxy
- Don't forget to back up regularly