Jump to content

Trubles with django framework


formigol

Recommended Posts

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!

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...