How to Run the Weather App server:
-
Using CLI, go to the WeatherApp project path (where the manage.py is located): $ cd /c/djangoweather/weather
-
Start Django web server with this command: $ python manage.py runserver
-
Now the Django server is running on: http://localhost:8000/
#Additional info to setup the development environment:
How to setup the virtual environment for development:
-
Create new project directory (this folder will hold 2 things, the virtual env AND the WeatherApp project itself): $ mkdir /c/djangoweather
-
Move into the project directory: $ cd /c/djangoweather
-
Install the virtual environment python module: $ pip install virtualenv
-
Create a virtual environment called 'venv' (last argument of the command): $ python -m venv venv
-
Turn on the virtual environment (to deactivate the virtual env: $ deactivate): $ source venv/Scripts/activate
How to install Django:
-
Move into the project directory: $ cd /c/djangoweather
-
Install Django: $ pip install django
How to create the new WeatherApp project itself (named 'weather'):
-
Move into the project directory: $ cd /c/djangoweather
-
Create the new project WeatherApp (named 'weather'): $ django-admin startproject weather
The directory organization would be as follows:
- /c/djangoweather/venv
- /c/djangoweather/weather
- /c/djangoweather/weather/weather
- /c/djangoweather/weather/lookup