django installation process:
=============================
pip install virtualenvwrapper-win
mkvirtualenv test
pip install django
django-admin --version
mkdir yourfolder
cd yourfolder
django-admin startproject yourprojectname
python manage.py runserver
to create virtual environment in vscode:
=======================================
workon "base"
python manage.py startapp yourapp
creating your app:
=======================
create urls.py in your app
urlpatterns=[
path('',views.home,name='home')
]
go into views.py
add :from django.http import HttpResponse
create a function home
def home(request):
return HttpResponse("we are into our own page");
go into urls project:
add below line
path('',include('yourapp.urls'))
No comments:
Post a Comment