where does django install in ubuntu
Question:
I am looking for the init.py file for django. I tried whereis and find, but I get a lot of dirs.
Answers:
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)
This (or something like this) also works when you are searching for files in other packages:
$ dpkg -L python-django | grep __init__.py
Its now at
/usr/lib/python2.7/dist-packages/django/....
circa 2012
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__)"
I am looking for the init.py file for django. I tried whereis and find, but I get a lot of dirs.
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)
This (or something like this) also works when you are searching for files in other packages:
$ dpkg -L python-django | grep __init__.py
Its now at
/usr/lib/python2.7/dist-packages/django/....
circa 2012
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__)"