Notes for Studying Django
- Once you added a new application to INSTALLED_APPS, the database tables need to be updated, thus you need to run python manage.py syncdb.
- Normally the server auto-reloads code every time you modify a file, but creating a new file does not trigger the auto-reloading logic. If a new file is added you need to restart the development server by using python manage runserver.
- The url() function is passed four arguments, two required: regex and view, and two optional: kwargs, and name.
- Each view is responsible for doing one of two things: returning an HttpResponse object containing the content for the requested page, or raising an exception such as Http404.
Notes for Studying Django的更多相关文章
- Python Django Learning Notes..
The first time I came across django was last month.. Since then I was considering it as the better c ...
- django notes 七:Using Forms
form 也没什么可说的,我只给一个例子大家就懂了 form model from django import forms class UserForm(forms.Form): username = ...
- django notes 六:数据库 CRUD 操作
CRUD 也没什么可说的,django 提供了完善的 orm api, 直接用就行了. 我只贴几个列子,一看就明白了,自己再用用就熟了. # create b = Blog(name='Beatle ...
- django notes 五:Writing models
models 其实也没什么好说的,就是普通的 python 类 settings 中配置数据库连接 DATABASES = { 'default': { 'ENGINE': 'django.db.ba ...
- django notes 四: Writing views
views 其实没什么可看的, 在 django 中 views 就是 controller, 是处理请求的, 就是一个普通的 python 方法. 一般从 request 中提取请求参数, 然后 ...
- django notes 三:Template 的查找
django 中有 2种 Template Loader django.template.loaders.filesystem.Loader django.template.loaders.app_d ...
- django notes 二:URL dispatcher
一般在 settings.py 中会有一个 ROOT_URLCONF ,请求到来时 django 会从 ROOT_URLCONF 指向的文件中查找 urlpatterns 变量配置的路由. url ...
- django notes 一:开篇
公司 web 框架用的是 django, 以前没用过,打算这两周好好看看. 边学习边整理一下笔记,加深理解. 好像谁说过初学者更适合写入门级的教程,我觉得有一定道理. 高手写的教程有一定深度,不会写入 ...
- Django notes III: Dynamic filtering
EXTRACTED from the Django document It's a common need to filter down the objects given in a list pag ...
随机推荐
- 用"时:分:秒"的方式显示运行时间
import datetime,time start = datetime.datetime.now()...dosomething() end = datetime.datetime.now()pr ...
- Tcc学习笔记(一) 开篇
TCC,全称Tiny C Compiler(http://bellard.org/tcc/),是一个颇具特色的C编译器,你能把它当作一个C语言解释器来用,也可以嵌入你自己的应用程序作一个动态代码生成器 ...
- C#获取本机公网IP
/// <summary> /// 获取本机公网IP /// </summary> /// <returns></returns> public sta ...
- Eclipse各种配置
1.配置工作空间编码 Window -- Preferences-- Genereal -- Workspace (Text file encoding -- orther -- utf-8) 2 ...
- laravel之缓存配置文件
清除之前配置文件缓存,并生成新的配置文件缓存, get bash: php artisan config:cache 如下图,以上命令会将config文件夹下所有的文件内容缓存到bootstrap/c ...
- Oracle Cursor
1.概念 游标:从字面来理解就是游动的光标.用数据库语言来描述,游标是映射在结果集中一行数据上的位置实体,有了游标,用户就可以访问结果集中的任意一行数据了.将游标放置到某行后,即可对该行数据进行操作, ...
- 初学git(一):创建本地“仓库”
初学git(一):创建本地“仓库” 作为一个初学者,我是跟着廖学峰老师的官方博客学习,这里只是做个笔记,哈哈,关于git的历史.和其他版本控制的对比啥的,我就不说了.另外,我这里用的是Mac OS X ...
- django TEMPLATES
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dic ...
- XE3随笔18:实例 - 解析 Google 关键字搜索排名
同上例类似, 通过 'http://clients1.google.cn/complete/search?&q=' + "关键字" 可以获取 Google 的关键字搜索排名 ...
- 常见sizeof 笔试题
最近面试过程中遇到了很多很多sizeof的问题. 现在总结一下: #include <stdio.h> #include <string.h> void fun(int arr ...