Django Guide - bounswe/2021SpringGroup2 GitHub Wiki

Setting up

  1. Download Python latest version

    Check Python version with:

    python3 --version (for Mac)
    python --version (for Windows)
    
  2. Install pipenv

    pip3 install pipenv
    
  3. 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

  1. Run Python interpreter for the virtual environment we created.

    While at 2021SpringGroup2/backend, run:

    pipenv shell
    
  2. Then you can see a list of commands with:

    python manage.py
    
  3. 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, run python [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!