The latest UWaterloo HvZ website. Built on Django.
To create a local instance of the site for development, and create a venv:
git clone git@github.com:uwhvz/uwhvz.git
python -m venv venv # Makes virtualenv in "venv" folder
Activate the venv on Windows using:
venv\Scripts\Activate
Or on Unix-Based Systems:
source venv/bin/activate
Setting up dependencies at their current versions requires specific pip and setuptools versions:
pip install pip==19.0.3
pip install setuptools==40.8.0
pip install -r requirements.txt # dependency file in root
Finally, to run the test server
python manage.py migrate
python manage.py runserver
GMAIL_PASSWORD='TEST_API_PASSWORD'
LANG=C.UTF-8
LC_ALL=C.UTF-8
MAILCHIMP_API='TEST_API_TOKEN'
SECRET_KEY='TEST_SECRET_KEY'
python manage.py seed_data
generates a bunch of fake data for testing purposes.python manage.py makemigrations app
to make a migration after changing models, etc.The website has a public API currently under development. You can check out the documentation here.
The site is currently hosted on: Computer Science Club (CSC) servers.
We use a detached screen to run Gunicorn, which lets us run the site. Important commands include:
screen -S gunicorn
: create a new screen to be detachable named "gunicorn"screen -ls
: should list exactly one detached screen where Gunicorn is running the sitescreen -r
: resumes the Gunicorn screenIf no screen is found, do the following:
screen -S gunicorn
source venv/bin/activate
gunicorn --bind 0.0.0.0:53271 uwhvz.wsgi
Exit out of the screen session (but keep it running) with Ctrl+A+D
. Failure to do this will make restarting the server significantly harder. Afterwards, check if the website is online.
If frontend-related changes are not refreshed on the site originally upon pull
ing, use python manage.py collectstatic
, and restart the server. If that doesn't work, do the following:
rm -rf /static/
python manage.py collectstatic
python manage.py compress --engine jinja2
The last line is for optimizing the size of our assets. Failure to run the last line will cause a 500 error.