How to make python project using Django framework ?? | Create helloworldApp using python Django fram

Updated: Jun 23, 2019


In previous Blog we discussed about how to install Django and how to run server. Now in this blog we will discussed about how to make changes in project file so it run properly. For example we will create a simple helloworldApp.

After setting path run these two commands on the cmd:

"path">django-admin startproject DemoApp

and run again this one to create helloworldAPP

C:\Users\naveen kumar\nawproject\djangorpoject\myproject>python manage.py startapp helloworldApp

And after this

>Python manage.py migrate

After running server:

Open pycharm and open DemoApp folder by selecting option in pycharm as per screenshot.:

file>open>select location and done ok.


When server is started first setup these three file(urls.py, setting.py and view.py) by using some code line(module name helloworldApp(project name))

urls.py:

from django.contrib import admin

from django.urls import path

urlpatterns = [ path('admin/', admin.site.urls),

If your create helloworldApp module than add two code line: from django.contrib import admin from django.urls import path from helloworld.views import View urlpatterns =

[ path('admin/', admin.site.urls), path('helloworldApp/',View)

]

setting.py:

Set app mane in installed Apps

Before adding app name:

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

After adding app name:

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

view.py:

Before adding code line it looks like that:

from django.shortcuts import render

from django.http import HttpResponse

return HttpResponse("Hello")

After adding code line:

from django.shortcuts import render

from django.http import HttpResponse

def View(request):

return HttpResponse("Hello")

Start server by using:

>Python manage.py runserver

and run http://127.0.0.1:8000/app0/ on local browser

Output:hello

For more details contact here or a any help go to the codersarts website.

If you like Codersarts blog and looking for Assignment help,Project help, Programming tutors help and suggestion you can send mail at contact@codersarts.com.

Please write your suggestion in comment section below if you find anything incorrect in this blog post.


#howtomakedjangoassignment #Djangoassignmenthelp #Djangoexperthelp #Howtomakedjangoproject #Djangoprojecthelp #Djangohomeworkhelp #Howtomakedjangoprojectusingpycharm #topDjangoassignmenthelp #assignmenthelpinuk #Djangoframeworkassignmenthelp

Contact Us

Tel: (+91) 0120  4118730  

Time :   10 : 00  AM -  08 : 00 PM IST 

Registered address: G-69, Sector 63, 

 Noida - 201301, India

We Provide Services Across The different countries

USA    Australia   Canada   UK    UAE    Singapore   New Zealand    Malasia   India   Ireland   Germany

CodersArts is a Product by Sofstack Technology Solutions Pvt. Ltd.

  • CodersArts | Linkedin
  • Instagram