[セットトップ]一、Djangoフレームワークの作成

1951 ワード


  
  
  
  
1、 Django django-admin startproject sitename APP python manage.py startapp app01 python manage.py startapp app02 python manage.py syncdb

cls app admin.py   models.py tests.py   views.py   http://127.0.0.1:8000/ http://127.0.0.1:8000/admin/ urls.py from django.conf.urls import include, url from django.contrib import admin from app01 import views urlpatterns = [     url(r'^admin/', include(admin.site.urls)),     url(r'^home/', views.home), --------------------------------------------------------- views.py from django.shortcuts import render from django.shortcuts import HttpResponse # Create your views here. def home(request):      return HttpResponse('ok') ---------------------------------------------------------- http://127.0.0.1:8000/home/
2、 django #wget https://bootstrap.pypa.io/get-pip.py #python get-pip.py #pip install Django==1.6 , 。 #python -c "import django; print(django.get_version())"