You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm mostly noting this here in case others encounter the same issue.
Calling super configure fails in AppConf subclasses:
How to reproduce:
mktmpenv # assuming virtualenvwrapper is installed
python --version
# Python 3.10.13
pip install django==4.2.7 django-appconf==1.0.5 # these are the current versions at time of writing
mkdir test
cd test
django-admin startproject demo
cd demo
./manage.py startapp app
mskoenz:demo$ ./manage.py runserver
before fail
before fail
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/opt/homebrew/Cellar/[email protected]/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/core/management/__init__.py", line 394, in execute
autoreload.check_errors(django.setup)()
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/django/apps/config.py", line 123, in create
mod = import_module(mod_path)
File "/opt/homebrew/Cellar/[email protected]/3.10.13/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/mskoenz/programming/demo/app/apps.py", line 10, in <module>
class MyAppConf(AppConf):
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/appconf/base.py", line 73, in __new__
new_class._configure()
File "/Users/mskoenz/.virtualenvs/tmp-7c6bbf99066cd53/lib/python3.10/site-packages/appconf/base.py", line 104, in _configure
cls._meta.configured_data = obj.configure()
File "/Users/mskoenz/programming/demo/app/apps.py", line 16, in configure
return super().configure()
RuntimeError: super(): empty __class__ cell
if you comment the def configure(self): function and run ./manage.py runserver, it works (for me):
mskoenz:demo$ ./manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
November 14, 2023 - 06:23:11
Django version 4.2.7, using settings 'demo.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
The text was updated successfully, but these errors were encountered:
First off, thx for the cool package:
I'm mostly noting this here in case others encounter the same issue.
Calling super configure fails in AppConf subclasses:
How to reproduce:
def configure(self):
function and run./manage.py runserver
, it works (for me):The text was updated successfully, but these errors were encountered: