templatetags Questions

6

Solved

I'm using: {% extends "base.html" %} I get the following error: <ExtendsNode: extends "base.html"> must be the first tag in the template. Can you please help me?
Shayshaya asked 10/8, 2010 at 18:57

19

I want a menu thats custom depending which group you are member of. Im using Django 1.10.1, allauth and so on. When im trying to make my templatetag it fails and it says:¨ TemplateSyntaxError at ...
Varicose asked 18/11, 2016 at 21:28

7

When particularly extend template and when to use include? Is include of any use with content like user profile section (like about me in the corner of our site)?
Megillah asked 19/5, 2010 at 7:48

6

I was trying to use the url template tag in django, but no lucky, I defined my urls.py like this urlpatterns = patterns('', url(r'^analyse/$', views.home, name="home"), url(r'^analyse/i...
Altar asked 22/11, 2009 at 2:25

10

Solved

I am getting this issue when I type localhost:8000/admin/. `TemplateSyntaxError: Could not parse the remainder: ':password_change' from 'admin:password_change'. The syntax of 'url' changed in Djan...
Lenzi asked 17/10, 2013 at 13:49

6

Solved

My app's urls.py is: from django.urls import path from . import views app_name = 'javascript' urlpatterns = [ path('create_table', views.create_table, name='create_table') My views.py is: def cr...
Selma asked 15/3, 2018 at 21:58

2

I am new to Django and I am trying to create custom tags in django my custom tag file templatetag/custom_tag.py from django import template from model_file.models import my_Model register = temp...
Kuvasz asked 1/7, 2018 at 9:40

8

Solved

I would like to provide the same content inside 2 different base files. So, I'm trying to do this: page1.html: {% extends "base1.html" %} {% include "commondata.html" %} page2....
Midlands asked 11/9, 2009 at 4:8

5

Solved

After running the runserver command I get the following error: TemplateSyntaxError at /questions/ Invalid block tag: 'trans' Does anybody know that what's the reason? This is my template syntax: ...
Dinerman asked 27/6, 2014 at 12:7

7

Solved

Is it possible to override an existing Django Template Tag? or is it necessary to customize the template file and create a new Template Tag?
Grous asked 4/11, 2012 at 22:33

3

Solved

As "load" is far too generic for searching: What is the purpose of "load" and what does it do in this particular case? - in a template file, base_weblog.html, {% load weblog %}...
Slum asked 26/6, 2009 at 9:36

1

The doc says about @register.filter below: Custom filters are Python functions that take one or two arguments: The value of the variable (input) – not necessarily a string. The value of the argum...

3

Solved

I'm trying to use a simple_tag and set a context variable. I'm using the trunk version of django: from django import template @register.simple_tag(takes_context=True) def somefunction(context, obj...

5

I try to register my custom template tag library in django, but unfortunately it isnt working! I want to create a custom include-tag and followed the instruction at: https://docs.djangoproject.com...
Binnings asked 30/5, 2017 at 14:53

3

Solved

If I have created a template tag: @register.simple_tag def last_books(a_cat, cutoff=5): objects = Books.objects.filter(category=a_cat) return objects[:cutoff] How can I do something like this ...
Radionuclide asked 16/3, 2009 at 15:46

2

Solved

I have a set of information to be rendered on my webpage using django template tags. {% for product in sales %} <div> <span>Customer:{{product.to_user}}</span><br> <...
Goins asked 31/8, 2020 at 15:26

3

Solved

In django admin change list template there is a block: {% block result_list %} {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %} {% result_list cl ...
Endorsee asked 22/1, 2016 at 8:12

1

Solved

I'm creating custom template tags for my django site. I've followed the django documentation for this and have created a templatetags directory in my main application. /project/apps/core/templatet...
Mummery asked 18/11, 2011 at 4:9

1

I am new to Django and am trying to put an upload file form into an inclusion tag. So I can use it in various templates. I have created the following inclusion tag: #upload_files.py @register.i...
Aubervilliers asked 15/7, 2011 at 20:54

1

Solved

I try to show the name of an enum in the template.To be clear, I have enum like class in model.py class EmployerWorkerNumberRange(): R_0 = 0 R_1_5 = 1 R_6_15 = 2 UNKNOWN = 3 EMPLOYER_WORKER_NUMBE...
Uppercut asked 25/5, 2011 at 12:6

3

Solved

If I start python from the command line and type: import random print "Random: " + str(random.random()) It prints me a random number (Expected, excellent). If I include the above-two lin...
Oyler asked 8/5, 2009 at 1:55
1

© 2022 - 2024 — McMap. All rights reserved.