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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:08:34+00:00 2026-05-21T14:08:34+00:00

I am attempting a fairly simple form on Django 1.3, and am trying to

  • 0

I am attempting a fairly simple form on Django 1.3, and am trying to understand how CSRF works.

I think I’ve followed the three steps detailed on the Django site, but am still unable to make the form work.

The form displays when the URL is loaded, however upon hitting the submit button, I get the following error:

TypeError at /txt/ txt() takes exactly
1 argument (2 given)

Here’s the actual code:

views.py:

from django.http import HttpResponse
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext

def txt(request):
    if request.method == 'POST':
        msg="txt received"
    else:
        msg="nothing in POST"
    return render_to_response('base.html', locals(), context_instance=RequestContext(request))

The HTML:

<body>

    <form action="txt/" method="POST">{% csrf_token %}
        From <input type="text" name="From"><br>
        To <input type="text" name="To"><br>
        Body <input type="text" name="Body"><br>
        <input type="submit" value="Search">
    </form>

    {{ msg }}

</body>

I know I haven’t done a forms.py etc. but I was just trying to get the basic functionality up and going. I think this code would have worked in previous versions of Django, and am unsure why its not working this time.

  • 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-05-21T14:08:35+00:00Added an answer on May 21, 2026 at 2:08 pm

    The error looks like your view function is getting more arguments than it is setup to accept. As you have it shown above, the view only accepts a single argument: the request.

    If your URL pattern for this view is configured with a capturing group, or you are adding extra arguments via the optional dictionary or the kwargs parameter to url(), then those extra arguments will be given to the view function and could cause the error you’re seeing.

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

Sidebar

Related Questions

I've been attempting to refactor a fairly simple three or four page site to
I am attempting what I thought would be a fairly simple vba statement to
We have a fairly simple program that's used for creating backups. I'm attempting to
I'm trying to switch from AjaxControlToolkit to jQuery UI tabs for a fairly simple
I'm attempting to deploy a fairly simple Flask app to Heroku's cedar stack, but
I'm attempting to create a fairly simple CoreAnimation for use in an AVComposition .
I'm fairly new to Ruby on Rails, and I'm attempting to create some fancy
I'm using Flex Builder more and more and attempting to create a fairly asset
I'm attempting to build a very simple wxPython GUI that monitors and displays external
I am attempting to create a very simple web interface for changing some system

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.