The Backend code for Village Book Builders Portal
License: | MIT |
---|
The following steps should be completed in order to properly run the vbb-backend-portal on your local machine. Some steps may vary based on your operating system and some installation steps may be skipped if the required packages are already installed. If you encounter issues in this process which can't be resolved with a 20 minute Google search and debug, please reach out via the back-end channel of the VBB Slack group.
(first time global installations) 1) Install python3+ [https://realpython.com/installing-python/] 2) Install pip [https://pip.pypa.io/en/stable/installing/] 3) Install postgresql [https://pip.pypa.io/en/stable/installing/] 4) Install redis [https://redis.io/download] 5) Create a database in postgresql titled vbb in postgresql [https://www.freecodecamp.org/news/how-to-get-started-with-postgresql-9d3bc1dd1b11/]
(to run) 6) Clone and cd into the backend-vbb-portal repository 7) Run virtualenv env 8) Run source env/bin/activate (path may differ depending on where /activate is installed) 9) Run pip install -r requirements/local.txt 10) Run python manage.py runserver
Moved to settings.
To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
To create an superuser account, use this command:
$ python manage.py createsuperuser
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
Running type checks with mypy:
$ mypy vbb_backend
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run -m pytest $ coverage html $ open htmlcov/index.html
$ pytest
Moved to Live reloading and SASS compilation.
This app comes with Celery.
To run a celery worker:
cd vbb_backend
celery -A config.celery_app worker -l info
Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.
Sentry is an error logging aggregator service. You can sign up for a free account at https://sentry.io/signup/?code=cookiecutter or download and host it yourself. The system is setup with reasonable defaults, including 404 logging and integration with the WSGI application.
You must set the DSN url in production.
The following details how to deploy this application.
See detailed cookiecutter-django Heroku documentation.
See detailed cookiecutter-django Docker documentation.