question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider to replace cms_app.py against apps.py

See original GitHub issue

CMS 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:closed
  • Created 8 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
czpythoncommented, Mar 1, 2017

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 like name 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.

0reactions
Aiky30commented, Dec 8, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found