资讯专栏INFORMATION COLUMN

#date:2017.07.19 django app, Part 2

bergwhite / 2558人阅读

摘要:这篇教程从教程,我们会配置自己的数据库,创造你的第一个模型,开始一个快捷的自动生成管理员站点。项目是一个特性网站的相关配置和应用的集合。

Writing your first django app, part 2

this tutorial begins where Tutorial 1 left off.We"ll setup the database, create your first model, and get a quick introduction to Django"s automatically-generated admin site.
这篇教程从教程1,我们会配置自己的数据库,创造你的第一个模型,开始一个快捷的django自动生成管理员站点。

database setup

if you wish yo use another databse install the approprite database bindings ans change the following keys in DATABASE "default itemto match your database connection setting:

ENGINE : django.db.backends.mysql

NAME : The name of your database.

The migrate command looks at the INSTALLED_APPS setting and creates any nessary database tables according to the database setings in your mysite/settings.py fiel and database migrations shipped with the app. You"ll see a message for each migration it applies. If you"re interested, run the commadn-line client for your database ans type

migrate查看INSTALLED_APPS设置并根据这个mysite/setting.py文件中的数据库设置创建任何必要的数据库表,数据库的迁移还会跟踪应用的变化

minimalists : 极简主义者

a model is a single, definitive source of truth about your data.It contains the essential fields ans behaviors of the data you"re storing.

项目和应用之间有什么不同呢,应用是一个web应用程序,他完成具体的事项,比如一个博客系统一个存储工作档案的数据库或者一个简单的头片应用。项目是一个特性网站的相关配置和应用的集合。一个项目可以包含多个应用。一个应用可以应用到多个项目中去。

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/56398.html

相关文章

  • #date2017.07.19 django app, Part 2

    摘要:这篇教程从教程,我们会配置自己的数据库,创造你的第一个模型,开始一个快捷的自动生成管理员站点。项目是一个特性网站的相关配置和应用的集合。 Writing your first django app, part 2 this tutorial begins where Tutorial 1 left off.Well setup the database, create your fir...

    MartinHan 评论0 收藏0
  • 2017-07-19 前端日报

    摘要:前端日报精选开发常见问题集锦前端码农的自我修养虚拟内部是如何工作的译知乎专栏并不慢,只是你使用姿势不对一份优化指南掘金老司机带你秒懂内存管理第一部中文免费公开课前端面试的大关键点,你到了吗知乎专栏高效开发与设计姐的图片二三 2017-07-19 前端日报 精选 VueJS 开发常见问题集锦 - 前端码农的自我修养 - SegmentFault虚拟 DOM 内部是如何工作的?[译]Hig...

    iflove 评论0 收藏0
  • 好文章记录

    摘要:安全清单动态化技术安居客技术演进启动任务调度框架对工作,管理的反思卡顿的发现与的开发的优势的非直接调用的动态加载探索架构组件沉浸式开发踩坑的使用性能优化开发中使用开发高 2018/03/08: http://zcfy.cc/article/node-j... -- 安全清单 2018/01/29: http://www.canking.win/2018/0... -- andro...

    ixlei 评论0 收藏0
  • 7-django——文件上传_分页_ajax_富文本_celery

    摘要:上传文件概述当在处理文件上传时,文件的数据被存储在属性中只有在请求的方法为且提交的表单带有属性的情况才会包含数据。如豆瓣,防止页面卡死。 上传文件 概述 当Django在处理文件上传时,文件的数据被存储在request.FILES属性中 FILES只有在请求的方法为POST且提交的form表单带有enctype=multipart/form-data属性的情况才会包含数据。否则,FIL...

    lylwyy2016 评论0 收藏0
  • Awesome Python

    摘要:漢字拼音 Awesome Python A curated list of awesome Python frameworks, libraries and software. Inspired by awesome-php. Awesome Python Environment Management Package Management Package Repositorie...

    fizz 评论0 收藏0

发表评论

0条评论

bergwhite

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<