hln
hln

Reputation: 1106

find django/contrib/admin/templates

I have trouble to see django/contrib/admin/templates folder. It seems like it is hidden in /usr/lib/python2.7/dist-packages/ folder, ctrl+h wont help ( appearencely all django files are hidden). "locate django/contrib/admin/templates" in terminal shows bunch of files, but how can i see those files in GUI? I use Ubuntu 12.10 Thanks in advance

Upvotes: 15

Views: 17475

Answers (6)

Todor Todorov
Todor Todorov

Reputation: 2541

If you are using Python3, Django is located at your venv. In my case templates are located at <project_root>/venv/lib/python3.5/site-packages/django/contrib/admin/templates/.

Upvotes: 0

jmromer
jmromer

Reputation: 2236

To see where your django installation resides, run this at the command line:

python -c "
import sys
sys.path = sys.path[1:]
import django
print(django.__path__)"

On my system, this returns

['/usr/local/lib/python2.7/site-packages/django']

Source: Django Docs

Upvotes: 23

Aidan Ewen
Aidan Ewen

Reputation: 13308

I think you should be looking in site-packages. Assuming you're using django 1.4 it should be -

/usr/lib/python2.7/site-packages/django/contrib/admin/templates

Upvotes: 0

jpic
jpic

Reputation: 33420

You should not mess with your system-specific python setup because it is used as a dependency for other programs (which are use python). For example, a manual update of a package in /usr/lib/python2.7/site-packages/ can break a program and also requires root permissions.

Instead, you should create a virtualenv and install django in it:

# create an isolated python environment
virtualenv ~/your_env

# activate this environment, this means that you don't need to mess with your /usr system anymore
source ~/your_env/bin/activate

# use python's standard package manager to install django in the virtualenv
# does not require special permissions
pip install Django

# it will install in: ~/your_env/lib/python2.7/site-packages/

virtualenvs are isolated, safe, and work with your regular user permissions.

Upvotes: 3

dmg
dmg

Reputation: 7706

Since, everyone is posting my comment's suggestion, might as well post it myself. Try looking at:

/usr/lib/python2.6/site-packages/django/

Upvotes: 0

Matt
Matt

Reputation: 10312

Should be here: /usr/lib/python2.7/site-packages/django/contrib/admin/templates

Upvotes: 0

Related Questions