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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:56:49+00:00 2026-06-04T07:56:49+00:00

I am getting this error when i visit my page: Caught AttributeError while rendering:

  • 0

I am getting this error when i visit my page:

Caught AttributeError while rendering: ‘WSGIRequest’ object has no attribute ‘get’

The error kicks in on line “17” of my html, which is the line that outputs form.as_p

The html looks like this:

{% extends "base.htm" %}

{% block content %}
{% if story_list %}
    {% for story in story_list %}
        <div class="Story">
            <a href="#">{{  story.title }}</a>
        </div>
    {% endfor %}
{% else %}
    <p>No stories are present - enter one below</p>
{% endif %}
<h3>Create a new story</h3>
<form action="/addStory" method="post">
    {%  csrf_token %}
    {{  form.as_p }} ***THIS IS LINE 17***
    <input type="submit" value="Submit"/>
</form>
{% endblock %}

The problem is i have a view that does two things, and from the django tutorials overrode the get_context_data method to add the second item to the django context. Because, um, that’s what i’m meant to do, riiiiiiiiight?

#for showing of the stories!
class StoryShowView(ListView):
    model = StoryForm

    def get_queryset(self):
        return getStoryItemsForUser(self.request)

    def get_context_data(self, **kwargs):
        context = super(StoryShowView,self).get_context_data(**kwargs)
        context['form'] = createNewStoryForm(self.request)
        return context

Where, well, the method createNewStoryForm just does this:

def createNewStoryForm(request):
    return StoryForm(request)

and StoryForm is just this:

class StoryForm(ModelForm):
    class Meta:
        model = Story
        ordering = ['create_date']

and the Story model is a normal model, that probably isn’t part of the problem, but, hey, i am a cutting and a pasting, so here goes!

class Story(models.Model):
    user = models.ForeignKey(User)
    post = models.ForeignKey(Post)
    title =  models.CharField(max_length=100)
    is_closed = models.BooleanField()
    is_random = models.BooleanField() # for uncategorised stories. Only one of these.
    result = models.CharField(max_length=20) #how did the relo work out?
    create_date = models.DateTimeField('date created')
    def __unicode__(self):
        return self.title

Any ideas what i am doing wrong?

UPDATE:
ah, it was the line::

return StoryForm(request)

I take it i can either pass in a “request.POST” or nothing, is that it?

  • 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-04T07:56:50+00:00Added an answer on June 4, 2026 at 7:56 am

    Probably you’re right and you were passing request instead of request.POST, reqest.GET or request.REQUEST to the constructor of your form. See the doc on how to use forms:

    def contact(request):
        if request.method == 'POST': # If the form has been submitted...
            form = ContactForm(request.POST) # A form bound to the POST data
            if form.is_valid(): # All validation rules pass
                # Process the data in form.cleaned_data
                # ...
                return HttpResponseRedirect('/thanks/') # Redirect after POST
        else:
            form = ContactForm() # An unbound form
    
        return render_to_response('contact.html', {
            'form': form,
        })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Getting this error when try to add an item to my repositories/context: Collection has
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY
For reference, please visit this page here . When trying to get a view
I am getting this error while following the tutorial from railstutorial.org. Model class :
I've been getting this error: The requested admin page does not exist. I've got
getting this error while linking an app, some one an idea? ld: duplicate symbol
when i test this page http://www.catalogues4u.com.au/ViewCategory.aspx?catID=119 im getting the above error. to replicate this
Getting this error: java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:200) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler

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.