简体   繁体   中英

In django I have created "tool" app, When I try to import tool to other file I got error "No module named 'tool' "

please check the following image for reference

from tool.models import loginauth
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'tool'

As per my understanding you have created app inside the internal directory of project. Which shouldn't be soo. If you still want to go with the same structure as present please replace this line with the one causing error.

from techticket.tool.models import loginauth

Please comment here If the issue still persist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM