Database Name: quiztown
Database User: quiztown-user
Database Password: thisisnotapassword
Alternatively, you can use environment variables DB_NAME
, DB_USER
and DB_PASSWORD
to modify database settings
- Python (>= 3.8.10)
- Pip (>= 21.2.4)
- MariaDB (>= 10.3.9)
- virtualenv (>= 20.8.1) (if setting up project in virtual environment)
- Redis (>= 5.0.14)
- Run Redis in docker
$ docker run -p 6379:6379 -d redis:5
-
Install Python Dependencies
$ pip install -r requirements.txt
-
Create and seed the database
$ python manage.py migrate
-
Run the webserver
$ python manage.py runserver
-
Start the job queue worker
$ python manage.py rqworker default
-
Setup Virtual Environment
$ python -m venv venv
-
Activate Virtual Environment
$ source venv/bin/activate
-
Update pip to latest version
$ python -m pip install --upgrade pip
-
Repeat the above steps to set up the project in the virtual environment Run the following code to deactivate the virtual environment
$ deactivate
Note: Run all future commands after activating virtual environment to ensure consistencies
- Exit from the virtual environment and run the following
$ pip install -r linting-requirements.txt
{
"python.pythonPath": "backend/venv/bin/python",
"python.defaultInterpreterPath": "backend/venv/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "autopep8",
"python.linting.flake8Args": [
"--config",
"backend/.flake8"
],
"python.formatting.autopep8Args": [
"--global-config",
"backend/pyproject.toml"
],
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"python.analysis.typeCheckingMode": "basic",
"python.analysis.indexing": true,
}