Follow these steps to start a local Django server using a PostgreSQL database: 1) If you don’t have it already, download Python from here. 2) To install the packages, you first need to make a virtual environment for Python, which will help us ensure that our libraries & Python versions are unified. You can do so be by running:
python3 -m venv env
env/
folder. Lib/
on Windows)Scripts/
on Windows & bin/
on Unix systems) that contains the scripts that you need to start the virtual environment.source env/bin/activate
./env/Scripts/activate
execution of scripts is disabled on this system
, then open another PowerShell as Administrator and run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
.
source env/bin/activate
or ./env/Scripts/activate
anytime you want to interact with the server(i.e. to run it with python manage.py runserver
)
3) Now, run pip install -r requirements.txt
to install the necessary packages for the project.psycopg2
run:
brew reinstall openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
4) Set up a PostgresQL server by following one of these guides, and make sure you set the name of the database when prompted to dbautoscheduler
:dbautoscheduler
has been created:\l
in the psql prompt and see if dbautoscheduler
is in the list.dbautoscheduler
is in the tree menu.
7) If you'd like to get the current project running, you can clone the repository with git clone https://github.com/gannonprudhomme/AutoScheduler/
and run the steps below.The only thing set up currently is scraping a single department worth of courses(CSCE) and scraping all of the departments.
To do these,
1) If you're not running in the virtual environment(you should see (env)
somewhere in your current terminal line), run source env/bin/activate
or ./env/Scripts/activate
2) Run cd autoscheduler
3) Run ./manage.py makemigrations
and ./manage.py migrate
to generate SQL that will be used to fill the database.
4) Run ./manage.py createsuperuser
to create a user for Django.
5) Run ./manage.py scrape_dept
to scrape all of the available departments.
6) Run ./manage.py scrape_courses
to scrape the courses, sections, and instructors.
If ./manage.py
isn't working, try to use python manage.py
or python3 manage.py
in place of it.