#27230: Inconsistency in AppConfig.path
--------------------------------+--------------------
Reporter: vinayinvicible | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------
Consider the following project structure
{{{
root/
app1/
__init__.py
...
app2/
__init__.py
...
project/
__init__.py
settings.py
urls.py
wsgi.py
manage.py
script.py
}}}
content of script.py is
{{{
#!python
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
import django
django.setup()
from django.apps import apps
for app in apps.get_app_configs():
print app.path
}}}
If I run `python script.py`, output will be
{{{
$ python script.py
....
/<project_path>/root/app1
/<project_path>/root/app2
}}}
If I run `ipython script.py`, output is
{{{
$ ipython script.py
....
app1
app2
}}}
Ipython inserts !'' as the first entry in sys.path which results in path
for project apps being relative path.
This in turn is making the output of
`django.template.utils.get_app_template_dirs` inconsistent.
I faced this issue with python 2.7.11+
This is not an issue with python 2.7.12. I think because of
[https://bugs.python.org/issue1739468 Patch #1739468]
--
Ticket URL: <https://code.djangoproject.com/ticket/27230>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/057.653da97b4800f553031a3b103aad49b2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.