mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Allow "About" page to be render dynamically.
In prep for the new "About" page to serve dynamic (though periodically cached) content.
This commit is contained in:
@ -73,6 +73,15 @@ def home(request):
|
|||||||
'planet': planet,
|
'planet': planet,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# About page view (contains information about PostgreSQL + random quotes)
|
||||||
|
@cache(minutes=10)
|
||||||
|
def about(request):
|
||||||
|
# get 5 random quotes
|
||||||
|
quotes = Quote.objects.filter(approved=True).order_by('?').all()[:5]
|
||||||
|
return render_pgweb(request, 'about', 'core/about.html', {
|
||||||
|
'quotes': quotes,
|
||||||
|
})
|
||||||
|
|
||||||
# Community main page (contains surveys and potentially more)
|
# Community main page (contains surveys and potentially more)
|
||||||
def community(request):
|
def community(request):
|
||||||
s = Survey.objects.filter(current=True)
|
s = Survey.objects.filter(current=True)
|
||||||
|
@ -35,6 +35,7 @@ urlpatterns = [
|
|||||||
url(r'^$', pgweb.core.views.home),
|
url(r'^$', pgweb.core.views.home),
|
||||||
url(r'^dyncss/(?P<css>base|docs).css$', pgweb.core.views.dynamic_css),
|
url(r'^dyncss/(?P<css>base|docs).css$', pgweb.core.views.dynamic_css),
|
||||||
|
|
||||||
|
url(r'^about/$', pgweb.core.views.about),
|
||||||
url(r'^about/newsarchive/([^/]+/)?$', pgweb.news.views.archive),
|
url(r'^about/newsarchive/([^/]+/)?$', pgweb.news.views.archive),
|
||||||
url(r'^about/news/(\d+)(-.*)?/$', pgweb.news.views.item),
|
url(r'^about/news/(\d+)(-.*)?/$', pgweb.news.views.item),
|
||||||
url(r'^about/news/taglist.json/$', pgweb.news.views.taglist_json),
|
url(r'^about/news/taglist.json/$', pgweb.news.views.taglist_json),
|
||||||
|
Reference in New Issue
Block a user