模板Django包含标签不显示

时间:2014-08-09 18:26:52

标签: python django templates openshift

我将我的项目移植到OpenShift。我在我的.html文件中显示包含时出现问题,我似乎无法弄清楚原因 - 使用rhc tail app时未发现任何错误消息。我尝试过常规的事情,例如将include navigation.html更改为/static/navigation.html

以下是dashboard.html文件:

<body class="en personalization results edit">
   <div class="masthead-wrapper container-fluid">
      <div class="container">
         <div class="masthead">

            {% include "navigation.html" %} 
         </div>
      </div>
   </div>
</body>

navigation.html是:

{% load base_extras %}
<script type="text/javascript" src="/static/style/js.js"></script>

Stuff...

还尝试检查chrome中的对象。我很困惑为什么我没有在django框架中加载错误。由于导航与仪表板位于同一目录中,因此我不知道为什么它没有被拉入。

以下是settings.py

PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))
STATIC_ROOT = os.path.join(PROJECT_DIR, '..', 'static')
STATICFILES_DIRS = (
    os.path.join(PROJECT_DIR, 'templates'), 
)
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    #'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(PROJECT_DIR, 'templates'),
)

0 个答案:

没有答案