Consider to replace cms_app.py against apps.py
See original GitHub issueCMS developers wishing to use Apphooks, have to add a file named cms_app.py
to their source root. This in my opinion adds a layer of magic, and should be avoided; 2nd ZEN of Python: “Explicit is better than implicit.”
With the advent of Django Applications, there is no more need to use specially named files. Django, since 1.7 offers this kind of functionality right out of the box for third party apps.
So please consider this issue as a point to start discussion about moving this magic into its indented place.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Django - apps.py not recognized - Stack Overflow
AppOneConfig in your settings.py(INSTALLED_APPS).and remove default_app_config = "apps.app_1.apps.AppOneConfig" from __init__.py .. – Pradip.
Read more >Applications - Django documentation
To configure an application, create an apps.py module inside the application, then define a subclass of AppConfig there. When INSTALLED_APPS contains the dotted ......
Read more >How to Move a Django Model to Another App - Real Python
In this step-by-step tutorial, you'll learn how to move a Django model from one app to another using Django migrations. You'll explore three...
Read more >Understanding Django's Apps and AppConfig - Medium
When we run the command python manage.py startapp shop for example Django creates the following files for us. shop/ __init__.py admin.py apps.py
Read more >Django 3.2 automatic AppConfig discovery breaks projects ...
use `app-admin.py` instead of `apps.py` when following the ... Please feel-free to send a PR with docs adjustments if you think we should...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Marking this as Needs expert opinion for us to discuss on the board meeting.
I personally am against this change, the reason being that both files do different things. One (
apps.py
) stores certain metadata for django’s use of the app and already has fields which are internal to it likename
and so on. The other (cms_apps.py
) registers an application, the same way plugins are registered with the cms, its format is specific to django-cms and as this file keeps evolving (plans are underway to improve application integration), we should keep these separate.The “magic” of django CMS app configuration and various pools have been replaced by the new App registration / configuration system in v4, here is the logic keeping backward compatibility for < v4 packages configurations: https://github.com/django-cms/django-cms/blob/release/4.0.x/cms/app_registration.py#L152
The idea is to move all of the pools and configuration loading into the cms app configuration. I believe that there is still work to be done to complete the port, but it is very much a stable implementation of the feature.
Closing as this issue appears to be addressed in v4.0.x
The PR has a very well documented description of the feature and use cases: https://github.com/django-cms/django-cms/pull/6421