This project uses
- postgresql as a database
- django as backend
- python for programming language
You are expected to have a working PostgreSQL installation
and have an already setup database for the project.
If not, please refer to the official website for more informations
If you're on Linux, replace the python and pip commands
with python3 and pip3
Clone the repository using the command:
git clone https://github.com/Computer-Science-Group/cs-django-library.git
or by using the download zip in your browser and extract it
Switch to that directory you extracted/downloaded
The python version used in this project is 3.7.8
To get started, you need to have python 3.7
installed along with pip and venv (or virtualenv)
You can get it from here
For Linux, you can use your package manager or use pyenv for that
First create a virtual environemnt using the command:
python -m venv venv
or if you use virtualenv
python -m virtualenv venv
next source to your virtual envirnonment
.\venv\Scripts\activate.bat
Create a virtual environment using the command:
python3 -m venv .venv
Notice the . before venv, important
Next source it using
source ./.venv/bin/activate
Now that you have a working virtual environment,
we need to install our dependencies
Luckily, we have a requirements.txt file
containing all we need
pip install -r requirements.txt
First, you need to run the script generate_random_key.py
in the root folder
you can run it using the command:
python generate_random_key.py
it will print out a key, copy it
Next, create a .env file next to manage.py
IMPORTANT
The . in .env is mandatory, you cannot remove it
Open you .env file and add the following line to it
SECRET_KEY=
then paste your copied key
then add the following line under your SECRET_KEY
DATABASE_NAME=YourPostgreSQLDatabaseName
DATABASE_USER=YourPostgreSQLUsername
DATABASE_PASSWORD=YourPostgreSQLUserPassword
Finally, run the following commands:
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
If it runs without errors, open your browser to your localhost link, it should display a page
Please see the Contribute for more information