Ok, it's a duplicate of https://github.com/stephenmcd/mezzanine/issues/1513
As I understand it, the hook should be done in the ready() method of the
core application.
I can fix with some guidance.
Regards
Encolpe
Le mercredi 2 mars 2016 16:55:55 UTC+1, Encolpe Degoute a écrit :
>
> Hello,
>
> To help my designer to create quickly contents I'm trying to add 2
> FileField linked to the media library into BlogPost and RichTextPage models.
>
> I followed the documentation and used the 'EXTRA_MODEL_FIELDS' option in
> the end of my local_settings.py:
>
> # Mezzanine extra settings
> EXTRA_MODEL_FIELDS = (
> (
> "mezzanine.blog.models.BlogPost.background_image",
> "mezzanine.core.fields.FileField",
> (_("Background Image"),),
> {"blank": True, "upload_to": "backgrounds"},
> ),
> (
> "mezzanine.blog.models.BlogPost.banner_image",
> "mezzanine.core.fields.FileField",
> (_("Banner Image"),),
> {"blank": True, "upload_to": "banners"},
> ),
> (
> "mezzanine.pages.models.RichTextPage.background_image",
> "mezzanine.core.fields.FileField",
> (_("Background Image"),),
> {"blank": True, "upload_to": "backgrounds"},
> ),
> (
> "mezzanine.pages.models.RichTextPage.banner_image",
> "mezzanine.core.fields.FileField",
> (_("Banner Image"),),
> {"blank": True, "upload_to": "banners"},
> ),
> )
>
>
>
>
> Now I'm englued in this error:
> Unhandled exception in thread started by <function
> check_errors.<locals>.wrapper
> at 0x7f3e9bb1e598>
> Traceback (most recent call last):
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/utils/autoreload.py"
> , line 226, in wrapper
> fn(*args, **kwargs)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/core/management/commands/runserver.py"
> , line 109, in inner_run
> autoreload.raise_last_exception()
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/utils/autoreload.py"
> , line 249, in raise_last_exception
> six.reraise(*_exception)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/utils/six.py",
> line 685, in reraise
> raise value.with_traceback(tb)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/utils/autoreload.py"
> , line 226, in wrapper
> fn(*args, **kwargs)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/__init__.py",
> line 18, in setup
> apps.populate(settings.INSTALLED_APPS)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/apps/registry.py"
> , line 85, in populate
> app_config = AppConfig.create(entry)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/django/apps/config.py",
> line 90, in create
> module = import_module(entry)
> File "/srv/vencs/myproject/lib/python3.5/importlib/__init__.py", line
> 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 986, in _gcd_import
> File "<frozen importlib._bootstrap>", line 969, in _find_and_load
> File "<frozen importlib._bootstrap>", line 958, in
> _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
> File "<frozen importlib._bootstrap_external>", line 662, in
> exec_module
> File "<frozen importlib._bootstrap>", line 222, in
> _call_with_frames_removed
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/mezzanine/boot/__init__.py"
> , line 82, in <module>
> fields = parse_extra_model_fields(getattr(settings,
> "EXTRA_MODEL_FIELDS", []))
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/mezzanine/boot/__init__.py"
> , line 70, in parse_extra_model_fields
> field_class = import_field(entry[1])
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/mezzanine/boot/__init__.py"
> , line 53, in import_field
> return import_dotted_path(fully_qualified)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/mezzanine/utils/importing.py"
> , line 23, in import_dotted_path
> module = import_module(module_path)
> File "/srv/vencs/myproject/lib/python3.5/importlib/__init__.py", line
> 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 986, in _gcd_import
> File "<frozen importlib._bootstrap>", line 969, in _find_and_load
> File "<frozen importlib._bootstrap>", line 958, in
> _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
> File "<frozen importlib._bootstrap_external>", line 662, in
> exec_module
> File "<frozen importlib._bootstrap>", line 222, in
> _call_with_frames_removed
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/mezzanine/core/fields.py"
> , line 127, in <module>
> settings.PACKAGE_NAME_FILEBROWSER)
> File
> "/srv/vencs/myproject/lib/python3.5/site-packages/mezzanine/utils/importing.py"
> , line 23,
> ...
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.