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 have added an HTMLField to a model in a project without django CMS, which should work according to the docs:
fromdjangocms_text.fieldsimportHTMLField#…classMember(models.Model):
# …description=HTMLField(blank=True, verbose_name=_('description'), help_text=_('Description of the member'))
But after starting runserver I get an import error: ModuleNotFoundError: No module named 'cms'
/home/jens/develop/ph-portal/.venv/bin/python /home/jens/develop/ph-portal/manage.py runserver localhost:8003
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/jens/.rye/py/[email protected]/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/home/jens/.rye/py/[email protected]/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 126, in inner_run
autoreload.raise_last_exception()
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 394, in execute
autoreload.check_errors(django.setup)()
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jens/.rye/py/[email protected]/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/jens/develop/ph-portal/accounts/models/__init__.py", line 7, in <module>
from .invite_passipedia_request import InvitePassipediaRequest
File "/home/jens/develop/ph-portal/accounts/models/invite_passipedia_request.py", line 5, in <module>
from ipha.models import Member
File "/home/jens/develop/ph-portal/ipha/models/__init__.py", line 6, in <module>
from .contactperson import ContactPerson
File "/home/jens/develop/ph-portal/ipha/models/contactperson.py", line 9, in <module>
from .member import Member
File "/home/jens/develop/ph-portal/ipha/models/member.py", line 13, in <module>
from djangocms_text.fields import HTMLField
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/djangocms_text/fields.py", line 7, in <module>
from .widgets import TextEditorWidget
File "/home/jens/develop/ph-portal/.venv/lib/python3.11/site-packages/djangocms_text/widgets.py", line 17, in <module>
from cms.utils.urlutils import admin_reverse, static_with_version
ModuleNotFoundError: No module named 'cms'
The text was updated successfully, but these errors were encountered:
I have added an HTMLField to a model in a project without django CMS, which should work according to the docs:
But after starting runserver I get an import error:
ModuleNotFoundError: No module named 'cms'
The text was updated successfully, but these errors were encountered: