A sample forums app built on the Django framework. I built this app to learn Django more, and I wanted to learn how to do a parent/child database model to also learn that aspect of Django. It can also be seen as an example app to see how the features listed below could be implemented in Django.
Includes:
The setting file are split up in production and a development settings files. Also the project have one docker-compose.yml for production and one for development. Within the docker-compose files you can find the parameter for which settings file to use on the runserver command. To make it easier and less to type for each command, there is a Makefile with different common operations.
Note: I haven't tested setting this up this project as below on Windows or Linux. Only on MacOS.
https://github.com/Joeriksson/django-forums-app.git
Install Docker Desktop to be able to use the docker environment.
Create an .env file in the root folder with the the following parameters:
SENDGRID_PASSWORD=<you sendgrid password>
SENDGRID_USERNAME=<your sendgrid username>
SECRET_KEY=<your secret key>
DEBUG=True
SENTRY_KEY=<your sentry key>
SENTRY_PROJECT=<your sentry project id>
Note: you don't need a Sendgrid account when using the development settings. It sends mail to the console by default. You can just put in some random values for those. Also you don't need to use sentry for logging. Just comment out the sentry settings in /settings/base.py.
make dev_build
The container should now be up and running. Check in you browser that you see a start web page at http://127.0.0.1:8080
Run a migration to build the databases
make dev_web_exec cmd='python manage.py migrate'
make dev_web_exec cmd='python manage.py createsuperuser'
If you want to stop the container run:
make dev_down