Can you construct csrf from request object - csrf constructor exception?
<p>I am following an example of user registration and my code looks like this</p>

<pre><code>from django.views.decorators import  csrf
def register_user(request):
    args={}
    args.update(csrf(request)) #----&gt;Crashes here
    args["form"] = UserCreationForm()
    return render_to_response("register.html",args)
</code></pre>

<p>I get an exception at the statement </p>

<pre><code>args.update(csrf(request))
</code></pre>

<p>stating that the </p>

<pre><code>module object is not callable.
</code></pre>

<p>Any suggestions on what I might be doing wrong ?</p>

<p>A quick google shows that the correct import for the csrf decorator is</p>

<pre><code>from django.views.decorators.csrf import csrf_protect
</code></pre>

<p>My guess (I don't have django available to test) is that you're importing something else, although it's probably a non callable module :)</p>

python django