The following article explains how to Create a Simple Django App.

  1. Navigate to the root directory of your Django project in the command prompt or terminal.
  2. Create a new app named “myapp” as given below.
python startapp myapp
  1. So, you will get “myapp” in your project directory, with the following file structure.
  1. Open the “” file in your text editor and add the following code.
from django.http import HttpResponse

def index(request):
    return HttpResponse("Hello, world!")

This creates a simple view that returns a “Hello, world!” message when the app is accessed.

  1. Open the “” file in the “myapp” directory and add the following code.
from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name='index'),

This maps the root URL of the app to the “index” view that you just created.

  1. Finally, open the “” file in your project directory and add the following code to include the URLs of your “myapp” app.
from django.contrib import admin
from django.urls import include, path

urlpatterns = [
    path('myapp/', include('myapp.urls')),

This includes the URLs of your “myapp” app under the “/myapp” URL.

  1. Now you can run the development server using the following command.
python runserver
  1. Open your web browser and go to “http://localhost:8000/myapp/“. The “Hello, world!” message should appear that you defined in your view.

Congratulations, you have created a simple Django app!

Further Reading

Introduction to Django Framework and its Features

Django Practice Exercise

Examples of Array Functions in PHP

Basic Programs in PHP

Registration Form Using PDO in PHP

Inserting Information from Multiple CheckBox Selection in a Database Table in PHP