Skip to content

plugin serve static files and load into custom panel #4020

Answered by SchrodingersGat
wolflu05 asked this question in Q&A
Discussion options

You must be logged in to vote

Unless @matmair has another suggestion, I think that this would be difficult in the current architecture, for a number of reasons.

First and foremost is how static files are served. They must be stored under the STATIC_ROOT directory (on your filesystem). The plugins do not have access to this directory, and exposing external directories to the fileserver is a huge security hole.

Secondly, defining how pathing to plugin files under /static/ works, without shadowing required files, is problematic.

Perhaps there is a way to make this work, but my suggestion would be:

Template Files: Include the files you want as part of your plugin template directory, and load them into the webpage

External…

Replies: 1 comment 16 replies

Comment options

You must be logged in to vote
16 replies
@wolflu05
Comment options

wolflu05 Dec 9, 2022
Collaborator Author

@matmair
Comment options

@wolflu05
Comment options

wolflu05 Dec 11, 2022
Collaborator Author

@wolflu05
Comment options

wolflu05 Dec 17, 2022
Collaborator Author

@matmair
Comment options

Answer selected by wolflu05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
plugin Plugin ecosystem
3 participants