February 2, 2023

ModuleNotFoundError: no module named x Error in Django [Fixed]

Bello Yusuf

🥵 I can't make a simple Django project work at all. I get the same error as listed in this question which I found:

REASON WHY I MAKE BLOG OF THIS BULL SHIT MODULE NOT FOUND ERROR

There's a time a came across this error during one Ecommerce django project, I found my self frustrated that time. I tried a lot to solve the problem, but still no hope, I google it, and found that alot of people are dealing with the problem, Stackoverflow, freecodecamp, and alot of site's explained how to solve the problem, and i tried all of their answer's but did'nt solve my problem. what comes first in my mind is version problem. so i uninstall the django and install the latest version, but still again. But at the end I solve the error, so that why i make a blog of this "Module Not Found Error"

If you come across this error follow me and know how I solve it. 🤧

Game starts here

I created the project with name "ModuleNotFoundError" and I name the app "solution"

I register the app in INSTALL_APPS

In root urls

I run migrate: python3 manage.py migrate


That's the problem am facing ModuleNotFoundError, after run migrate

Solution

Create urls.py in your app, for me solution is the name of the app
i create urls file in the solution app


And i configure urlpatterns

I run the server after configure the app urls.py and run the server

That's worked for me. That all