Create a django project
1.create a environment
python -m venv myenv
2.activate environment
myenv/Scripts/activate
refer python environment tutorial for more information
https://mamspython.blogspot.com/2022/10/creating-python-envirnment-in-5-ways.html
3.pip install Django
4. pip install djangorestframework
5. django-admin startproject myproject .
6. python manage.py startapp myapp
7. register installed myapp
go to myproj folder
open settings.py
goto varaible list INSTALLED_APPS = [
add 'myapp', to the list
example
INSTALLED_APPS = [
'django_crontab',
'widget_tweaks',
.........
'myapp',
]
8. create urls.py in myapp folder
9. add line in myproj->urls.py
path('',include('myapp.urls')),
10.add serializers.py file in myapp
No comments:
Post a Comment