Django 官方教程翻译项目端口: 1. $ python manage.py runserver 8080 如果你想更换服务器监听的 IP ,可以将它和端口号写在一起作为参数。比如,监听所有公网 IP(这尤其有用,当你想通过网络展 示给其他人时),像这样: 1. $ python manage.py runserver 0:8000 0 是 0.0.0.0 的快捷方式。想了解更多关于这个用于开发的服务器的内容可以参考 包,并且遵循着一定的约定。Django 自带的工具, 可以帮你自动生成应用的基础目录结构,这样你就能专注于编写代码,而不是创建目录了。 项目 VS 应用 项目和应用有什么区别?应用是一个专门做某件事的网络应用程序,比如博客系统、公共记录的数据库、或者简单的投票程序。项目 则是一个网站使用的配置和应用的集合。项目可以包含很多个应用;而应用可以被很多个项目使用。 你的应用可以放在 Python path 添加背景图片 这一篇从 第五部分(zh)结尾的地方继续讲起。我们已经为投票程序编写了测试,而现在我们要为 它加上样式和图片。 除了服务端生成的 HTML 以外,网络应用通常需要一些其他的文件 —— 比如图片,脚本和样式表 —— 来帮助渲染网络页面。在 Django 中,我们把这些文件统称为“静态文件”。 对于小项目来说,这个问题没什么大不了的,因为你可以把这些静态文件随便放在哪,只要服务程序 能够找到它们就行。然而在大项目0 码力 | 103 页 | 1.86 MB | 1 年前3
Django 5.1.2 Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s your website. Here are a few examples of downstream caches: • When using HTTP, your ISP (Internet Service Provider) may cache certain pages, so if you requested a page from http://example.com/, your ISP and vice-versa. If your application connects to other systems –for instance, if it queries a web service –make sure date- times are properly specified. To transmit datetimes safely, their representation0 码力 | 2923 页 | 9.62 MB | 1 年前3
Django 5.1.2 Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s and vice-versa. If your application connects to other systems – for instance, if it queries a web service – make sure datetimes are properly specified. To transmit datetimes safely, their representation For example, you could install one handler that forwards ERROR and CRITICAL messages to a paging service, while a second handler logs all messages (including ERROR and CRITICAL messages) to a file for later0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 5.1 Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s and vice-versa. If your application connects to other systems – for instance, if it queries a web service – make sure datetimes are properly specified. To transmit datetimes safely, their representation For example, you could install one handler that forwards ERROR and CRITICAL messages to a paging service, while a second handler logs all messages (including ERROR and CRITICAL messages) to a file for later0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.1 Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s your website. Here are a few examples of downstream caches: • When using HTTP, your ISP (Internet Service Provider) may cache certain pages, so if you requested a page from http://example.com/, your ISP and vice-versa. If your application connects to other systems –for instance, if it queries a web service –make sure date- times are properly specified. To transmit datetimes safely, their representation0 码力 | 2917 页 | 9.59 MB | 1 年前3
Django 5.0.x Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s your website. Here are a few examples of downstream caches: • When using HTTP, your ISP (Internet Service Provider) may cache certain pages, so if you requested a page from http://example.com/, your ISP and vice-versa. If your application connects to other systems –for instance, if it queries a web service –make sure date- times are properly specified. To transmit datetimes safely, their representation0 码力 | 2878 页 | 9.60 MB | 1 年前3
Django 5.0.x Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s and vice-versa. If your application connects to other systems – for instance, if it queries a web service – make sure datetimes are properly specified. To transmit datetimes safely, their representation For example, you could install one handler that forwards ERROR and CRITICAL messages to a paging service, while a second handler logs all messages (including ERROR and CRITICAL messages) to a file for later0 码力 | 3407 页 | 3.21 MB | 1 年前3
Django 4.2.x Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s and vice-versa. If your application connects to other systems – for instance, if it queries a web service – make sure datetimes are properly specified. To transmit datetimes safely, their representation For example, you could install one handler that forwards ERROR and CRITICAL messages to a paging service, while a second handler logs all messages (including ERROR and CRITICAL messages) to a file for later0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 4.1.x Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s and vice-versa. If your application connects to other systems – for instance, if it queries a web service – make sure datetimes are properly specified. To transmit datetimes safely, their representation For example, you could install one handler that forwards ERROR and CRITICAL messages to a paging service, while a second handler logs all messages (including ERROR and CRITICAL messages) to a file for later0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 4.0.x Documentationa username and password stored with the user model need to be authenticated against a different service than Django’s default. You can give your models custom permissions that can be checked through Django’s your website. Here are a few examples of downstream caches: • When using HTTP, your ISP (Internet Service Provider) may cache certain pages, so if you requested a page from http://example.com/, your ISP and vice-versa. If your application connects to other systems – for instance, if it queries a web service – make sure datetimes are properly specified. To transmit datetimes safely, their representation0 码力 | 2248 页 | 7.90 MB | 1 年前3
共 63 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7













