This is a tutorial on how to setup your virtual environment and to view your project locally. Although this is long, the steps to view the current project should be very clear. At the end, I provide an example using my folder structure. Please message Anthony Sukadil or anyone from backend on Slack if you are struggling with setting this up.
1. Install the latest version of Python, Python 3.7.1 at https://www.python.org/downloads/release/python-371/
IMPORTANT: When installing python, check off "add python to environment variables" so you can have access to python and pip commands. If you forget or if you come to issues with "command not found", you can do this manually by adding the installation directory to your environment variables, then restarting your computer.
2. I use Git Bash, so for this tutorial, install Git Bash at https://git-scm.com/downloads
pip install virtualenv
4. Change your current directory to a directory where you'd like to have your virtual environment. I would keep it in a CP317 folder:
cd your/directory/here/CP317
python -m venv venv-laze
source venv-laze/Scripts/activate
python -m pip list
Package Version
---------- -------
pip 10.0.1
setuptools 39.0.1
(venv-laze)
your/current/working/directory
pip install django==2.1.2
cd directory/where/you/pulled/or/cloned/laze/Web/laze
python manage.py runserver
10. You should see in your terminal the following message (sometimes it doesn't show up on startup, not an issue):
Performing system checks...
System check identified no issues (0 silenced).
DATE HERE AND TIMESTAMP
Django version 2.1.2, using settings 'laze.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK
11. Now go to the url 'http://127.0.0.1:8000/' and you can view the map. For login, go to 'http://127.0.0.1:8000/accounts/login'.
deactivate
C:/Users/Anthony/Documents/cp-master/CP317/laze
C:/Users/Anthony/Documents/cp-master/CP317/venv-laze
These are the commands to run the server using my folder structure on Windows and I have skipped the steps to create the virtual environment and install Django since it should be very clear:
Anthony@Anthony-PC MINGW64 ~
$ cd Documents/cp-master/CP317/venv-laze/
Anthony@Anthony-PC MINGW64 ~/Documents/cp-master/CP317/venv-laze
$ source Scripts/activate
(venv-laze)
Anthony@Anthony-PC MINGW64 ~/Documents/cp-master/CP317/venv-laze
$ cd ..
(venv-laze)
Anthony@Anthony-PC MINGW64 ~/Documents/cp-master/CP317
$ cd laze/Web/laze/
(venv-laze)
Anthony@Anthony-PC MINGW64 ~/Documents/cp-master/CP317/laze/Web/laze (master)
$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
November 21, 2018 - 22:44:00
Django version 2.1.2, using settings 'laze.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
(venv-laze)
Anthony@Anthony-PC MINGW64 ~/Documents/cp-master/CP317/laze/Web/laze (master)
$ deactivate
Anthony@Anthony-PC MINGW64 ~/Documents/cp-master/CP317/laze/Web/laze (master)
$