Circular import between models.py and handlers.py
Closed this issue · 2 comments
kmh11 commented
Stack trace:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/usr/lib/python3.6/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/run/media/kevin/kmhDrive/Programming/angstromctf/newnewdjango/djangoctf/api/models.py", line 14, in <module>
from api import handlers
File "/run/media/kevin/kmhDrive/Programming/angstromctf/newnewdjango/djangoctf/api/handlers.py", line 5, in <module>
from api.models import Team
ImportError: cannot import name 'Team'
Before this, I updated the uWSGI version and renamed server.dev.py to server.py. Neither of those should make a difference for this error though. I am running Arch Linux.
kmh11 commented
Possible solutions: https://stackoverflow.com/a/37126790 (Assuming this isn't my fault. You guys have this running somehow.)
kmh11 commented
You guys seem to have fixed this at some point.