Django Guide - bounswe/2021SpringGroup2 GitHub Wiki
Setting up
-
Download Python latest version
Check Python version with:
python3 --version (for Mac) python --version (for Windows)
-
Install
pipenv
pip3 install pipenv
-
To install django, run in the backend folder (
2021SpringGroup2/backend/
):pipenv install django
This command installs django virtual environment under
/Users/bikembengisu/.local/share/virtualevs/backend-QHJv7y2b/
for me.This path will be something like
C:\\...
in Windows.This path is visible in the terminal after you have run
pipenv install django
command.
Running the server
-
Run Python interpreter for the virtual environment we created.
While at
2021SpringGroup2/backend
, run:pipenv shell
-
Then you can see a list of commands with:
python manage.py
-
And you can run the server with:
python manage.py runserver
The default port is
8000
. If you want to run it in another port, runpython [manage.py](http://manage.py) runserver 9000
, for example.In the terminal window, you get a link to the running server, such as
http://127.0.0.1:8000/
. Go to that address in the browser and you're good to go!