The repository for Donut. Written using Python/Flask and powered by MariaDB.
You must be on Caltech wifi or use a VPN (http://imss.sites.caltech.edu/services/wired-wireless-remote-access/Virtual-Private-Network-VPN)
Gain SSH access to the server:
AWS Domain:
Email the public key to the Directly Responsible Individual for the Getting Started section of the Site rewrite project.
The .ssh config file lets you configure a ssh connection so you don't have to.
Example ~/.ssh/config
on your personal machine:
Host donut-dqu
HostName donut.caltech.edu
User dqu
LocalForward 9000 127.0.0.1:50XX
(Where 50XX is a unique port number on the server we should each use)
Now to SSH into the server, we can type from terminal ssh donut-dqu
Clone the repository:
git clone https://github.com/ASCIT/donut.git ~/donut
# Or use git@github.com:ASCIT/donut.git to avoid having to type your password every time you push
Set up your virtualenv and install requirements in that virtualenv
make fresh-install
This (see Makefile
)
~/virtualenvs/donut-py3
requirements.txt
into the virtualenv.~/.profile
to automatically activate the virtualenv when you login.To deactivate the virtualenv (which you shouldn't need to do), simply type deactivate
You also need a few config files which are omitted from the repository for security reasons: donut/config.py
and calendar.json
. Ask a Devteam member to copy these to your clone of the repository.
make lint
make test
The easiest way to set up a test site is to use SSH port forwarding, so that requests to your local computer are forwarded to the development server. For example:
ssh -L 9000:localhost:5000 <host>
This will forward your local port 9000 so that visiting localhost:9000 on your local computer is equivalent to visiting localhost:5000 on the remote server. Flask's debugging environment defaults to port 5000, but you can change that in your config.py
file (multiple people cannot simultaneously bind to the same port through SSH port forwarding).
To start the test site:
python run_server.py -e dev -p 50XX
You can visit the test site by going to localhost:9000 (or whichever port you decided to forward) in your local browser.
master
, you must refresh the server to update the site. After sshing, run
cd /home/ascit/donut
sudo git pull
sudo apachectl restart