Note that there are some explanatory texts on larger screens.

plurals
  1. POCSRF verification failed. Request aborted. on django
    primarykey
    data
    text
    <p>I am following Django 1.3 Web Development. and for logins, i am getting the following error</p> <pre><code>Forbidden (403) CSRF verification failed. Request aborted. Help Reason given for failure: CSRF token missing or incorrect. </code></pre> <p>This is my settings.py Included APPS. It is exactly how the book says it should be.</p> <pre><code>INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'djangocricket.Cricket', 'djangocricket.cms' ) </code></pre> <p>The book says, it should contain, django.contrib.auth.views.login .. and i am including it in</p> <pre><code>urlpatterns = patterns('', # Examples: url(r'^$', 'djangocricket.Cricket.views.index', name='default'), url(r'^user/(\w+)/$', 'djangocricket.Cricket.views.user_home', name='user home'), url(r'^login/$', 'django.contrib.auth.views.login'), # url(r'^djangocricket/', include('djangocricket.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: #url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: url(r'^news/', 'djangocricket.cms.views.index', name='index'), #url(r'^news/(?P&lt;slug&gt;[^\.]+).html', 'djangocricket.cms.views.detail', name='get_single_news_item'), url(r'^admin/', include(admin.site.urls)), ) </code></pre> <p>and my registration/login.html ... copy pasted from the book. it should do.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Django Bookmarks - User Login&lt;/title&gt; &lt;/head&gt; &lt;h1&gt;User Login&lt;/h1&gt; {% if form.errors %} &lt;p&gt;Your username and password didn't match. Please try again.&lt;/p&gt; {% endif %} &lt;form method="post" action="."&gt; &lt;p&gt;&lt;label for="id_username"&gt;Username:&lt;/label&gt; {{ form.username }}&lt;/p&gt; &lt;p&gt;&lt;label for="id_password"&gt;Password:&lt;/label&gt; {{ form.password }}&lt;/p&gt; &lt;input type="hidden" name="next" value="/" /&gt; &lt;input type="submit" value="login" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>what am i missing?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload