Пример #1
0
 def __init__(self):
     SiteRequestHandler.__init__(self)
     self.app = AppContext(current_app="admin")
     self.app_context = self.app
     self.template_vals = get_extra_context(self.app_context)
     # TODO: remove
     self.current = "home"
Пример #2
0
 def __init__(self):
     SiteRequestHandler.__init__(self)
     self.current = "home"
     self.app = AppContext(current_app="blog")
     self.app_context = self.app
     self.template_vals = get_extra_context(self.app_context)
Пример #3
0
"""Definition of urls specific to this blog application."""

__author__ = "M. Ziemba"
__date__ = "2012-05-16, 23:09"

from django.conf.urls.defaults import patterns, url, include
from django.contrib.auth.views import login

import views
from utils import get_extra_context


urlpatterns = patterns('blog.views',
    url(r'^login/$', login, {'template_name': 'login.html',
                             'extra_context': get_extra_context()}),
    url(r'^logout/$', views.logout_view),
    url(r'^register/$', views.register),
    url(r'^$', views.posts_index, name="index_view"),
    url(r'^blog/archives/(?P<year>\d{4})$', views.archive_year),
    url(r'^blog/archives/(?P<year>\d{4})/(?P<month>\d+)$', views.archive_month),
    url(r'^blog/(?P<post_id>\d+)$', views.posts_single, name='post_view'),
    url(r'^gallery$', views.albums_view, name='albums_view'),
    url(r'^gallery/(?P<album_id>\d+)/photos$', views.album_photos_view,
        name='album_photos_view'),
    url(r'^gallery/(?P<album_id>\d+)/photos/(?P<photo_id>\d+)$',
        views.photo_view, name='photo_view'),
    url(r'^fixtures$', views.tournaments_list, name="tournaments_view"),
    url(r'^fixtures/(?P<tournament_id>\d+)$', views.tournament,
        name="tournament_view"),
    url(r'^team$', views.team_index, name="team_view"),
Пример #4
0
def index(request):
    params = get_extra_context(appContext)
    template = get_template_uri(appContext, 'home.html')
    return shortcuts.render_to_response(template, params)
Пример #5
0
 def __init__(self):
     self.blog = configs.get_g_blog()
     self.app_context = AppContext(current_app = 'blog')
     self.template_vals = get_extra_context(self.app_context)