Skip to content

Adding nonce to script tags rendered by Django Form Assets (Media class) #119

@hleroy

Description

@hleroy

Django allows to associate different files – like stylesheets and scripts – with the forms and widgets that require those assets, using the Media class described here.

I have looked at the source code for Django's widgets.py, but I can't find an elegant way to add the nonce to the rendered <script> tag.

Could you suggest a workaround ? Or is this something that should be addressed in Django itself ?

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions