Comments (7)
Are you sure that the template is called ?
from django-app-namespace-template-loader.
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.
Which version of Django do you use ?
from django-app-namespace-template-loader.
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.
Okay, I will try to reproduce your issue ASAP.
from django-app-namespace-template-loader.
Thanks a lot! In addition,my template directory structure is templates/zinnia/skeleton.html
,
from django-app-namespace-template-loader.
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)
- Support for extending the default template without recursion HOT 2
- App doesn't work with dotted paths in INSTALLED_APPS HOT 3
- Django 1.9 compatibility HOT 5
- Awareness of similar project? HOT 16
- Exception on second render of template when `app_namespace.Loader` is not first. HOT 5
- Unexpected behaviour when using an invalid namespace. HOT 4
- Misleading error in namespace violation(?) HOT 1
- Django 3 compatibility
- TEMPLATE_LOADERS deprecated in 1.8 HOT 5
- 'Loader' object has no attribute 'make_origin' HOT 1
- I think it's a bug HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-app-namespace-template-loader.