Home to the REST API server for Slotify.
- git clone the repository (either via GitHub desktop or CLI)
git clone <Project A> # Cloning project repository
- change to project directory
cd <Project A> # Enter to project directory
- create virtual environment
python -m venv venv
# If not created, creating virtualenv- NOTE: for Mac, you may need to specify
python3
instead ofpython
- activate virtual environment
- Windows:
venv\Scripts\activate.bat
- Mac:
source ./venv/bin/activate
# Activating virtualenv - (Better) using VSCode, select the python interpreter within the
venv
folder and the above is done automatically - Note: When the virtual environment is activated (when your prompt has (venv) preceding it), use pip instead of pip3, even if you are using Python 3. The virtual environment’s copy of the tool is always named pip, regardless of the Python version
- install dependencies
pip install -r requirements.txt
# Installing dependencies
- retrieve
.env
file from google drive
- https://drive.google.com/drive/folders/1BX8SO2EFzaKZPgH5Oh0fcTnit-xm4GOb
- place the
.env
file in the same directory asslotify/settings.py
- note that
.env
file must be ignored by Git
- setup database
- according to the postgresql detail in
.env
file, create the database locally and the relevant database user.
- apply migration
python manage.py migrate
- to add a new package, go to the root directory and
pip install packageName
# venv should be activepip freeze > requirements.txt
# update requirements.txt
Start the django development server by running the following in command-line (make sure that you are in the slotify
directory with manage.py):
cd slotify
python manage.py runserver