Per the puput documentation for configuring a standalone blog app, when adding 'path(' ', include('puput.urls'))', to my urls.py, I receive a circlar import error when get_entry_url and get_feeds_url are imported . See below.
Note: I am attempting to add Puput to a django 3.14 installation.
Traceback (most recent call last):
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 121, in get_package_libraries
module = import_module(entry[1])
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/puput/templatetags/puput_tags.py", line 10, in
from ..urls import get_entry_url, get_feeds_url
ImportError: cannot import name 'get_entry_url' from partially initialized module 'puput.urls' (most likely due to a circular import) (/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/puput/urls.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/core/management/base.py", line 392, in check
all_issues = checks.run_checks(
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 408, in check
for pattern in self.url_patterns:
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 589, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 582, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/thedern/code/python/django/test/djangox/config/urls.py", line 10, in
path('blog/', include('puput.urls')),
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/puput/urls.py", line 39, in
from wagtail.admin import urls as wagtailadmin_urls
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/wagtail/admin/urls/init.py", line 104, in
path(f"sprite-{get_sprite_hash()}/", home.sprite, name="wagtailadmin_sprite"),
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/wagtail/admin/urls/init.py", line 95, in get_sprite_hash
content = str(home.sprite(None).content, "utf-8")
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/wagtail/admin/views/home.py", line 224, in sprite
return HttpResponse(icons())
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/wagtail/admin/views/home.py", line 219, in icons
_icons_html = render_to_string("wagtailadmin/shared/icons.html", {'icons': all_icons})
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/loader.py", line 61, in render_to_string
template = get_template(template_name, using=using)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/loader.py", line 12, in get_template
engines = _engine_list(using)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/loader.py", line 66, in _engine_list
return engines.all() if using is None else [engines[using]]
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/utils.py", line 90, in all
return [self[alias] for alias in self]
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/utils.py", line 90, in
return [self[alias] for alias in self]
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/utils.py", line 81, in getitem
engine = engine_cls(params)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 25, in init
options['libraries'] = self.get_templatetag_libraries(libraries)
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 43, in get_templatetag_libraries
libraries = get_installed_libraries()
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 108, in get_installed_libraries
for name in get_package_libraries(pkg):
File "/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/django/template/backends/django.py", line 123, in get_package_libraries
raise InvalidTemplateLibrary(
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'puput.templatetags.puput_tags': cannot import name 'get_entry_url' from partially initialized module 'puput.urls' (most likely due to a circular import) (/home/thedern/code/python/django/test/djangox/venv/lib/python3.8/site-packages/puput/urls.py)