【发布时间】:2012-10-14 01:24:59
【问题描述】:
我是 Django 新手。我阅读了文档,我对媒体根文件和静态根文件以及我应该将我的 css 文件与我的 javascript 文件放在哪里感到困惑。
你们能指出我正确的方向吗? 项目设置:
Project
-myapp
-model,view,and test
-template
- base.html
- index.html
- view1
- view2
- media
- css
- style.css
- ie.css
- js
- img
-setting.py
-url.py
我的 static_url、static_root、media_url、media_root、STATICFILES_DIRS 和 STATICFILES_FINDERS 应该是什么样的?
我目前如何加载我的 css 文件是通过 base.html 使用以下内容:
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static user_stylesheet %}"type="text/css" media="screen"/>
那么管理我的静态文件的最佳、最有效/正确的方法是什么? 谢谢大家的帮助。感谢您的时间和精力。
【问题讨论】:
标签: django django-templates django-views