97
you can just print it out.
>>> import django
>>> print django.__file__
/var/lib/python-support/python2.5/django/__init__.pyc
>>>
or:
import inspect
import django
print inspect.getabsfile(django)
4
This (or something like this) also works when you are searching for files in other packages:
$ dpkg -L python-django | grep __init__.py
- [Django]-Python regex for integer?
- [Django]-How do I get the object if it exists, or None if it does not exist in Django?
- [Django]-Django/Python Beginner: Error when executing python manage.py syncdb – psycopg2 not found
- [Django]-What is the advantage of Class-Based views?
- [Django]-Remove "add another" in Django admin screen
- [Django]-How to fix " AttributeError at /api/doc 'AutoSchema' object has no attribute 'get_link' " error in Django
1
A one-liner command (which is given in the django docs) to find where your django source files are:
$ python -c "import django; print(django.__path__)"
- [Django]-How do I iterate over the options of a SelectField in a template?
- [Django]-Multiple Models in a single django ModelForm?
- [Django]-How to use pdb.set_trace() in a Django unittest?
Source:stackexchange.com