9👍
You are importing from wrong location
django.http this is right location from django.http import HttpResponse
- Django admin how to display widget on readonly field
- Using MongoDB as our master database, should I use a separate graph database to implement relationships between entities?
- Django Tutorial: name 'HttpResponse' is not defined
0👍
Changing from django to django.http in the views.py file works in most cases, if it doesn’t check the urls.py file in the project dir and make sure that :
- the path() to your view is imported correctly
- that it is above the path(‘admin/’, admin.site.urls) in the urlpatterns list
- Django FormView does not have form context
- Django Rest Framework – Create foreign key object on POST
- Django-mptt get_descendants for a list of nodes
- Python Sphinx css not working on github pages
Source:stackexchange.com