mq-quiz / README.md
Pamela Fox
workflow
43c3bf3
|
raw
history blame
1.49 kB

Quizzes app

An example Django app that serves quizzes and lets people know how they scored. Quizzes and their questions are stored in a PostGreSQL database. There is no user authentication or per-user data stored.

Try it out at:

https://django-example-quizsite.azurewebsites.net/quizzes/

Local development

Install the requirements and Git hooks:

pip install -r requirements-dev.txt
pre-commit install

Create a local PostGreSQL database called "quizsite" and update .env with the relevant database details.

Run the migrations:

python manage.py migrate

Run the local server:

python manage.py runserver

Run tests:

coverage run --source='.' manage.py test quizzes
coverage report

Deployment

The app is currently hosted on Microsoft Azure. Specifically:

  • Azure App Service
  • Azure Database for PostGreSQL flexible server

To deploy your own instance, follow the tutorial for Django app + PostGreSQL deployment but using this app instead of the sample app.

Make sure you specify the following environment variables in the App Service configuration: DBHOST, DBNAME, DBPASS, DBUSER. The previously linked tutorial shows how to set these.