0% found this document useful (0 votes)
18 views1 page

Django

This document provides a step-by-step guide for setting up a Django project using Python. It includes instructions for installing Python, creating a virtual environment, installing Django, and setting up a simple Django application with views and URL routing. The final steps involve running the Django server and migrating the database.

Uploaded by

kantha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Django

This document provides a step-by-step guide for setting up a Django project using Python. It includes instructions for installing Python, creating a virtual environment, installing Django, and setting up a simple Django application with views and URL routing. The final steps involve running the Django server and migrating the database.

Uploaded by

kantha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Summery

1. Download and install Python https://www.python.org/


2. Check the version python --version
3. Check package manager like PIP pip --version
4. Create Virtual Environment with py -m venv amcec
the name "amcec"
5. Activate the environment amcec\Scripts\activate.bat
6. Install Django while you are in the (amcec) C:\Users\thagadoor>py -m
virtual environment pip install Django
7. Check Django Version django-admin --version
My First Project
8. Navigate to the Virtual django-admin startproject my_first
environment folder
9. Run the Django Project (Navigate py manage.py runserver
to the /my_first folder and
execute this command in the
command prompt)
10. Django Create App (name my app py manage.py startapp members
"members")
11. Django Views from django.shortcuts import render
(my_first/members/views.py:)
from django.http import
HttpResponse
def members(request):
return HttpResponse("Hello!
Welcome to Django world.")
12. Create a file named urls.py in from django.urls import path
the same folder as
the views.py file from . import views
urlpatterns = [
path('', views.members,
name='members'),
]
13. Open the file named
my_first/my_first/urls.py: from django.contrib import admin

Migrate the server using the command: from django.urls import include,
py manage.py migrate path
and run the command:
py manage.py runserver
urlpatterns = [

path('',
include('members.urls')),

path('admin/',
admin.site.urls),

You might also like