I have a question regarding import from Django.

Asked 2 years ago, Updated 2 years ago, 47 views

Python, I have a question. If you look to the left, the folder structure is displayed. By the way, if you import from views, you will see a warning sign if you do from login.forms import * Running the program does not cause errors and works well. But from...login.forms import * (Content: Get forms from the parent directory login in views) A warning message appears when you do, but an error occurs when you run it. Why is that? Or can't we get rid of the error message?

python django

2022-09-22 21:43

2 Answers

It is right to import by app name, not by directory concept. Since login is the app name, login.forms is correct.

Maybe settings.Isn't py not including login in INSTALLED_APPS?


2022-09-22 21:43


2022-09-22 21:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.