[Python] Django template is not changed after update (possible cache)

Discussão em 'Python' iniciado por Stack, Março 10, 2025.

  1. Stack

    Stack Membro Participativo

    I have a problem with Django. Possibly with it's cache. Version 1.11

    I use template in urlpatterns like :

    urlpatterns = [
    url(r'^service_preview/', include(serviceprev_urls, namespace = 'service_preview')),
    url(r'^service_preview/',TemplateView.as_view(template_name='service_preview.html')),
    ]


    After a lot of updates, applied to my template, the changes stop appearing in user's browser. I have actual template in my templates folder and some previous version when preview source code in browser. If I rename the template (this should raise error because template is absent), I still have that previous template in browser source. Browser page refreshing, clearing browser cache etc does not help. There are no duplicates of this page in my template folder.

    When I use another template, all is ok. Possibly, problem is in django cache. I don't know how to force clear cache, maybe it would be a solution.

    I put this at app setting file, but it doesn't help.

    CACHES = {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache',}}


    EDIT: i found i have duplicate html name, located in the same project, but other application's template directory. May it cause a problem

    Continue reading...

Compartilhe esta Página