Creating My First Django Application Part 2

python runserver

Creating View

from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def hello(request):
text=”<h1>This is my first Application</h1>”
return HttpResponse(text)

URL Mapping

from django.contrib import admin
from django.urls import path
from myapp import views
urlpatterns = [
Our First Html Page

Render HTML files in views

<TITLE>This is a Sample Django Application</TITLE>
<a href=”">Link Name</a>
is a link to another nifty site
<H1>This is a Header</H1>
<H2>This is a Medium Header</H2>
Send me mail at <a href=””></a>.
<P> This is a new paragraph!
<P> <B>This is a new paragraph!</B>
<BR> <B><I>This is a new sentence without a paragraph break, in bold italics.</I></B>
Flow of our Request
Sample Output




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store