ferror18 / backend-vbb-portal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Village Book Builders Backend

The Backend code for Village Book Builders Portal

Built with Cookiecutter Django Black code style
License:MIT

Intial Setup

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

Settings

Moved to settings.

Basic Commands

Setting Up Your Users

  • 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.

Type checks

Running type checks with mypy:

$ mypy vbb_backend

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with py.test

$ pytest

Live reloading and Sass CSS compilation

Moved to Live reloading and SASS compilation.

Celery

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

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.

Deployment

The following details how to deploy this application.

Heroku

See detailed cookiecutter-django Heroku documentation.

Docker

See detailed cookiecutter-django Docker documentation.

About

License:MIT License


Languages

Language:Python 90.1%Language:Shell 4.0%Language:HTML 3.1%Language:Dockerfile 2.4%Language:SCSS 0.3%Language:CSS 0.1%Language:JavaScript 0.0%