This is the (eventual) unified home of all Penn Courses products. Currently, products contained in here include:
- Penn Courses API
- Penn Course Plan
- Penn Course Alert
Make sure you have
Setting up the Django Backend
git clone firstname.lastname@example.org:pennlabs/penn-courses.git
- You may run into some issues installing the mysql python driver on macOS. The development environment will use sqlite3 as the database by default, so this is not something to worry about.
- However, if you do want to run locally with the production database,
brew install openssl
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
pipenv shellto activate the virtual environment
python manage.py migrate
- Make sure everything works by running
python manage.py testand ensuring all tests pass.
Setting up the Penn Course Plan Frontend
Make sure you have
nodejs installed, which will also install
along with it.
Run in development
Make sure you're in the base directory of the project.
To run the backend server, run
pipenv run python manage.py runserver 8000
To run a frontend development server (for example, Penn Course Plan),
The local version of the site should open in your default browser, and as long as the back-end is running on port 8000, requests will be proxied between the two development servers.
Loading Course Data
This project isn't too useful without Penn course data. To load in
course data, set the environment variables
Token credentials, respectively, that you recieve
from the Penn OpenData API when you register for an API key. After those
have been set, run
python manage.py loadcourses --semester=<semester> --query=<query>
semester be the desired semester (for example,
Fall 2019), and let query be the prefix of all courses you would like to
load in. If you're just interested in the CIS department, put
you'd like to load in ALL courses, omit the query parameter. Note
that this will take a long time, as all sections in Penn's course catalog,
along with rooms, buildings, and instructors will be loaded in.