Skip to content

M4GICB/hello_world_django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My First Django Web App: hello_world_django

Description:

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

Table of Contents

  1. Set Up
    1. Requirements
    2. Steps
      1. Installing Python
      2. Installing PIP
      3. Installing Django
      4. Verifying Django
  2. Running The Web App
  3. Creating Your Own Django Project

Set Up:

Requirements:

  1. Python
  2. Pip
  3. Django
  4. A text editor

Table of Contents

Steps

1. Install Python

  1. First check if python is installed or not by opening your terminal and typing the following command.
python --version
  1. If python is properly installed your output should look like:
Python 3.8.5
  1. If your version of python is earlier than this, you need to install the latest version of python.
  2. Install python: https://www.python.org/downloads/

Table of Contents

2. Install Pip

  1. First check if pip is properly installed or not by opening your terminal and typing the following command:
pip --version
  1. If python is properly installed your output should look like:
pip 20.3.3
  1. If your version of pip is earlier than this, you need to install the latest version of pip.
  2. Install Pip: https://pip.pypa.io/en/stable/installing/

Table of Contents

3. Install Django

  1. 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
  1. If Django is properly installed your output should look like:
3.1.4
  1. If your version of Django is earlier than this, you need to install the latest version of Django.
  2. Install Django by running the following command:
pip install django
  1. Make sure Django installed correctly by checking the version again
  2. Repeat Step 1 and 2 in Part 3. Install Django

Table of Contents

4. Verifying Django Installation

  1. 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.

Table of Contents

Running The Web App

1. Clone this repo

2. Navigate to the directory (within the terminal) where you saved this repo

3. Run the manage.py file to start the server.

  • Run the following command
python manage.py runserver

4. If there are no errors, your output should look like the following:

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.

5. Open your web browser and navigate to the site provided in the final line of the output message

Table of Contents

Creating Your Own Django Project

Table of Contents

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages