Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#7587 closed (worksforme)

Find out where the default admin/base_site.html is on your system (for: Tut 2, page 2)

Reported by: HenkPoley Owned by: nobody
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The file is referenced in:

People might not know where it can be found when Django is installed with a package manager.

In the python shell:

from django.contrib import admin
admin.__path__[0] + "/templates/admin/base_site.html"

Change History (2)

comment:1 Changed 11 years ago by James Bennett

Resolution: worksforme
Status: newclosed

The install docs already mention how to find out where your site-packages directory is, and presumably someone who's installed Django will have seen that.

comment:2 Changed 10 years ago by johntynan

I believe this directory only contains symlinks to the files themselves.

To find the actual base_site.html file, you'll want to find the path to the symlink as described above, cd into the directory containing the symlink to base_site.html, then use the command:

ls base_site.html -l

This will give you the path to the actual file.

Then, you'll want to cd to this directory and, as root, copy the file to your working mysite/templates/admin directory:

sudo cp base_site.html /home/username/.../mysite/templates/admin

Then you'll want to cd into your working directory and change the ownership of the file:

sudo chown username base_site.html

Note: See TracTickets for help on using tickets.
Back to Top