formigol Posted February 5, 2018 Posted February 5, 2018 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!
Krydos Posted February 5, 2018 Posted February 5, 2018 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.
Krydos Posted February 6, 2018 Posted February 6, 2018 Does this help? https://stackoverflow.com/questions/34217400/function-object-has-no-attribute-as-view
formigol Posted February 6, 2018 Author Posted February 6, 2018 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.0django 1.11.6djangorestframework 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!
Krydos Posted February 6, 2018 Posted February 6, 2018 The one with dashes is already updated to the latest version too.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now