Django3.0入门与实践
正版保障 假一赔十 可开发票
¥
52.14
6.6折
¥
79
全新
库存153件
作者李健
出版社清华大学出版社有限公司
ISBN9787302567141
出版时间2020-10
装帧平装
开本16开
定价79元
货号10979289
上书时间2024-08-20
商品详情
- 品相描述:全新
- 商品描述
-
作者简介
李健,高级自动化开发工程师,持续集成开发工程师,拥有多年软件开发经验,以及丰富的Web开发经验,擅长ASP.NET相关技术。熟练掌握Python和Django框架,Jenkins以及持续集成。目前重点关注Python语言、数据挖掘等领域。
目录
目录
第1章 走进Django的世界 ················1
1.1 认识Django ··································1
1.2 版本选择 ·····································1
1.3 搭建开发环境 ·······························2
1.3.1 安装Python ································2
1.3.2 安装Django ································2
第2章 Web开发框架 ·······················4
2.1 Socket编程 ··································4
2.2 MTV框架 ····································6
第3章 搭建第一个Django网站 ··········8
3.1 创建项目 ·····································8
3.2 运行项目 ·····································9
3.3 创建投票应用 ·····························10
3.4 开发第一个视图 ··························11
3.5 配置数据库 ································12
3.6 创建模型 ···································13
3.7 激活模型 ···································14
3.8 Django管理页面 ··························15
3.9 向管理页面中添加投票应用 ···········16
3.10 添加视图 ··································18
3.10.1 扩展视图 ································19
3.10.2 处理404错误 ··························21
3.11 使用模板系统 ····························22
3.11.1 模板中的超链接 ·······················23
3.11.2 为超链接添加命名空间 ··············23
3.12 HTML表单 ·······························24
3.13 添加样式 ··································27
3.14 本地化 ·····································28
3.15 小结 ········································29
第4章 django-admin和manage.py ····30
4.1 help ··········································31
4.2 version·······································32
4.3 check ········································32
4.4 compilemessages ··························32
4.5 createcachetable ····························34
4.6 dbshell ·······································34
4.7 diffsettings ··································35
4.8 dumpdata····································35
4.9 flush··········································36
4.10 inspectdb ··································36
4.11 loaddata ····································38
4.12 makemessages ····························38
4.13 startproject ································39
4.14 startapp ····································39
4.15 runserver···································40
4.16 sendtestemail······························40
4.17 shell ········································41
4.18 迁移 ········································41
4.18.1 makemigrations ························41
4.18.2 migrate ···································42
4.18.3 sqlmigrate ·······························43
4.18.4 showmigrations ·························43
4.19 changepassword ··························44
4.20 createsuperuser ···························44
4.21 collectstatic································44
4.22 findstatic ···································45
4.23 默认选项 ··································45
第5章 配置 ···································46
5.1 Django配置文件 ··························46
5.1.1 引用Django配置信息 ·······················47
5.1.2 django.setup ·········································47
5.2 Cache ······················································48
5.2.1 CACHES ·············································48
5.2.2 CACHE_MIDDLEWARE_ALIAS: ····49
5.2.3 CACHE_MIDDLEWARE_KEY_PREFIX: ··············································49
5.2.4 CACHE_MIDDLEWARE_SECONDS: ··········································49
5.3 数据库 ····················································50
5.3.1 DATABASES ······································50
5.3.2 DATABASE_ROUTERS ····················54
5.3.3 DEFAULT_INDEX_TABLESPACE···57
5.3.4 DEFAULT_TABLESPACE ·················57
5.4 调试 ························································57
5.4.1 DEBUG ···············································57
5.4.2 DEBUG_PROPAGATE_EXCEPTIONS ·····································58
5.5 电子邮件 ················································58
5.5.1 ADMINS ·············································58
5.5.2 DEFAULT_FROM_EMAIL ················59
5.5.3 EMAIL_BACKEND ···························59
5.5.4 EMAIL_HOST ····································59
5.5.5 EMAIL_HOST_USER ························59
5.5.6 EMAIL_HOST_PASSWORD ·············59
5.5.7 EMAIL_PORT ·····································59
5.5.8 EMAIL_TIMEOUT ·····························59
5.5.9 SERVER_EMAIL ································59
5.5.10 MANAGERS ·····································60
5.6 文件上传 ················································60
5.6.1 DEFAULT_FILE_STORAGE ·············60
5.6.2 FILE_CHARSET ·································60
5.6.3 FILE_UPLOAD_HANDLERS ···········60
5.6.4 FILE_UPLOAD_MAX_MEMORY_SIZE ·····················································60
5.6.5 FILE_UPLOAD_PERMISSIONS·······60
5.6.6 FILE_UPLOAD_DIRECTORY_PERMISSIONS ···································60
5.6.7 FILE_UPLOAD_TEMP_DIR ·············61
5.6.8 MEDIA_ROOT ···································61
5.6.9 MEDIA_URL ······································61
5.6.10 静态文件 ···········································62
5.7 表单 ························································63
5.8 国际化(i18n/l10n) ································63
5.8.1 DECIMAL_SEPARATOR···················63
5.8.2 NUMBER_GROUPING ·····················63
5.8.3 THOUSAND_SEPARATOR ···············65
5.8.4 USE_THOUSAND_SEPARATOR ·····66
5.8.5 FIRST_DAY_OF_WEEK ···················66
5.8.6 DATE_FORMAT ·································66
5.8.7 DATE_INPUT_FORMATS ·················66
5.8.8 DATETIME_FORMAT ·······················67
5.8.9 SHORT_DATE_FORMAT ··················67
5.8.10 SHORT_DATETIME_FORMAT ······67
5.8.11 DATETIME_INPUT_FORMATS ·····67
5.8.12 TIME_FORMAT ·······························68
5.8.13 TIME_INPUT_FORMATS ···············68
5.8.14 YEAR_MONTH_FORMAT ·············68
5.8.15 MONTH_DAY_FORMAT ················68
5.8.16 TIME_ZONE ·····································69
5.8.17 LANGUAGE_CODE ························69
5.8.18 LANGUAGE_COOKIE_AGE ··········69
5.8.19 LANGUAGE_COOKIE_DOMAIN ···········································69
5.8.20 LANGUAGE_COOKIE_NAME ······70
5.8.21 LANGUAGE_COOKIE_PATH ········70
5.8.22 LANGUAGES ···································70
5.8.23 LANGUAGES_BIDI·························70
5.8.24 LOCALE_PATHS ······························70
5.8.25 USE_I18N ·········································70
5.8.26 USE_L10N ········································71
5.8.27 USE_TZ ·············································71
5.8.28 Python datetime语法 ························71
5.9 HTTP ······················································71
5.9.1 DATA_UPLOAD_MAX_MEMORY_SIZE ·····················································71
5.9.2 DATA_UPLOAD_MAX_NUMBER_FIELDS ················································72
5.9.3 DEFAULT_CHARSET ·······················72
5.9.4 DISALLOWED_USER_AGENTS ·····72
5.9.5 FORCE_SCRIPT_NAME ···················72
5.9.6 INTERNAL_IPS ·································72
5.9.7 SECURE_BROWSER_XSS_FILTER ················································73
5.9.8 SECURE_CONTENT_TYPE_NOSNIFF·············································73
5.9.9 SECURE_HSTS_INCLUDE_SUBDOMAINS ···································73
5.9.10 SECURE_HSTS_PRELOAD ············73
5.9.11 SECURE_HSTS_SECONDS ············73
5.9.12 SECURE_PROXY_SSL_HEADER ·············································74
5.9.13 SECURE_REDIRECT_EXEMPT ····74
5.9.14 SECURE_REFERRER_POLICY ·····75
5.9.15 SECURE_SSL_HOST ·······················75
5.9.16 SECURE_SSL_REDIRECT ·············75
5.9.17 SIGNING_BACKEND ·····················75
5.9.18 WSGI_APPLICATION ·····················75
5.10 安全 ······················································75
5.10.1 SECRET_KEY ··································75
5.10.2 ALLOWED_HOSTS ·························76
5.11 CSRF ····················································76
5.11.1 CSRF_COOKIE_AGE ······················76
5.11.2 CSRF_COOKIE_DOMAIN ··············77
5.11.3 CSRF_COOKIE_HTTPONLY ··········77
5.11.4 CSRF_COOKIE_NAME ···················77
5.11.5 CSRF_COOKIE_PATH ·····················77
5.11.6 CSRF_COOKIE_SAMESITE ···········77
5.11.7 CSRF_COOKIE_SECURE ···············77
5.11.8 CSRF_USE_SESSIONS ····················78
5.11.9 CSRF_FAILURE_VIEW ···················78
5.11.10 CSRF_HEADER_NAME ················78
5.11.11 CSRF_TRUSTED_ORIGINS ·········78
5.11.12 代码示例 ·········································78
5.12 模型 ······················································81
5.12.1 ABSOLUTE_URL_OVERRIDES ····81
5.12.2 FIXTURE_DIRS ·······························81
5.12.3 INSTALLED_APPS ··························81
5.13 日志 ······················································81
5.13.1 LOGGING ·········································81
5.13.2 LOGGING_CONFIG ························82
5.14 模板 ······················································82
5.15 URLs ····················································83
5.15.1 ROOT_URLCONF ····························83
5.15.2 APPEND_SLASH ·····························83
5.15.3 PREPEND_WWW ····························84
5.16 其他 ······················································84
5.16.1 DEFAULT_EXCEPTION_REPORTER_FILTER ························84
5.16.2 MIDDLEWARE ································84
第6章 后台管理页面 ·······················85
6.1 ModelAdmin属性 ··
— 没有更多了 —
以下为对购买帮助不大的评价