Skip to content

Instantly share code, notes, and snippets.

@IlianIliev
Last active December 14, 2015 08:18
Show Gist options
  • Save IlianIliev/5056570 to your computer and use it in GitHub Desktop.
Save IlianIliev/5056570 to your computer and use it in GitHub Desktop.
just for testing
# views.py
from .models import News
from django.shortcuts import get_object_or_404
def single_news(request, slug):
news = get_object_or_404(News.objects.public(), slug=slug)
return render_to_response('news/single_news.html', {'news': news})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment