0
Hello, I’m starting to study Django (current version: 3.2.5), and I followed this article in an attempt to configure it (version consulted on 07/29/2021): https://www.alura.com.br/artigos/django-instalacao-configuracao-e-escrevendo-seu-primeiro-app
However, when executing the excerpt quoted in the article:
from polls.models import Question, Choice
I get:
Modulenotfounderror: No module named 'polls'
I went over it step by step and I couldn’t find the cause. I searched the Django library website, and there I found a quote:
from . models import Choice, Question
But I couldn’t import it this way either.
I keep thinking that maybe the article is outdated, because in other parts of the article it cited a method that is no longer current in Django, reason why I received notice of 'deprecated'. But maybe I missed some understanding on my part, which wasn’t in the article either, or I’m not seeing where I went wrong.
Does anyone know where the problem/error is?
I’ve never seen anything like this, I suggest it is a course of Alura, you contact the platform, I imagine they can help you in a better way.
– Eduardo Garcia de Oliveira
It seems that in the post some parts were hidden, this import "from Django.contrib import admin" is from admin.py.. this other import "from polls.models import Question, Choice".. polls looks like a folder.. following the logic Question, Choice is a model that is in models.. I think this is where the example:https://docs.djangoproject.com/pt-br/3.2/intro/tutorial02was copied/
– stack.cardoso