DEV Community

Cover image for First Django App For Beginners Part1 (setup & installation)
Abdul Azeez
Abdul Azeez

Posted on • Updated on • Originally published at thisisazeez.github.io

First Django App For Beginners Part1 (setup & installation)

What is Django?
Django is a high-level Python web framework that encourages clean development and fast, with pragmatic design.

Why Django?

  1. Ridiculously fast.
    Django was designed to guide developers take projects from intellection to completion as quickly as possible.

  2. Reassuringly secure.
    Django takes security seriously and helps developers avoid many common security mistakes.

  3. Exceedingly scalable.
    Some of the busiest sites on the web ascendancy Django’s ability to quickly.

Before You Start make sure you have python installed on your computer.

You must have Python installed on your system if you don't have check out link to python.org

Let's Start!

Step 1: Installation pip install django
So step 1, will install django on your system

Step 2: To start a project use this command django-admin startproject mysite then cd to wherever the project folder is in and run this command to create a app python manage.py startapp sites to create a app

Project Folder Structure:

mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py
Enter fullscreen mode Exit fullscreen mode

App Forlder Structure:

sites/
    __init__.py
    admin.py
    apps.py
    migrations/
        __init__.py
    models.py
    tests.py
    views.py
Enter fullscreen mode Exit fullscreen mode

Then run your server with this command: python manage.py runserver
You will see a success page like this:
Success Page

for you to make changes in your app folder and for it to work you will have to register your app inside your settings.py like this below

Line 34 in your settings.py file

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'your_app_name_here', # your app(s) goes inside this list
]
Enter fullscreen mode Exit fullscreen mode

Part two will contain views and urls

Top comments (0)