【发布时间】:2015-01-25 18:46:25
【问题描述】:
对于 Django 应用程序 (1.7) 中的文件夹,什么是好的结构(最佳实践)? 我不确定将静态数据和文件上传放在哪里。
在我所有的项目中结果都不同,但目前我有这样的东西(我遗漏了一些明显的文件夹/文件):
project/
bin/
include/
...
src/
manage.py
main/
- settings.py
- urls.py
signup/
static/
static_/
+ css
+ img
+ js
static/
templates/
- index.html
- base.html
- ...
uploads/
而且,我更喜欢看到像 site.com/css/file.css 这样的 url 而不是 site.com/static/css/file.css ,但不知何故,这似乎比它看起来更复杂。那怎么能做到呢?
【问题讨论】:
标签: django django-staticfiles django-1.7