2019年6月27日
摘要:
程序目录 urls.py """s14_day21 URL Configuration"""from django.contrib import adminfrom django.conf.urls import url,includefrom app01 import viewsurlpatter
阅读全文
posted @ 2019-06-27 19:58
SZ_文彬
阅读(252)
推荐(0)
摘要:
默认值:url(r'index/', views.index,{'name':"root"})def index(request,name): print(name) return HttpResponse('ok')命名空间:/a/ include('app01.urls',namespace='
阅读全文
posted @ 2019-06-27 19:54
SZ_文彬
阅读(189)
推荐(0)
2019年6月15日
摘要:
程序目录 Models.py from django.db import models# Create your models here.class Business(models.Model): #默认id列 caption=models.CharField(max_length=32) code
阅读全文
posted @ 2019-06-15 21:09
SZ_文彬
阅读(550)
推荐(0)
摘要:
数据库设置字符编码CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;修改表的编码alter table app01_host charset='utf8';授权grant all privileges
阅读全文
posted @ 2019-06-15 20:59
SZ_文彬
阅读(146)
推荐(0)
2019年6月11日
摘要:
一:路由系统 url 1.url(r'^index/', views.index),url(r'^home/',views.Home.as_view()), 一个url对应一个函数或一个类 2.url(r'^detail-(\d+).html',views.detail), 一类url对应一个函数或
阅读全文
posted @ 2019-06-11 20:47
SZ_文彬
阅读(259)
推荐(0)
2019年6月9日
摘要:
程序目录 Project-->urls.pyfrom django.contrib import adminfrom django.conf.urls import url,includeurlpatterns = [ url(r'^admin/', admin.site.urls), url(r'
阅读全文
posted @ 2019-06-09 23:09
SZ_文彬
阅读(1123)
推荐(0)
摘要:
App01 >urls.py from django.contrib import adminfrom django.conf.urls import urlfrom app01 import viewsurlpatterns = [ url(r'^login/', views.login), ur
阅读全文
posted @ 2019-06-09 15:31
SZ_文彬
阅读(380)
推荐(0)
2019年6月8日
摘要:
S14day19 >urls.py from django.contrib import adminfrom django.conf.urls import url,includeurlpatterns = [ url(r'^cmdb/',include('app01.urls')), url(r'
阅读全文
posted @ 2019-06-08 23:19
SZ_文彬
阅读(241)
推荐(0)
2019年6月5日
摘要:
Urls.py from django.contrib import adminfrom django.conf.urls import urlfrom cmdb import viewsurlpatterns = [ url(r'^admin/', admin.site.urls), # path
阅读全文
posted @ 2019-06-05 17:48
SZ_文彬
阅读(222)
推荐(0)
摘要:
安装 pip install django环境变量: C:\Program Files\Anaconda3\Scriptsdjango-admin startproject mysite 创建django工程mysite目录 -mysite #对整个程序进行配置 - __init__ -settin
阅读全文
posted @ 2019-06-05 17:47
SZ_文彬
阅读(208)
推荐(0)