Closed auvipy closed 8 years ago
TemplateDoesNotExist at /forum/
base.html
Request Method: GET
Request URL: http://127.0.0.1:8000/forum/
Django Version: 1.8.2
Exception Type: TemplateDoesNotExist
Exception Value:
base.html
Exception Location: /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/django/template/engine.py in find_template, line 146
Python Executable: /home/asif/.pyenv/versions/3.4.3/bin/python
Python Version: 3.4.3
Python Path:
['/home/asif/P/swing/swingthat',
'/home/asif/.pyenv/versions/3.4.3/lib/python34.zip',
'/home/asif/.pyenv/versions/3.4.3/lib/python3.4',
'/home/asif/.pyenv/versions/3.4.3/lib/python3.4/plat-linux',
'/home/asif/.pyenv/versions/3.4.3/lib/python3.4/lib-dynload',
'/home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages']
Server time: Sun, 28 Jun 2015 06:07:23 +0000
Template-loader postmortem
Django tried loading these templates, in this order: Using loader django.template.loaders.filesystem.Loader: Using loader django.template.loaders.app_directories.Loader: /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/material/admin/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/django/contrib/admin/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/django/contrib/auth/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/material/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/material/frontend/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/easy_pjax/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/pybb/templates/base.html (File does not exist) Error during template rendering
In template /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/pybb/templates/pybb/base.html, error at line 1 base.html 1
{% extends PYBB_TEMPLATE|default:"base.html" %}
2
3 {% load url from future %}
4
5 {% load i18n pybb_tags %}
6
7 {%block title %}{{ PYBB_DEFAULT_TITLE }}{% endblock title %}
8
9 {% block extra_head %}
10 {{ block.super }}
11
how to solve this?
Template-loader postmortem
Django tried loading these templates, in this order: Using loader django.template.loaders.filesystem.Loader: Using loader django.template.loaders.app_directories.Loader: /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/material/admin/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/django/contrib/admin/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/django/contrib/auth/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/material/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/material/frontend/templates/base.html (File does not exist) /home/asif/.pyenv/versions/3.4.3/lib/python3.4/site-packages/easy_pjax/templates/base.html (File does not exist) /home/asif/P/swing/swingthat/pybb/templates/base.html (File does not exist) Error during template rendering
In template /home/asif/P/swing/swingthat/pybb/templates/pybb/base.html, error at line 1
Hi Asif, the pybb package assumes the presence of a base.html template in your project, but does not provide one. You can either add one in a templates folder in one of your apps, where it will be found by django.template.loaders.app_directories.Loader
, or add a new templates folder somewhere and add it to your TEMPLATES['DIRS']
in settings, e.g.:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'my_templates')],
'APP_DIRS': True,
'OPTIONS': {
# ... some options here ...
},
},
]
I think all it needs is some <html>
tags and a {% block content %}{% endblock %}
, but you should check that because I'm not sure I'm remembering correctly and I can't check my own at the minute.
Or you can use PYBB_TEMPLATE
in settings to set something other than base.html
as your base template.
but there is a base.html file in pybb/templates folder
Check again, I bet it's in pybb/templates/pybb/base.html. That would make it pybb/base.html
in the templates namespace
yeah you are right i found it there.
well there should be any global project template dir then?
{% extends PYBB_TEMPLATE|default:"base.html" %}
{% load url from future %}
{% load i18n pybb_tags %}
{% block title %}{{ PYBB_DEFAULT_TITLE }}{% endblock title %}
{% block extra_head %} {{ block.super }}
<link rel="alternate" type="application/atom+xml" href="{% url 'pybb:feed_posts' %}" title="{% trans "Latest posts on forum" %}" >
<link rel="alternate" type="application/atom+xml" href="{% url 'pybb:feed_topics' %}" title="{% trans "Latest topics on forum" %}" >
{% endblock %}
{% block breadcrumb %} {% include "pybb/breadcrumb.html" %} {% endblock %}
{% block content %}{% endblock content %}
this is already provided with pybb. so why still template doesnt exist?
That is pybb/base.html
, it needs a plain base.html
to inherit from ("extend"). Put the following in a base.html
file in the templates folder of any one of your apps:
<html>
<head>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
{% block breadcrumbs %}{% endblock %}
{% block content %}{% endblock %}
</body>
</html>
thank you :)
when i go to add new catagory this appears
ValidationError at /admin/pybb/category/add/
['ManagementForm data is missing or has been tampered with']
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/pybb/category/add/
Django Version: 1.8.2
Exception Type: ValidationError
Exception Value:
['ManagementForm data is missing or has been tampered with']
auvipy, how did you manage to resolve the initial error : pybb.Forum.moderators: (fields.W340) null has no effect on ManyToManyField. pybb.Post.user_ip: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9. HINT: Use GenericIPAddressField instead. Im facing this error ^^ while trying to make migrations
I was unable to fix and didn't have enough time to fix, so didn't use pybbm in my project.
But to fix you problem, you need to patch on pybb models and find out the classes of related models and edit the field's there. If I were you I would try to solve it that way.
django 1.9 supported since cfb66d51fbaa156ddb866cf06f773c3ccdceffe7
WARNINGS: pybb.Forum.moderators: (fields.W340) null has no effect on ManyToManyField. pybb.Post.user_ip: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9. HINT: Use GenericIPAddressField instead.