asalt / BCM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Biochemistry and Molecular Biology Retreat Registration Website

Overview

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.

./images/homepage_novariables.png

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:

./images/variables_page.png

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.

./images/homepage_with_variables.png

For the user, the sign-up page allows them to create an account with their lab membership, t-shirt size, roommate preferences, etc.:

./images/signup_page_lab_dropdown.png

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:

./images/instructions.png

Base Requirements

  • nginx
  • postfix
  • git
  • python3
  • uwsgi
  • django

Additional python requirements easily installed through the requirements.txt file (after creating virtualenv):

pip install -r requirements.txt

Environment Variables

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 <noreply@example.com>’
DJANGO_EMAIL_HOST_USER
username for email login
DJANGO_EMAIL_HOST_PASSWORD
password for email login

Deployment Steps

  1. (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
        
  2. (SKIP if on BLAKE) Upgrade pip and install virtualenv
    pip3 install --upgrade pip
    pip3 install virtualenv
        
  3. Navigate to /home/ and git clone:
    cd
    git clone https://github.com/asalt/BCM
        
  4. 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
        
  5. 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
        
  6. (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
        
  7. Prepare the database:
    cd BCM
    python manage.py migrate
        
  8. Define your environment variables See environment_variable_instructions.txt
  9. Launch server
    uwsgi --ini uwsgi.ini
        
  10. Login to Admin Panel
    1. Navigate to http://blake.bcm.edu:8000/admin
    2. login using:
      admin
      pass123
              
    3. Make a new superuser for yourself and delete the default one

About


Languages

Language:JavaScript 42.5%Language:Python 31.3%Language:CSS 12.2%Language:HTML 8.8%Language:TeX 2.2%Language:SCSS 1.5%Language:Less 1.3%Language:Shell 0.1%Language:Ruby 0.0%Language:Makefile 0.0%