jazzband / jazzband/django-floppyforms

STATIC_URL not defined in templates

Open
#175 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
836
Forks
150
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use the map widget and I noticed in the template `{{ STATIC_URL}}`. It seems that only gets added if you add `django.template.context_processors.static` to your context processors. The Django docs seems to suggest using the `static` tag which doesn't require the context processor.

So instead of:
`background-image: url("{{ STATIC_URL }}floppyforms/gis/img/move_vertex_on.png");`

it should be:
`background-image: url("{% static "floppyforms/gis/img/move_vertex_on.png" %}");`
with `{% load static %}` up at the top.

So, I guess you could leave it as, but I didn't notice anything in the docs saying that you needed to have the above mentioned context processor added for some of the default templates to work. The `static` tag works without any changes to settings.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.