Prerequisites: Python 3.6, Pipenv
cdto the repo's directory- For the first run,
pipenv installto download dependencies pipenv shell- Copy
.env.exampleto.envand edit its contents as necessary - For the first run,
python manage.py migrateto run DB migrations (create DB tables) - For the first run,
python manage.py createsuperuserto 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.envfile as follows:
...
EMAIL_HOST=localhost
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_PORT=1025
EMAIL_USE_TLS=False
...
Prerequisites: Node.js 8+
cdto thearkav-is-webdirectory- For the first run,
npm installto 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.jsonfile, you need to runnpm installagain
- 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 --deployto install dependencies - Copy
.env.exampleto.envand 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_ROOTdirectory 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
.envfile - Set up a reverse proxy (e.g. Nginx):
- Proxy
/api/and/adminto Gunicorn - Serve
STATIC_ROOTdirectory contents according toSTATIC_URL - Serve
arkav-is-web/distdirectory 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