This is the code base for the Biochemistry & Molecular Biology retreat registration website at Baylor College of Medicine. It is written in Python3/Django and is deployed via uwsgi. The website allows attendees to register, select t-shirt size, vegetarian meal preferences, submit abstracts, and upload talks. Additionally, the website matches poster presenters with judges while avoiding appointing attendees to be judges of a fellow lab member. Furthermore, the website allows entering of judging scores.
After registration has closed, LaTeX
templates are provided to format
abstract and judging sheets.
Updating and managing the data in the website can all be done at the admin page. For example, variables are set to update the date and location of the retreat:
After variables are added, they will show up on the homepage. We also added a
retreatpictures
folder that can be filled with images for auto display.
YOU MUST ALSO PUT THE IMAGES IN BCM/static/retreatpictures
They must be in both locations.
I fill these folders with pictures from past retreats.
For the user, the sign-up page allows them to create an account with their lab membership, t-shirt size, roommate preferences, etc.:
Once logged in, a user can submit an abstract and upload their talk. There is also a password reset procedure. All passwords are hashed via the built-in PBKDF2 hasher that comes with Django (though could be easily modified in the future).
/mnt/e/projects/BCM/images/abstract_submission.png
A full walkthrough of instructions for managing the website is available at the bottom of the admin page:
- nginx
- postfix
- git
- python3
- uwsgi
- django
Additional python requirements easily installed through the requirements.txt
file (after creating virtualenv):
pip install -r requirements.txt
Make a file called `environment_variables.txt` in this directory. Set the following (case sensitive) variables. Use an equals sign as a separator:
- DJANGO_SECRET_KEY
- custom_django_secret_key
- DJANGO_ALLOWED_HOSTS
- IP address. Separate with pipe
|
to allow multiple - DJANGO_EMAIL_BACKEND
- set to django.core.mail.backends.smtp.EmailBackend to send emails
- DJANGO_DEFAULT_FROM_EMAIL
- set to something like ‘BMB_REGISTRATION <[email protected]>’
- DJANGO_EMAIL_HOST_USER
- username for email login
- DJANGO_EMAIL_HOST_PASSWORD
- password for email login
- (SKIP if on BLAKE) Install nginx, postfix, python3-pip
sudo apt-get install nginx sudo apt-get install postfix sudo apt-get install python3-pip sudo apt-get install libpcre3 libpcre3-dev # important for uwsgi
- (SKIP if on BLAKE) Upgrade pip and install virtualenv
pip3 install --upgrade pip pip3 install virtualenv
- Navigate to
/home/
and git clone:cd git clone https://github.com/asalt/BCM
- Make a virtualenvironment and activate it
virtualenv --python=python3.4 ~/BCM/venv #Trying python3.6 has failed in the past source ~/BCM/venv/bin/activate #must be in venv for remainder of steps, use 'deactivate' to leave venv
- Upgrade PIP then install package requirements to virtual env
pip install pip==19.1 --upgrade #pip drops python3.4 compatibility after 19.1 pip install -r BCM/requirements.txt
- (SKIP if on BLAKE) Add the config file for nginx and activate
sudo ln -s ~/BCM/bcm_nginx.conf /etc/nginx/sites-enabled/ sudo /etc/init.d/nginx restart
- Prepare the database:
cd BCM python manage.py migrate
- Define your environment variables
See
environment_variable_instructions.txt
- Launch server
uwsgi --ini uwsgi.ini
- Login to Admin Panel
- Navigate to http://blake.bcm.edu:8000/admin
- login using:
admin pass123
- Make a new superuser for yourself and delete the default one