#35196 closed Bug (invalid)
auto running of server is not working , when making changes in admin.py [Django==4.2.10]
Reported by: | Krishnkant Dhakad | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Krishnkant Dhakad | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When I'm making changes on the live development server, if I make any errors in view.py and fix them, the server auto-reloads. However, this isn't happening with admin.py. The error message is breaking the server's auto-running
it happened on my both mac and linux machines
File "/Users/krishnkant/venv/lib/python3.10/site-packages/django/utils/module_loading.py", line 58, in autodiscover_modules import_module("%s.%s" % (app_config.name, module_to_search)) File "/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/Users/krishnkant/Saas-backend-api/users/admin.py", line 7, in <module> admin.site.register(Organization) File "/Users/krishnkant/venv/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 132, in register raise AlreadyRegistered(msg) django.contrib.admin.sites.AlreadyRegistered: The model Organization is already registered in app 'users'.
Change History (3)
comment:1 by , 10 months ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 10 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 10 months ago
Hey, when I undo changes in other files, it reloads automatically, but not with admin.py. Hope this helps. Thank you.[] Replying to David Sanders:
Hi & thanks for the report, though this is correct behaviour: the dev server will not reload if there's an exception.
Hi & thanks for the report, though this is correct behaviour: the dev server will not reload if there's an exception.