-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object has no attribute 'get' -Django 1.8 #12
Comments
Even i got same error did you find any solution ? |
@adithyadinesh96 hi! Can you show/share your code? Currently, I am seeing problem into process_response into the middleware "clickjacking.py". |
Any response from Django i am getting this error if response.get('X-Frame-Options', None) is not None: |
@adithyadinesh96 It seems that you need investigate why your |
I was getting the same error too but in my case, I was calling the "form class" itself instead of calling the "view" function from the urls.py. See the code below: forms.py:
views.py:
urls.py:
What I should have:
if you are using an IDE, you will get both the options since you have imported the forms.py in the views. py and it's easy to pick the other one. |
I resolved this by changing the urls.py, I was calling the class NameForm instead of the function defined in views.py |
I am using Django 1.8 version, don't know whether it's a version related problem. But after adding all code in respective forms.py, views.py, and test_template.py, It returns
I think i might missed to add the appname in settings.py apps.
i tried the default name but it didn't worked , it's not pointed in you repo readme too.
Here is the output,
Request Method: GET
Request URL: http://framework.com/test_template/
Django Version: 1.8.1
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'framework')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
Exception Type: AttributeError at /test_template/
Exception Value: 'testForm' object has no attribute 'get'
I had reached here using this ,
http://stackoverflow.com/a/16650451/4190386
and found it as the best way to implement my json form.
Could you please look into it?
The text was updated successfully, but these errors were encountered: