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 8688435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:21:44+00:00 2026-06-12T23:21:44+00:00

As can be seen in the following code, I have a GET for registration,

  • 0

As can be seen in the following code, I have a GET for registration, that delegates its work to POST.

class RegistrationHandler(tornado.web.RequestHandler):
    def get(self):
        s = """
          <h1>Register</h1>
              <form method="post" action="/register">
                  <div>
                      <label>User</label>
                      <input name="user_name" value="test@test.com"/>
                  </div>
                  <div>
                      <label>password</label>
                      <input name="password" type="password"/>
                  </div>
                  <div>
                      <input type="submit" value="submit"/>
                  </div>
              </form>
        """
        self.write(s)

    @log_exception()
    def post(self):
        user_name = self.request.arguments['user_name']
        password = self.request.arguments['password']
        log.debug('Registering user with credentials %r' % (user_name, password))
        with sa_session() as db_session:
            User.register(user_name, password, db_session)

When I access the URL from my web browser, I get a registration form, after submitting which I get “403: Forbidden”.

Console log:

2012-10-15 11:27:42,482 - __main__ - DEBUG - Starting server on port 8080
2012-10-15 11:27:49,377 - root - INFO - 304 GET /register (127.0.0.1) 0.78ms
2012-10-15 11:27:53,143 - root - WARNING - 403 POST /register (127.0.0.1): '_xsrf' argument missing from POST
2012-10-15 11:27:53,144 - root - WARNING - 403 POST /register (127.0.0.1) 1.05ms

What does this error mean and how do I correct it? Thanks.

  • 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-12T23:21:45+00:00Added an answer on June 12, 2026 at 11:21 pm

    I imagine you have Cross-site request forgery cookies enabled in your settings
    (by default it is on).

    Tornado’s XSRF is here

    To fix this turn it off in your settings:

    settings = {
        "xsrf_cookies": False,
    }
    

    Note: Normally you dont want to turn this off and normally you’d be generating HTML in a template like this: Please note the xsrf bit which adds the XSRF cookie.

     <form method="post" action="/register">
         <input name="user_name" value="test@test.com"/>
         <input name="password" type="password"/>
         <input type="submit" value="submit"/>
    {% raw xsrf_form_html() %}
     </form>
    

    —EDIT following comments—
    Instead of:

      def get(self):
            loader = template.Loader("resources")
            page_contents = loader.load('register_page.html').generate()
            self.write(page_contents)
    

    Do:

      def get(self):
         self.render("../resources/register_page.html")
    

    or better:

      def get(self):
         self.render("register_page.html")
    

    (and put it in your templates directory)

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

Sidebar

Related Questions

Hi. I have the following code that can also be seen live here: http://designliving.tk/test.html
Can someone recommend a hosted solution that answers the following requirements (I have seen
I have created a jQuery animation that can be seen by clicking the Preview
We have several areas where code like this can be seen public Map extractData(ResultSet
I have created a drop down with jQuery that can be seen here by
So when i try to run the following code i can never ever get
I have the following code snippet.. I get the error Expected identifier, string or
I have following C# code that uses Entity Framework Code First approach. The tables
I have the following code that is getting all the gmail id's that are
I've seen a bunch of examples but can't seem to get some sample code

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.