没有合适的资源?快使用搜索试试~ 我知道了~
首页Django web开发入门指南
"Django网站开发 - 介绍Django框架的使用,包括Python和Django的安装、动态网页基础、模板系统和数据建模"
在Python的世界里,Django是一个强大的Web开发框架,它遵循Model-Template-View(MTV)设计模式,使得开发者能够快速高效地构建高质量的Web应用。无论你是Python 2还是Python 3的用户,Django都提供了广泛的兼容性,使其成为一个非常适用的选择。
**第一章 Django简介**
这一章主要介绍了Web框架的概念,如MVC(Model-View-Controller)设计模式,以及Django的历史。书中指出,阅读本书需要一定的编程基础,特别是Python知识,同时提到了Django的新特性。此外,还提供了获取Django帮助的途径。
**第二章 入门**
在这一章,作者详细讲解了如何在不同的操作系统上安装Python和Django。官方发布版的安装方法是首选,但同时也介绍了通过subversion安装的选项。接着,讨论了如何配置和选择数据库,包括PostgreSQL、SQLite3和MySQL。启动项目和运行开发服务器也是这一章的重要内容。
**第三章 动态网页基础**
本章深入探讨了如何创建动态内容和视图。首先,解释了如何将URL映射到视图,并详细描述了Django处理请求的过程。URL配置的松耦合特性被强调,同时介绍了404错误处理和动态URL的设计。通过示例,读者可以学习如何创建第二个视图,以及实现更复杂的URL匹配模式。
**第四章 Django模板系统**
这一部分介绍了Django的模板系统,它是实现视图与HTML之间解耦的关键。读者会学习如何创建和使用模板对象,以及如何渲染模板。模板的上下文管理、变量查找和基本的模板标签(如if、for等)及过滤器(如lower、upper等)也在此处得到阐述。模板加载、render_to_response函数、locals()技巧、子目录模板的使用、include标签和模板继承都是这一章的重要知识点。
**第五章 和数据库打交道:数据建模**
这一章开始接触Django的数据模型,展示了在视图中使用数据库的旧方法和MTV模式的优势。数据库的配置过程被详细讲解,包括创建第一个应用程序。通过实例,读者可以学习如何定义模型类,这些类对应于数据库中的表,以及如何执行数据库查询。
这份资源提供了一个全面的Django入门教程,涵盖了从安装到实际开发的各个环节,适合对Python和Web开发感兴趣的初学者。通过学习,你可以掌握创建动态网站的基本技能,并为进一步深入Django的高级特性打下坚实的基础。
The Django Book
16 http://djangobook.py3k.cn/
get_FOO_filename() ..........................................................................................................................401
get_FOO_url() ...................................................................................................................................401
get_FOO_size() ..................................................................................................................................402
save_FOO_file(filename, raw_contents) ............................................................................................402
get_FOO_height() and get_FOO_width() ...........................................................................................402
捷径 .....................................................................................................................................................402
get_object_or_404() .........................................................................................................................402
get_list_or_404() ...............................................................................................................................403
回归原始的 SQL 操作 ..........................................................................................................................403
附录 D 通用视图参考 .............................................................................................................................405
通用视图的常见参数 ...........................................................................................................................405
简易通用视图 ......................................................................................................................................405
渲染模板 ..........................................................................................................................................406
重定向到另外一个 URL ....................................................................................................................406
列表/详细 通用视图 ...........................................................................................................................407
对象列表 ..........................................................................................................................................407
Detail Views ......................................................................................................................................409
基于日期的通用视图 ...........................................................................................................................412
存档索引 ..........................................................................................................................................412
Year Archives ....................................................................................................................................414
Month Archives .................................................................................................................................415
Week Archives ..................................................................................................................................417
Day Archives .....................................................................................................................................419
Archive for Today ..............................................................................................................................420
Date-Based Detail Pages ....................................................................................................................421
Create/Update/Delete Generic Views ...................................................................................................423
Create Object View ...........................................................................................................................424
Update Object View ..........................................................................................................................425
Delete Object View ...........................................................................................................................427
附录 E 配置参考 .....................................................................................................................................429
The Django Book
17 http://djangobook.py3k.cn/
什么是 settings 文件 ............................................................................................................................429
默认 Settings ....................................................................................................................................429
查看你已经改变了哪些 Settings ......................................................................................................430
在 Python 代码中使 Settings ............................................................................................................430
运行期间修改 Settings .....................................................................................................................430
指派 Settings: DJANGO_SETTINGS_MODULE ........................................................................................431
django-admin.py 工具......................................................................................................................431
服务器端(mod_python) ....................................................................................................................432
不设置 DJANGO_SETTINGS_MODULE 而使用 Settings .........................................................................432
定制默认的 Settings .........................................................................................................................433
configure()或 DJANGO_SETTINGS_MODULE 之一是必须的 ..............................................................433
合法的 Settings ....................................................................................................................................434
ABSOLUTE_URL_OVERRIDES .............................................................................................................434
ADMIN_FOR ......................................................................................................................................434
ADMIN_MEDIA_PREFIX .....................................................................................................................434
ADMINS ............................................................................................................................................434
ALLOWED_INCLUDE_ROOTS .............................................................................................................435
APPEND_SLASH .................................................................................................................................435
CACHE_BACKEND ..............................................................................................................................435
CACHE_MIDDLEWARE_KEY_PREFIX ...................................................................................................435
DATABASE_ENGINE ...........................................................................................................................435
DATABASE_HOST ..............................................................................................................................436
DATABASE_NAME .............................................................................................................................436
DATABASE_OPTIONS .........................................................................................................................436
DATABASE_PASSWORD .....................................................................................................................436
DATABASE_PORT ..............................................................................................................................436
DATABASE_USER ...............................................................................................................................437
DATE_FORMAT .................................................................................................................................437
DATETIME_FORMAT .........................................................................................................................437
DEBUG ..............................................................................................................................................437
The Django Book
18 http://djangobook.py3k.cn/
DEFAULT_CHARSET ...........................................................................................................................438
DEFAULT_CONTENT_TYPE .................................................................................................................438
DEFAULT_FROM_EMAIL ....................................................................................................................438
DISALLOWED_USER_AGENTS ............................................................................................................438
EMAIL_HOST .....................................................................................................................................438
EMAIL_HOST_PASSWORD .................................................................................................................439
EMAIL_HOST_USER ...........................................................................................................................439
EMAIL_PORT .....................................................................................................................................439
EMAIL_SUBJECT_PREFIX ....................................................................................................................439
FIXTURE_DIRS ...................................................................................................................................439
IGNORABLE_404_ENDS .....................................................................................................................440
IGNORABLE_404_STARTS ..................................................................................................................440
INSTALLED_APPS ...............................................................................................................................440
INTERNAL_IPS ...................................................................................................................................440
JING_PATH ........................................................................................................................................440
LANGUAGE_CODE .............................................................................................................................441
LANGUAGES ......................................................................................................................................441
MANAGERS .......................................................................................................................................441
MEDIA_ROOT ....................................................................................................................................442
MEDIA_URL .......................................................................................................................................442
MIDDLEWARE_CLASSES ....................................................................................................................442
MONTH_DAY_FORMAT .....................................................................................................................442
PREPEND_WWW ...............................................................................................................................443
PROFANITIES_LIST .............................................................................................................................443
ROOT_URLCONF................................................................................................................................443
SECRET_KEY ......................................................................................................................................443
SEND_BROKEN_LINK_EMAILS............................................................................................................443
SERIALIZATION_MODULES ................................................................................................................444
SERVER_EMAIL ..................................................................................................................................444
SESSION_COOKIE_AGE ......................................................................................................................444
The Django Book
19 http://djangobook.py3k.cn/
SESSION_COOKIE_DOMAIN ...............................................................................................................444
SESSION_COOKIE_NAME ...................................................................................................................444
SESSION_COOKIE_SECURE ................................................................................................................445
SESSION_EXPIRE_AT_BROWSER_CLOSE ............................................................................................445
SESSION_SAVE_EVERY_REQUEST ......................................................................................................445
SITE_ID ..............................................................................................................................................445
TEMPLATE_CONTEXT_PROCESSORS ..................................................................................................445
TEMPLATE_DEBUG ............................................................................................................................446
TEMPLATE_DIRS ................................................................................................................................446
TEMPLATE_LOADERS.........................................................................................................................446
TEMPLATE_STRING_IF_INVALID ........................................................................................................446
TEST_RUNNER ...................................................................................................................................446
TEST_DATABASE_NAME ....................................................................................................................447
TIME_FORMAT ..................................................................................................................................447
TIME_ZONE .......................................................................................................................................447
URL_VALIDATOR_USER_AGENT.........................................................................................................448
USE_ETAGS .......................................................................................................................................448
USE_I18N ..........................................................................................................................................448
YEAR_MONTH_FORMAT ...................................................................................................................448
附录 F 内建的模板标签和过滤器 ...........................................................................................................450
内建标签参考 ......................................................................................................................................450
block .................................................................................................................................................450
comment ..........................................................................................................................................450
cycle..................................................................................................................................................450
debug................................................................................................................................................451
extends .............................................................................................................................................451
filter ..................................................................................................................................................451
firstof ................................................................................................................................................451
for .....................................................................................................................................................452
if .......................................................................................................................................................452
The Django Book
20 http://djangobook.py3k.cn/
ifchanged ..........................................................................................................................................454
ifequal ...............................................................................................................................................454
ifnotequal .........................................................................................................................................455
include ..............................................................................................................................................455
load...................................................................................................................................................455
now...................................................................................................................................................455
regroup .............................................................................................................................................457
spaceless ...........................................................................................................................................458
ssi .....................................................................................................................................................459
templatetag ......................................................................................................................................459
url .....................................................................................................................................................460
Built-in Filter Reference ........................................................................................................................460
add ...................................................................................................................................................460
addslashes ........................................................................................................................................461
capfirst ..............................................................................................................................................461
center ...............................................................................................................................................461
cut ....................................................................................................................................................461
date ..................................................................................................................................................461
default ..............................................................................................................................................462
default_if_none ................................................................................................................................462
dictsort .............................................................................................................................................462
dictsortreversed ................................................................................................................................462
divisibleby .........................................................................................................................................462
escape...............................................................................................................................................463
filesizeformat ....................................................................................................................................463
first ...................................................................................................................................................463
fix_ampersands .................................................................................................................................464
floatformat .......................................................................................................................................464
get_digit............................................................................................................................................464
join....................................................................................................................................................465
剩余495页未读,继续阅读
2018-06-20 上传
2024-09-10 上传
2022-05-08 上传
2022-12-25 上传
2021-06-29 上传
2022-05-08 上传
2022-06-16 上传
2021-01-24 上传
lijingpeng
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- SSM Java项目:StudentInfo 数据管理与可视化分析
- pyedgar:Python库简化EDGAR数据交互与文档下载
- Node.js环境下wfdb文件解码与实时数据处理
- phpcms v2.2企业级网站管理系统发布
- 美团饿了么优惠券推广工具-uniapp源码
- 基于红外传感器的会议室实时占用率测量系统
- DenseNet-201预训练模型:图像分类的深度学习工具箱
- Java实现和弦移调工具:Transposer-java
- phpMyFAQ 2.5.1 Beta多国语言版:技术项目源码共享平台
- Python自动化源码实现便捷自动下单功能
- Android天气预报应用:查看多城市详细天气信息
- PHPTML类:简化HTML页面创建的PHP开源工具
- Biovec在蛋白质分析中的应用:预测、结构和可视化
- EfficientNet-b0深度学习工具箱模型在MATLAB中的应用
- 2024年河北省技能大赛数字化设计开发样题解析
- 笔记本USB加湿器:便携式设计解决方案
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功