The ADI website runs natively on Linux and OSX. To get it up an running, follow these steps:
Generate secrets files: Download the ADI website secrets from GitHub. Unzip the folder, and copy its contents into the
If the link gives a 404 error, ask someone within the ADI GitHub organization for access
On OSX, you may have to run
mkdir /data /data/dbbefore you can run
sudo pip install virtualenv
Install SASS gem
gem install sass
Otherwise, you will see an intermittent
./develop.sh # Setup MongoDB, Virtualenv, and Pip source bin/activate # Enter the virtual environment source config/secrets.dev # Set your enviornment variables to "development" python run.py # Run the application
Finally, go to
localhost:5000 in your web browser.
Disabling Google Auth
It is possible to run Eventum without logging in using Google+ or authenticating with Google Calendar. To do so, edit
config/secrets.dev and change the line:
Then, reset the environment variables:
source config/secrets.dev # Set your enviornment variables to "development"
Eventum is the content management system (CMS) that we use to create and edit events, blog posts, user accounts, and more. Eventum is a python package that lives at a different GitHub repository. If you want to make changes to our admin interface (anything at under
/admin), you will have to work on both repositories at the same time. Here's how:
Clone both repositories from the same folder. You will now have an
adi-websitefolder and an
eventumfolder next to each other.
Open two terminal windows:
Terminal window 1
cd adi-website ./develop.sh # Setup MongoDB, Virtualenv, and Pip source bin/activate # Enter the virtual environment source config/secrets.dev # Set your enviornment variables cd ../eventum python setup.py develop # Use this local version of Eventum.
This last command will run once and exit. But if it runs without errors, ADI Website will use the local version of the
eventumpackage. If you make changes in the
/eventumfolder, they will be reflected live.
Terminal window 2
cd adi-website source bin/activate # Enter the virtual environment python run.py # Run the ADI Website.
Note: In order to deploy the ADI website, you must have SSH access to our DigitalOcean server (instructions below).
First, add our DigitalOcean server as a Git remote:
git remote add deploy adi-website:~/adi-website.git
Then, you should be able to deploy using Git:
git push deploy master
Getting SSH Access
Next, create or edit
~/.ssh/config. Add the following lines:
Host adi-website HostName 18.104.22.168 User root IdentityFile ~/.ssh/id_rsa
This creates an ssh alias called
adi-website, that allows us to easily log into this server.
Next, send your public key (
~/.ssh/id_rsa.pub) to someone who has access to the server.
Protip, you can type
cat ~/.ssh/id_rsa.pub | pbcopyto copy it to your clipboard.
On the server, they should append your public key to the
Then you should be done! To test it out, try logging in:
You shouldn't need any password or any additional steps.
How our deployment works:
Here's a short intro into what happens when you type
git push deploy master.
- The lastest changes are pushed to our DigitalOcean server, into a git repo located at
- Once that git repo receives the changes, it runs a script we wrote, called
~/adi-website.git/hooks/post-receive. This script copies the latest changes into the folder where the live code is (
- Then, that script changes directory to the root of our project, and runs
./deploy.sh, which kills the live docker container, and builds a new one with the new code.
Warning: Our tests need some love, and may be broken...
Tests live in the
test directory, and can be run via
nosetests. We also use
flake8 for linting
First, enter your development environment. See "Developing" for more. Then, run the tests:
flake8 app config test script # Run the flake8 linter on our python files nosetests --with-progressive # Run test scripts
About ADI Website
- Built in Flask, using Eventum as a CMS.
- Flask-Mongoengine and Mongoengine are used to interface with MongoDB
- Authentication is done with Google+ server-side flow
- Forms and validation are done through Flask-WTForms and WTForms
- CSS is generated from SCSS and managed with Flask-Assets
- Deployment is done using Docker.
Organization / Structure