Answer the question
In order to leave comments, you need to log in
Why don't tempate tags work in Django admin panel?
Django 1.9, using the Post model to create a post in the django admin panel.
I add text to the Content field:
Text {{ value|linebreaks }} Text
Save, go to the post page. The line remains the same :
Text {{ value|linebreaks }} Text
That is, the template tag does not work. Did according to this tutorial.
admin.py and models.py code for the blog app:
from django.contrib import admin
from blog.models import Post
# Register your models here.
admin.site.register(Post)
from django.db import models
# Create your models here.
class Post(models.Model):
title = models.CharField(max_length=255)
datetime = models.DateTimeField(u'Дата публикации')
content = models.TextField(max_length=10000)
def __unicode__(self):
return self.title
def get_absolute_url(self):
return '/blog/%i/' % self.id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question