mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00

of the RSS feed. (Which will receive a new URL now that it lives in the actual app and not in with the static files, so a redirect will be needed there).
24 lines
608 B
Python
24 lines
608 B
Python
from django.shortcuts import render_to_response, get_object_or_404
|
|
from django.http import HttpResponse, Http404, HttpResponseRedirect
|
|
|
|
from pgweb.util.contexts import NavContext
|
|
|
|
from datetime import date
|
|
|
|
from models import *
|
|
|
|
def index(request):
|
|
posts = PwnPost.objects.all()
|
|
|
|
return render_to_response('pwn/list.html', {
|
|
'posts': posts,
|
|
}, NavContext(request, 'community'))
|
|
|
|
def post(request, year, month, day):
|
|
d = date(int(year), int(month), int(day))
|
|
post = get_object_or_404(PwnPost, date=d)
|
|
|
|
return render_to_response('pwn/view.html', {
|
|
'post': post,
|
|
}, NavContext(request, 'community'))
|