1👍
The function based generic views were replaced by the class based views starting in Django 1.3. The replacement for direct_to_template
would be TemplateView
. Or you could just switch it to use the render
shortcut which has the same signature.
from django.shortcuts import render
...
def post_tweet(request, tweet_id=None):
...
return render(request,'post_tweet.html',{'form': form})
Source:stackexchange.com