404 template

remotes/origin/1203
Kotiuk Nazarii 11 years ago
parent f24eabb9f0
commit fd50c18e20
  1. 6
      proj/urls.py
  2. 10
      proj/views.py
  3. 9
      templates/client/404_test.html

@ -2,7 +2,7 @@
from django.conf import settings
from django.conf.urls import patterns, include, url
from core.simple_index_view import AdvertisingView, AboutView
from views import MainPageView
from views import MainPageView, Temp404
from django.contrib.sitemaps import views
import debug_toolbar
from django.views.generic.base import TemplateView
@ -26,8 +26,12 @@ sitemaps = {
'conference_theme': ConfTheme(), 'conference_tag': ConfTag(), 'main': Important(), 'additional': Additional()
}
urlpatterns = patterns('',
#url(r'^__debug__/', include(debug_toolbar.urls)),
url(r'^sitemap-(?P<section>.+)\.xml$', views.sitemap, {'sitemaps': sitemaps}),
url(r'^temp-404/$', Temp404.as_view()),
url(r'^admin/', include('proj.admin_urls')),
#url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
url(r'^sitemap\.xml$', views.index, {'sitemaps': sitemaps}),

@ -33,6 +33,16 @@ def expo_context(request):
return cont
class Temp404(TemplateView):
template_name = 'client/404_test.html'
def get_context_data(self, **kwargs):
context = super(Temp404, self).get_context_data(**kwargs)
expo_themes = Theme.active.expo_themes_with_count()
conf_themes = Theme.active.conference_themes_with_count()
context.update({'expo_themes': expo_themes, 'conf_themes': conf_themes})
return context
class MainPageView(JitterCacheMixin,TemplateView):
cache_range = settings.CACHE_RANGE
template_name = 'index.html'

@ -1,18 +1,17 @@
{% extends 'base_catalog.html' %}
{% block content_list %}
<div>Страница не найдена</div>
<ul>
{{ expo_themes }}
{{ a }}
{% for item in expo_themes %}
<li><a href="/expo/theme/{{ item.url }}/"></a></li>
<li><a href="/expo/theme/{{ item.url }}/">{{ item.name }}&nbsp;({{ item.expo_count }})</a></li>
{% endfor %}
</ul>
<ul>
{% for item in conf_themes %}
<li><a href="/conference/theme/{{ item.url }}/"></a></li>
<li><a href="/conference/theme/{{ item.url }}/">{{ item.name }}&nbsp;({{ item.conference_count }})</a></li>
{% endfor %}
</ul>
{% endblock %}
Loading…
Cancel
Save