django-postman扩展了一个不存在的base.html [英] django-postman extends a base.html that does not exist

查看:113
本文介绍了django-postman扩展了一个不存在的base.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经根据


I have installed and configured django-postman based on documentation:

in urls.py in root of my project:

(r'^messages/', include('postman.urls')),

in settings.py:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'grappelli',
    'filebrowser',
    'django.contrib.admin',
    'south',
    'postman',
    'MeetingManagerHub',
    'PersonHub',
    'TaskManagerHub',
    'AgencyHub',
    'DrHub',
    'CompanyHub',
    'AdvHub',
    'CarHub',
    'django.contrib.comments',
    'easy_maps',
    'MagazineHub',
    'captcha',
    'pagination'
)

so I enter the address: http://127.0.0.1:8081/messages/inbox/ but when I click on links none of them works!I just see this page! update :

I created an man_base.html file with this content:

<html>
<head>
<title>{% block title %}{% endblock %}</title>
{% block extrahead %}{% endblock %}
</head>
<body>
{% block postman_menu %}{% endblock %}
{% block content %}{% endblock %}
</body>
</html>

and added this line to the start of base.html file:

{% extends "postman/main_base.html" %}

and It worked!

解决方案

Did you add the expected base.html to your TEMPLATE_DIRS root?

The postman/base.html template extends a base.html site template, in which some blocks are expected: title: in , at least for a part of the entire title string extrahead: in , to put some and elements content: in , to put the page contents postman_menu: in , to put a navigation menu

Also not the rant on media files on the same page

这篇关于django-postman扩展了一个不存在的base.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆