Django Skeleton App

Django skeleton app is an app with only necessary and sufficient features to showcase the django reuqest response cycle. A simple Hello world text will be shown on the screen when the homepage is requested.

New Django Project & App

To get started with the skeleton project or the hello world project we must have python and django installed. Here is a quick recap of all pre-requisites: /p>

To install Django LTS version 2.2:

    pip install django==2.2

To verify django version:

    django-admin --version

To start new project:

    django-admin startproject mysite
    cd mysite
    python migrate

To start new app

    python startapp myapp

Below we have the code from each necessary module.

mysite :


mysite :

    from django.contrib import admin
    from django.urls import path, include
    urlpatterns = [
        path('myapp/', include('myapp.urls'))

myapp :

The module has to be created manually, under myapp directory.

    from django.urls import path
    from . import views 
    urlpatterns = [
        path('', views.index)

myapp :

    from django.shortcuts import render
    def index(request):
    	return render(request, 'index.html', {})

mysite : templates : index.html

The templates directory has to be created manually, under myapp directory. Then then index.html is also maually put under the templates directory.

    Hello World

Django runserver

Finally, run the developent server and visit localhost on port 8000.

    python runserver

And in you favourite web browser open url:
Django hello world project