Comments (4)
Hey! Could you provide more details regarding what stopped working exactly? The unit tests are currently running for Django 4.1, as you can see here. Note that django-haystack is still missing a release with support for the latest Django versions, so you may have to install a development version of this package to have it working (like this is done in Django-machina's CI).
from django-machina.
Thanks for the info. Upon updating from django 4.0.8
to 4.1.3
(tried 4.1.0
as well), one of my unit tests regarding displaying unread topics failed. It may be due to django-machina
or maybe my surrounding code so I thought that I would check machina
first. Let me update my haystack
and see if it solves the problem.
from django-machina.
ok, the problem is with the removal of default_app_config
as listed in the Django 4.1 changelog. However, the problem is a bit more complicated.
My existing code has default_app_config
, with apps.py
having
from machina.apps.forum_tracking.apps import (
ForumTrackingAppConfig as BaseForumTrackingAppConfig,
)
class ForumTrackingAppConfig(BaseForumTrackingAppConfig):
name = 'mysite.forum_tracking'
default_auto_field = 'django.db.models.AutoField'
However, this breaks the django app config machinism because this module now defines two AppConfig
, BaseForumTrackingAppConfig
and ForumTrackingAppConfig
. For some reason, django does not produce any warning so the entire app is not imported and the topic_view
signal is not processed.
The solution, as explains in the documentation, is to add default=True
as follows,
class ForumTrackingAppConfig(BaseForumTrackingAppConfig):
name = 'mysite.forum_tracking'
default_auto_field = 'django.db.models.AutoField'
default = True
However, another solution should be specifying the app directly and use
INSTALLED_APPS = [
...
"mysite.forum_tracking.apps.ForumTrackingAppConfig"
...
This, however, does not work because it breaks get_class
.
File "/app/bioworkflows/forum_tracking/models.py", line 4, in <module>
from machina.apps.forum_tracking.abstract_models import AbstractTopicReadTrack
File "/usr/local/lib/python3.11/site-packages/machina/apps/forum_tracking/abstract_models.py", line 16, in <module>
ForumReadTrackManager = get_class('forum_tracking.managers', 'ForumReadTrackManager')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/machina/core/loading.py", line 16, in get_class
return get_classes(module_label, [classname, ])[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/machina/core/loading.py", line 31, in get_classes
raise AppNotFoundError('No app found matching \'{}\''.format(module_label))
machina.core.loading.AppNotFoundError: No app found matching 'forum_tracking.managers'
I encountered this problem before when trying to specify AppConfig
in INSTALLED_APPS
and may have submitted a ticket for it.
Let me see if I can come up with a PR to fix get_class
.
from django-machina.
#229 is the ticket I submitted before. A PR is now submitted.
from django-machina.
Related Issues (20)
- UniqueViolation when loading data (loaddata with a fixture) HOT 3
- forum_moved = django.dispatch.Signal(providing_args=["previous_parent", ]) HOT 4
- is it possible to display the reply button for non-authentified users ?
- Django 4 support HOT 1
- App override gets django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: forum_permission HOT 1
- Consider using different template block names.
- Edit post as anonymous user HOT 2
- Preview while creating a new post with a large attachment results into "AttributeError: '_io.BytesIO' object has no attribute 'name'"
- Template modification - Nav bar HOT 1
- Forum URL Format HOT 2
- Greek translations HOT 1
- mark_topic_read incredibly slow on large forum HOT 2
- Display post times in local time
- Django-MPTT is unmaintained. Migrate to Django-Treebeard? HOT 3
- Alex6979
- module 'PIL.Image' has no attribute 'ANTIALIAS' with dependency pillow >= 10.0.0 HOT 4
- how to use fontawsome 6 instead of builtin fontawsome 5
- «Application labels aren't unique» error while overriding HOT 2
- Model customisations are not picked up HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-machina.