Open In App

How to Create a Basic Project using MVT in Django ?

Prerequisite – Django Project MVT Structure
 

Assuming you have gone through the previous article. This article focuses on creating a basic project to render a template using MVT architecture. We will use MVT (Models, Views, Templates) to render data to a local server.
 



Create a basic Project: 

django-admin startproject projectName
cd projectName




# HttpResponse is used to
# pass the information
# back to view
from django.http import HttpResponse
 
# Defining a function which
# will receive request and
# perform task depending
# upon function definition
def hello_geeks (request) :
 
    # This will return Hello Geeks
    # string as HttpResponse
    return HttpResponse("Hello Geeks")



from projectName.views import hello_geeks

path('geek/', hello_geeks), 

$ cd env_site
$ cd Script
$ activate
$ cd ..
$ cd geeks_site
$ python manage.py runserver
http://127.0.0.1:8000/geek/

Article Tags :