![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Django
tonyfy10
这个作者很懒,什么都没留下…
展开
-
Django: Including Apps
Django: Including Apps欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导...原创 2019-06-20 10:38:08 · 103 阅读 · 0 评论 -
A shortcut: render()
from django.http import HttpResponse from django.template import loader from .models import Question def index(request): latest_question_list = Question.objects.order_by(’-pub_date’)[:5] template = lo...转载 2019-07-12 14:21:27 · 131 阅读 · 0 评论 -
How Django processes a request
Example Here’ s a sample URLconf: from django.urls import path from . import views urlpatterns = [ path(‘articles/2003/’, views.special_case_2003), path(‘articles/int:year/’, views.year_archive), path...转载 2019-07-11 16:08:20 · 91 阅读 · 0 评论 -
正向和反向查询
正向和反向查询转载 2019-07-08 15:31:14 · 3328 阅读 · 0 评论 -
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 · 71 阅读 · 0 评论 -
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 · 218 阅读 · 0 评论 -
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 · 100 阅读 · 0 评论 -
Django: Double underscore
Lookups that span relationships Django 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 · 145 阅读 · 0 评论 -
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 changes Run python manage.py migrate to apply those chan...原创 2019-06-20 10:51:32 · 162 阅读 · 0 评论 -
Django:Procedre of starting a project
Create a project: $ django-admin startproject mysite The deployment runserver: $ python manage.py runserver Creating the Polls app: $ python manage.py startapp polls Write View: (1) mysite/url...原创 2019-07-23 14:06:14 · 106 阅读 · 0 评论