formigol Posted February 5, 2018 Share 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! Quote Link to comment Share on other sites More sharing options...
Krydos Posted February 5, 2018 Share 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. Quote Link to comment Share on other sites More sharing options...
formigol Posted February 5, 2018 Author Share Posted February 5, 2018 Yes the error is still there Quote Link to comment Share on other sites More sharing options...
Luigi123 Posted February 6, 2018 Share Posted February 6, 2018 Moved to Customer Service. Quote Link to comment Share on other sites More sharing options...
Krydos Posted February 6, 2018 Share Posted February 6, 2018 Does this help? https://stackoverflow.com/questions/34217400/function-object-has-no-attribute-as-view Quote Link to comment Share on other sites More sharing options...
formigol Posted February 6, 2018 Author Share 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! Quote Link to comment Share on other sites More sharing options...
Krydos Posted February 6, 2018 Share Posted February 6, 2018 The one with dashes is already updated to the latest version too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.