Website for MeDUSA, Deakin University's medical student society, hosted here
License : MIT
Install python requirements:
poetry install
poetry shell
playwright install-deps
playwright install
Install node requirements
npm install
Create database, where postgres
is the default postgres account:
createdb -U postgres medusa_website
After creating, in the top level .env
file, set the values to what you just used:
DATABASE_URL="postgres://localhost/medusa_website"
DATABASE_USER="postgres"
DATABASE_PASSWORD="postgres"
Run migrations:
poetry shell # To activate virtualenv
python manage.py migrate
Setup pre-commit:
poetry run pre-commit run --all-files
python start_console.py
To run celery worker
poetry run celery -A medusa_website worker --loglevel=INFO
Moved to settings.
-
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.
Running type checks with mypy:
$ mypy medusa_website
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html
$ pytest
Moved to Live reloading and SASS compilation .
gunicorn.service
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=medusa_it
Group=www-data
WorkingDirectory=/home/medusa_it/medusa_website
ExecStart=/home/medusa_it/.cache/pypoetry/virtualenvs/medusa-website-GIn7jO6M-py3.9/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
config.wsgi:application
[Install]
WantedBy=multi-user.target
And celery.service
[Unit]
Description=Celery Beat Service
After=network.target
[Service]
Type=simple
User=celery
Group=celery
EnvironmentFile=/etc/conf.d/celery
WorkingDirectory=/home/medusa_it/medusa_website
ExecStart=/bin/sh -c '${CELERY_BIN} -A ${CELERY_APP} beat \
--pidfile=${CELERYBEAT_PID_FILE} \
--logfile=${CELERYBEAT_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL}'
Restart=always
[Install]
WantedBy=multi-user.target