Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:34:46+00:00 2026-06-11T14:34:46+00:00

I am having login forms in all static pages. I have enabled csrf middleware

  • 0

I am having login forms in all static pages. I have enabled csrf middleware in my project. Now when the user submits the form from http static page i get the error,

csrf verification failed

Is there a way to ensure cross site validation, even when posted from non-scure to secure page?

I want to neither add scrf exempt decorator nor change the page to https.

This is my template:

     <form action='{{login_url}}' method = 'post'>
            {% csrf_token %}

            <div class="searchbox login">
 <input autocomplete="off" id="id_fakeusername" type="text" name="fakeusername"    maxlength="100" value='Email' style="color: #727272" onfocus="$('#id_fakeusername').hide();$('#id_username').show();        

$('#id_username').focus();"  />

<input autocomplete="off" type='text' id="id_username" type="text" name="username"  maxlength="100" style="display: none" value='' onblur="if ($('#id_username').attr('value') == '') {$('#id_username').hide();$('#id_fakeusername').show();}"  />
        </div>
        <div class="searchbox login">
            <input autocomplete="off" id="id_fakepassword" type="text" name="fakepassword"  maxlength="50" style="color: #727272" value='Password' onfocus="$('#id_fakepassword').hide(); $('#id_password').show();  $('#id_password').focus();"  />

<input autocomplete="off" type='password' id="id_password" name="password" type="text"  style="display: none" value='' onblur="if ($('#id_password').attr('value') == '') {$('#id_password').hide();$('#id_fakepassword').show();}"  />
        </div>
            {% block nativewin %}
        <div class="loginbut"><input type="submit" border="0" title="Login" value="Login" /></div>
    {% endblock nativewin %}
    </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:34:47+00:00Added an answer on June 11, 2026 at 2:34 pm

    From the CsrfViewMiddleware code [1]:

                # Suppose user visits http://example.com/
                # An active network attacker (man-in-the-middle, MITM) sends a
                # POST form that targets https://example.com/detonate-bomb/ and
                # submits it via JavaScript.
                #
                # The attacker will need to provide a CSRF cookie and token, but
                # that's no problem for a MITM and the session-independent
                # nonce we're using. So the MITM can circumvent the CSRF
                # protection. This is true for any HTTP connection, but anyone
                # using HTTPS expects better! For this reason, for
                # https://example.com/ we need additional protection that treats
                # http://example.com/ as completely untrusted. Under HTTPS,
                # Barth et al. found that the Referer header is missing for
                # same-domain requests in only about 0.2% of cases or less, so
                # we can use strict Referer checking.
    

    So I think the answer to your question is ‘no’, using the built-in protection!

    [1] https://github.com/django/django/blob/master/django/middleware/csrf.py#L118

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some difficulty with one of our service providers login forms. The
I really need help on this one. I am having a simple login form
I'm automating form login in a certain site using the WebBrowser control. Having the
Thanks for checking out my problem... I'm having trouble submitting a login form via
I'm having this strange problem with codeigniters flashdata in my login form. When I
This little fiddle shows the problem I'm having. The login form on the right
I have one login form and three groups of users who can login: client,
OK, another road bump in my current project. I have never had form elements
I have 3 different login forms on my website and each of them use
There is a web-site to crawl, with POST-authentication. How can I, having login and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.