#33162: Add __file__ to Settings.
--------------------------------+--------------------------------------
Reporter: Thomas Güttler | Owner: nobody
Type: New feature | Status: closed
Component: Core (Other) | Version: 3.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => wontfix
Comment:
You can use `settings.SETTINGS_MODULE` to check the actual module and
`importlib` to get the file, e.g.
{{{
>>> from django.conf import settings
>>> import importlib
>>> importlib.import_module(settings.SETTINGS_MODULE).__file__
'/django/tests/test_pg.py'
}}}
I don't think that a hook is needed in Django itself.
--
Ticket URL: <https://code.djangoproject.com/ticket/33162#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.99fdd1ad044fa2fb8141e1bfbc25e4d9%40djangoproject.com.