COBPC Member portal
All of the portal code and related documentation will go in this repository.
It may also include the canonical club documents, role definitions etc.
These instructions are for installing on Debian 8 or Ubuntu 16.04 servers (later versions are probably ok).
- git
- python3.7
If deploying remotely, set up nginx and a separate user for the service (e.g. cobpc). Ensure whatever user you are using has access to the github repository
-
Create a virtual environment running python 3.7 e.g:
virtualenv --python=`which python3.7` website
-
Activate the environment (website)
cd website && . bin/activate
-
Clone the repo into a subfolder in
website
git clone git@github.com:pwhipp/cobpc.git
-
Link the environment set up into the virtual env
ln -s ${VIRTUAL_ENV}/cobpc/deploy/postactivate bin && . bin/postactivate
-
Install the requirements
pip install -r cobpc/requirements.txt
-
Create a local configuration (may want to edit it)
cp cobpc/core/settings/includes/local.example.py local.py
-
Set up the database
django migrate
-
Build the html documentation
django devdoc --no_open
-
For development you can now run the service and work on it. Run it with
django runserver
-
For production you need to ensure that the service is run in a more robust manner:
-
Hook up nginx
sudo ln -s /home/cobpc/website/cobpc/deploy/nginx.cfg /etc/nginx/sites-available/cobpc
sudo ln -s /etc/nginx/sites-available/cobpc /etc/nginx/sites-enabled
sudo systemctl reload nginx
-
Link the service file so systemD can find it, enable it and start it:
sudo ln -s /home/cobpc/website/cobpc/deploy/cobpc.service /etc/systemd/system
systemctl start cobpc
systemctl enable cobpc
-
When updating or installing on production for the first time static files must be collected
django collectstatic
-