Jump to content

Recommended Posts

Posted

Hello!

 

My django app was working very well and at certain point (without any change in the code) this error emerged:

 

Request Method: GET Request URL: http://www.colouredsweat.heliohost.org/colswe2/contacts/ Django Version: 1.11.6 Exception Type: AttributeError Exception Value:
'function' object has no attribute 'as_view'
Exception Location: /home/formigol/public_html/contacts/urls.py in <module>, line 6

 

This is the code line of the error location:

url(r'^add_contact_1$', views.AddContactFormView.as_view(), name='add_contact'),

where the views.AddContactFormView is a class based view thet has out of the box the methos .as_view().

 

I think that this is a server problem. What do you suggest to do?

 

 

Do you think that the problem is similar to the following?

 

https://stackoverflow.com/questions/46837068/options-object-has-no-attribute-get-all-related-objects-but-im-already-usin

 

Thanks a lot for your help!

 

Posted

No, the view was already declared as a class. Anyway about the djangorestframework:

 

It could be. We have Django 1.11.6 and djangorestframework 3.7.3 on Tommy. I have upgrade djangorestframework to 3.7.7. https://krydos.heliohost.org/cgi-bin/modules36.py Let us know if the error persists.

I noticed that there are two of them in the list that Krydos linked before:

 

django-rest-framework 0.1.0

django 1.11.6

djangorestframework 3.7.7

 

May be the first one is responsible for the error. What do you think?

 

Again thanks to everyone for the precious help!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...