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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:45:33+00:00 2026-05-13T06:45:33+00:00

I’ve just started Django and Python 50 hours ago ;-) so this might be

  • 0

I’ve just started Django and Python 50 hours ago 😉 so this might be an easy one but I am stuck.

I am using similar ‘create’ view with similar Form implementation in my project with no problem. In this case, I get the above mentionned error.

I am using Pinax…

2   from django.shortcuts import render_to_response, get_object_or_404
3   from django.template import RequestContext
4   from django.http import HttpResponseRedirect
5   from django.core.urlresolvers import reverse
6   from django.contrib.auth.models import User
7   from django.contrib.auth.decorators import login_required
8   from django.utils.translation import ugettext_lazy as _
9   
10  from django.conf import settings
11  
12  if "notification" in settings.INSTALLED_APPS:
13      from notification import models as notification
14  else:
15      notification = None
16  
17  from location.models import Location
18  from location.forms import LocationForm, LocationUpdateForm
19  
20  
21  @login_required
22  def create(request, form_class=LocationForm, template_name="location/create.html"):
23      location_form = form_class(request.user, request.POST or None)
24  
25  
26      
27      if location_form.is_valid():
28          location = location_form.save(commit=False)
29          location.creator = request.user
30          location.save()
31          return HttpResponseRedirect(location.get_absolute_url())
32      
33      return render_to_response(template_name, {
34          "location_form": location_form,
35      }, context_instance=RequestContext(request))

Traceback (most recent call last):
  File "/Users/philgo20/code/LeadMiner/django/core/servers/basehttp.py", line 636, in __call__

  File "/Users/philgo20/code/LeadMiner/django/core/handlers/wsgi.py", line 241, in __call__

  File "/Users/philgo20/code/LeadMiner/django/core/handlers/base.py", line 134, in get_response

  File "/Users/philgo20/code/LeadMiner/django/core/handlers/base.py", line 154, in handle_uncaught_exception

  File "/Users/philgo20/code/LeadMiner/django/core/handlers/base.py", line 92, in get_response

  File "/Users/philgo20/python/django/trunk/django/contrib/auth/decorators.py", line 78, in __call__
    return self.view_func(request, *args, **kwargs)
  File "/Users/philgo20/code/jezam_kms/apps/location/views.py", line 27, in create
    if location_form.is_valid():
  File "/Users/philgo20/code/LeadMiner/django/forms/forms.py", line 120, in is_valid

  File "/Users/philgo20/code/LeadMiner/django/forms/forms.py", line 111, in _get_errors

  File "/Users/philgo20/code/LeadMiner/django/forms/forms.py", line 234, in full_clean

  File "/Users/philgo20/code/LeadMiner/django/forms/widgets.py", line 170, in value_from_datadict

AttributeError: 'User' object has no attribute 'get'
  • 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-13T06:45:33+00:00Added an answer on May 13, 2026 at 6:45 am

    On line 23 of your views.py you are passing request.user as the first parameter to the instantiation of LocationForm.

    The first parameter should be request.POST unless your form has overridden the __init__() method.

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

Sidebar

Ask A Question

Stats

  • Questions 378k
  • Answers 378k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You would probably want to do an index of a… May 14, 2026 at 9:13 pm
  • Editorial Team
    Editorial Team added an answer You might think of it this way - lets take… May 14, 2026 at 9:13 pm
  • Editorial Team
    Editorial Team added an answer Have jquery fire an ajax call to your server. Your… May 14, 2026 at 9:13 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.