Sunday, March 12, 2023

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

I just had the same problem, and i realized that i had the templates file in the wrong "mysite" folder. It is easy to confuse the two, so for whoever has the same problem, just check where exactly you have put the "template/admin" folders, because in the tutorial it says to put inside the folder that contains the manage.py file.

Le mardi 26 avril 2016 à 00:34:06 UTC+2, Luis Zárate a écrit :
Sory for not answer before, but I think I could help.

First you need to know how django find the templates, so take a look template loaders

https://docs.djangoproject.com/en/1.9/ref/templates/api/#django.template.loaders.filesystem.Loader

There are two default loaders (filesystem and app )

['django.template.loaders.filesystem.Loader',   'django.template.loaders.app_directories.Loader']

so take a look https://docs.djangoproject.com/en/1.9/ref/settings/#template-loaders

So is important the app order.




2016-04-22 3:21 GMT-06:00 woodz <jho...@web.de>:
Aloha Andreas Ka,

have you been able to get this to work? I am currently going through the version 1.9 and facing the same issue. Is the suggestion of
Marc Moncrief a way to go? Did you go for your own solution and would you mind to share?
Thanks a lot
, woodz


On Sunday, November 16, 2014 at 7:15:59 PM UTC+1, Andreas Ka wrote:
so far all went fine - but now templates changes just don't work.



I think there must be a flaw in that tutorial, something missing,
or something different in django 1.7.1 ?


my versions:

python -c "import django; print(django.get_version())"
1.7.1

python --version
Python 2.7.3



SYMPTOM:

my changes in 
mysite/templates/admin/base_site.html   
are simply ignored.



These are my files:

mysite# tree
.
├── db.sqlite3
├── manage.py
├── mysite
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── polls
│   ├── admin.py
│   ├── __init__.py
│   ├── migrations
│   │   ├── 0001_initial.py
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
└── templates
    └── admin
        └── base_site.html



mysite/settings.py:

TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]


Whatever I do, the page
still keeps the old title 'Django administration'


I want to understand how templates work, because I need them for my real project.

Thanks a lot!


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/24ce7663-ec8a-4643-900f-312f2e239f4en%40googlegroups.com.

No comments:

Post a Comment