My name is Ayman Refat, and I am a junior Computer Science student at the American University in Cairo (AUC). I have hands-on experience with backend web development, most recently building Ecenter, a Django-based online learning platform designed to support high school students in Egypt.
I think a multi-layered approach works best depending on the scope of the new feature. Here is a consolidated proposal:
1. Third-Party Packages (For massive features)
If an experimental feature is big enough, it should start as a separate, standalone package. Once it is battle-tested by the community, we can migrate it directly into the Django core as a stable feature.
2. The django.experimental Namespace (For new core modules)
For completely new classes or modules, they should live in a .experimental folder. This forces developers to explicitly opt-in via imports (from django.experimental import ...), making it obvious the code is subject to change.
3. The EXPERIMENTAL_FEATURES Setting (For tweaking existing core systems)
When modifying tightly coupled core systems (like the ORM) where namespacing isn’t viable, we can use a single dictionary in settings.py:
EXPERIMENTAL_FEATURES = {'NEW_ORM_AGGREGATES': True}
4. The @experimental Decorator & Warnings
We can wrap unstable functions/classes with an @experimental('FEATURE_NAME') decorator.
-
If it’s not enabled in settings: Raise a hard
RuntimeErrorrequiring explicit opt-in. -
If it is enabled: Emit a native Python
FutureWarningto remind developers that the API might change.
5. The Feature “Graveyard” & System Checks (To prevent upgrade crashes)
To prevent silent breaking changes when an experimental feature is eventually removed or renamed, Django can maintain a registry of retired experiments. We can hook this into the System Check Framework. If a developer upgrades Django and runs manage.py runserver with a dead feature still enabled in their settings, the server will immediately halt with a clear, actionable error.
Finally, I want to know your thoughts on these ideas for developing a solution for this problem.
Note: I combined ideas from previous suggestions in this thread and tried to enhance them with architectural patterns from other frameworks. I used AI to help structure and write this final proposal. I am very interested in this problem and would love to work on implementing this for the Google Summer of Code (GSoC) program!