1
If I’ve got you right, just create custom tag and store templates in database:
from django.template import RequestContext, Template
@register.simple_tag
def footer(request):
snippet = Snippet.object.get(name='footer')
template = Template(snippet.html)
return template.render(RequestContext(request))
{% footer request %}
0
use this syntax:
{% url 'terms_conditions' as the_url %}
<a href="{{ the_url }}">Terms and Conditions</a>
- [Answer]-Django tenant schema example gives ImproperlyConfigured error
- [Answer]-Limiting data using tasty pie authorization
- [Answer]-Placing a link with onClick property in django helptext field
- [Answer]-Django: if model has related models (ForeignKey) display Fields in main modelform
- [Answer]-How easily add subtotals in Django
- [Answer]-Django JsonResponse from POST file upload
- [Answer]-Strange warning on my tests
Source:stackexchange.com