You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
from django.views.decorators.cache import cache_page
from datetime import datetime
from foo.models import UserUploadedPhoto
@cache_page(60)
def two(request):
txt = "<p>(<b>This is a demo of running a basic Django site on Heroku:</b> <a href=\"http://mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/\">See the tutorial post</a> or <a href=\"https://github.com/mtigas/heroku-django-demo-app\">the project source code.)</p>"
txt += "<p><a href='/'>back to home</a></p>"
txt += "<p>time: %s (to test 60 second cache)</p>" % datetime.now()
txt += "<p>The following images were uploaded in the Django admin (<a href='https://github.com/mtigas/heroku-django-demo-app/blob/master/src/foo/views.py'>this page source</a>):</p>"
for p in UserUploadedPhoto.objects.all().order_by('-id')[:5]: