This is a basic web application that has a blog home page and a blog about page. The home page is routed to localhost:8000/
. The about page is routed to localhost:8000/about
. This is a basic proof of concept project that shows how to set up a python Django web application for learning purposes.
Tutorial Being Followed: Corey Schafer Django Tutorial - https://youtube.com/playlist?list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
- Python
- Pip
- Django
- A text editor
- First check if python is installed or not by opening your terminal and typing the following command.
python --version
- If python is properly installed your output should look like:
Python 3.8.5
- If your version of python is earlier than this, you need to install the latest version of python.
- Install python: https://www.python.org/downloads/
- First check if pip is properly installed or not by opening your terminal and typing the following command:
pip --version
- If python is properly installed your output should look like:
pip 20.3.3
- If your version of pip is earlier than this, you need to install the latest version of pip.
- Install Pip: https://pip.pypa.io/en/stable/installing/
- First check if Django is installed or not by opening your terminal and typing the following command. If there are problems with this, follow along with Verifying Django Installation
python -m django --verison
- If Django is properly installed your output should look like:
3.1.4
- If your version of Django is earlier than this, you need to install the latest version of Django.
- Install Django by running the following command:
pip install django
- Make sure Django installed correctly by checking the version again
- Repeat Step 1 and 2 in Part 3. Install Django
- See https://www.djangoproject.com/download/ for further installation documentation.
- To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django:
>>> import django
>>> print(django.get_version())
3.2
- You may have another version of Django installed.
- Run the following command
python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
December 22, 2020 - 18:51:30
Django version 3.1.4, using settings 'django_project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
- You can also replace the
127.0.0.1
withlocalhost
- eg. instead of navigating to http://127.0.0.1:8000/ you can navigate to http://localhost:8000/
- this will take you to the
Blog Home Page
. Navigate to http://localhost:8000/about to visit theAbout Page
- For a more detailed tutorial on starting your own django project instead of running this pre built one: