A digital commendation system being developed for use at Bayfield High School
This project has been archived for now as I have completed my assessments. At some point I might return to this and keep working on it.
This project requires Python 3.10 or higher!
Clone the repository using git
git clone https://github.com/mmoomocow/digital-commendations.git
or download from the GitHub releases
Create a virtual environment using VENV.
python -m venv venv
with windows:
<venv path>\Scripts\activate.bat
pip install -r requirements.txt
If you are going to generate dummy data for the database, also install faker
pip install faker
Create a .env
file in the root directory of the project and add the following variables:
-
ALLOWED_HOSTS - A comma separated list of the allowed hosts
- Example:
*,localhost,www.example.com
- Example:
-
Secret key - A secret key used to encrypt and decrypt data
- Example:
<random string>
- Example:
-
DEBUG - A boolean value indicating if the application should be in debug mode
- Example: True
-
SECURE_HSTS_SECONDS - The number of seconds that the browser should remember that the site is HTTPS only
- Example:
31536000
- Example:
-
PRODUCTION - A boolean value indicating if the application should run in production mode
- Example:
True
- Example:
-
ADMINS - A comma separated list of admins who will receive emails for 500 errors
- Example:
John:[email protected],Jane:[email protected]
- Example:
-
MANAGERS - A comma separated list of managers who will receive emails for 404 errors
- Example:
John:[email protected],Jane:[email protected]
- Example:
-
DB_NAME - The name of the MySQL database schema to use
- Example:
commendations
- Example:
-
DB_USER - The username to use to connect to the MySQL database
- Example:
root
- Example:
-
DB_PASSWORD - The password to use to connect to the MySQL database
- Example:
password123
- Example:
-
DB_HOST - The hostname of the MySQL database server
- Example:
localhost
- Example:
-
DB_PORT - The port of the MySQL database server
- Example:
3306
- Example:
-
CONN_MAX_AGE - The number of seconds a database connection should be kept alive
- Example:
60
- Example:
-
KAMAR_AUTH_USERNAME - The username that the Kamar API will use to access the site
- Example:
Kamar
- Example:
-
KAMAR_AUTH_PASSWORD - The password that the Kamar API will use to access the site
- Example:
password
- Example:
-
MY_HOST - The hostname of the site. Used for redirect callbacks
- Example:
localhost:8000
- Example:
-
MICROSOFT_AUTH_TENANT_DOMAIN - The domain of the Microsoft tenant
- Example:
example.com
- Example:
-
MICROSOFT_AUTH_CLIENT_ID - The client ID of the Microsoft application
- Example:
12345678-1234-1234-1234-123456789012
- Example:
-
MICROSOFT_AUTH_CLIENT_SECRET - The client secret of the Microsoft application
- Example:
1234567890123456789012345678901234567890
- Example:
python manage.py migrate
python manage.py populate_DB
python manage.py runserver
Branches are used to track changes to the code. When a new branch is created, the name should be in the format of <name>-DCS-<cardID>
. For example, Jdoe-DCS-123
. The card ID is taken from the trello board.
To test the application, run the following command:
python manage.py test
As the project is developed, add new tests to the corresponding tests.py
file.