自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 Django:Procedre of starting a project

Create a project:$ django-admin startproject mysiteThe deployment runserver:$ python manage.py runserverCreating the Polls app:$ python manage.py startapp pollsWrite View:(1) mysite/url...

2019-07-23 14:06:14 118

转载 A shortcut: render()

from django.http import HttpResponsefrom django.template import loaderfrom .models import Questiondef index(request):latest_question_list = Question.objects.order_by(’-pub_date’)[:5]template = lo...

2019-07-12 14:21:27 140

转载 How Django processes a request

ExampleHere’ s a sample URLconf:from django.urls import pathfrom . import viewsurlpatterns = [path(‘articles/2003/’, views.special_case_2003),path(‘articles/int:year/’, views.year_archive),path...

2019-07-11 16:08:20 101

转载 正向和反向查询

正向和反向查询

2019-07-08 15:31:14 3346

转载 Context in Django

When you use a Django Template, it is compiled once (and only once) and stored for future use, as an optimization. A template can have variable names in double curly braces, such as {{ myvar1 }} and {...

2019-07-08 14:28:22 80

转载 Django: Model, Object, QuerySet

Model: A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single databa...

2019-06-26 10:47:12 232

转载 Django: MVC framework

Django appears to be a MVC framework, but you call the Controller the “view”, and the View the “template”. How come you don’t use the standard names?¶Well, the standard names are debatable.In our in...

2019-06-26 10:13:09 107

转载 Django: Double underscore

Lookups that span relationshipsDjango offers a powerful and intuitive way to “follow” relationships in lookups, taking care of the SQL JOINs for you automatically, behind the scenes. To span a relati...

2019-06-21 15:26:40 152

原创 Django: Making model changes

Three-step guide to making model changes:Change your models (in models.py).Run python manage.py makemigrations to create migrations for those changesRun python manage.py migrate to apply those chan...

2019-06-20 10:51:32 172

原创 Django: Including Apps

Django: Including Apps欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导...

2019-06-20 10:38:08 116

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除