[Python] How to fix ImportError: cannot import name 'HTTpResponse' from 'django.http'

Discussão em 'Python' iniciado por Stack, Março 21, 2025.

  1. Stack

    Stack Membro Participativo

    After several trials, I still get the same

    ImportError: cannot import name 'HTTpResponse' from 'django.http' (/Users/mac/my_env/lib/python3.7/site-packages/django/http/__init__.py) after running '$ python manage.py runserver'

    in the terminal. Can someone please enlighten me with this issue? Thanks!

    The code below were originally taken from the Django tutorial on its official website.

    from django.shortcuts import render
    from django.http import HTTpResponse

    def index(request):
    return HTTpResponse("Hello, world. You're at the polls index.")

    Continue reading...

Compartilhe esta Página