Tutorial 7 - base_site.html location?

Hi All, sorry this is probably a very basic question - but I’m stuck on the part of Tutorial 7 (Customising the Admin Area) where we need to copy the “admin/base_site.html template” from within the default Django admin template directory into my repository

The steps I have taken are:

  1. All tutorial instructions (1 through 7) followed to this point
  2. Admin area customized correctly as far as the point where we need to copy the admin/base_site.html template from the default Django admin template directory in the source code of Django itself (django/contrib/admin/templates - i can’t get to this path or understand where it is to access it)

Steps taken to resolve the issue:

  1. I have ran the command python -c “import django; print(django.path)” to locate the file and it tells me the location is: [‘/workspace/.pip-modules/lib/python3.8/site-packages/django’]
  2. I have used the “cd” command to point the terminal at this path - see screenshot below - but now I am unsure as to how to actually get the admin/base_site.html file so i can copy it into my Django project directory

Thanks again in advance for any assistance you can provide!

It’s the ‘cp’ command, e.g. cp name_of_the_file_you_want_to_copy name_of_the_directory_where_you_want_to_put_the_copy

1 Like

Perfect that worked great again Ken - thanks again for all your help the last few days

@KenWhitesell sorry to bother you but I am still stucked at that point… So, I am within my django directory and went further into the templates. Here I tried to ‘cp admin templates/admin’ but logically this is not the solution - but how do I tell the console now the right path where to copy this?

You would need to specify the full directory as the target - so it might be something along the lines of /home/username/project/templates/admin (obviously, you’ll need to specify your particular directory structure)

I got it, but accidentally I copied a lot more than just the base_site.html - anyways, I deleted the rest and learned something new - Thanks for the quick reply :slight_smile:

Please do not post images of code or tracebacks here. Copy/paste the necessary text into the body of your message, surrounded by lines of three backtick - ` characters.