Code Monkey home page Code Monkey logo

Comments (7)

Fantomas42 avatar Fantomas42 commented on August 20, 2024

Are you sure that the template is called ?

from django-app-namespace-template-loader.

 avatar commented on August 20, 2024

I think it is.If I delete above codes then refresh the page,it be a blank page.Or I put some characters on it,the page will show them.

from django-app-namespace-template-loader.

Fantomas42 avatar Fantomas42 commented on August 20, 2024

Which version of Django do you use ?

from django-app-namespace-template-loader.

 avatar commented on August 20, 2024

I use django 1.9.6 and latest zinnia version.
Does I describe the issue clearly? What I want to do is add a css style sheet to zinnia_bootstrap/zinnia/skeleton.html (I install the bootstrap theme). Now the problem is cannot populate block link.
Here is my settings for template loader:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')]
        ,
        'APP_DIRS': False,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'zinnia.context_processors.version',  # Optional
            ],
            'loaders': [
                'app_namespace.Loader',
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ],
        },
    },
]

from django-app-namespace-template-loader.

Fantomas42 avatar Fantomas42 commented on August 20, 2024

Okay, I will try to reproduce your issue ASAP.

from django-app-namespace-template-loader.

 avatar commented on August 20, 2024

Thanks a lot! In addition,my template directory structure is templates/zinnia/skeleton.html,

from django-app-namespace-template-loader.

Fantomas42 avatar Fantomas42 commented on August 20, 2024

Hello,

sorry for the late reply.

This does not work because later in the original zinnia/base.html the block link in populated without a block.super, so your modification is overridden.

So to accomplish what you what, you have to create a template named zinnia/base.html with this content:

{% extends "zinnia_bootstrap:zinnia/base.html" %}
{% load staticfiles %}

{% block link %}
<link rel="stylesheet" href="{% static "test.css" %}" />
{{ block.super }}
{% endblock%}

Regards

from django-app-namespace-template-loader.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.