[Answer]-Django app – importing module issues

0👍

With guidance from stormlifter, I fixed the issue by making a init.py file in Mod and installing the module with python setup.py install. Here is a blog post that was useful as well:
http://djangotricks.blogspot.com/2008/09/note-on-python-paths.html

👤mcw

1👍

Your “Mod” folder appears to be missing a “init.py” which it will need if you want to import from it.

I also don’t recommend a capitalized folder in Python, kind of confusing.
I’d also recommend you add “mod” to your python path so you’re not having to do Mod.mod.module you can just do mod.module. I assume you have “mod” (lowercase) as an “INSTALLED_APP” in settings.py? Or is “module” the app? Either way you may want to check out Django’s documentation on how to organize a project, especially if this is your first time.

Leave a comment