django make app
...\> django-admin startproject mysite
django make app
...\> django-admin startproject mysite
django hello world
django hello world
====================
python -m virtualenv myenv
myenv\scripts\activate.bat
pip install -r requiremets.txt
#--------------------
django-admin startproject [project-name] .
python manage.py startapp [app-name]
#--------------------
project > settings.py >
INSTALLED_APPS = [
.
.
.
[app-name]
]
#--------------------
project > urls.py >
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('home.urls')),
]
#--------------------
app > urls.py >
from django.urls import path
from home import views
urlpatterns = [
path('', views.index),
]
#--------------------
app > views.py
from django.http.response import HttpResponse
def index(request):
return HttpResponse('Hello world')
#--------------------
python manage.py makemigrations home
python manage.py migrate
python manage.py runserver
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us