0

My Python + Django application has quite a lot of CSS/JS dependencies, which change quite seldom.

I was thinking about separating the two. My package with the dependencies takes 2x more space than without them (with deps 8.7 MB, without deps about 4.3 MB).

Those dependencies are crucial to run the application and I would not exactly like the idea of building them on a production server, as it introduces another possible point of failure. Also, having a comfort of pip install or even pipx install is a valuable thing for an application, so I thought about making them a dependency of the "main" app package.

Are there any official, sanctioned methods to build separate static data package for an app? Or, are there any other sensible ways of building such data? I was looking into building another, separate static-data package with Poetry, but it does not look like an easy task.

I would also like to build that data-package from the same source tree, as Django already collects the static files for me. In my Django app I already use an approach similar to django-yarnpkg , which is I keep a list of yarn-installable packages and use a custom FilesystemFinder

dotz
  • 884
  • 1
  • 8
  • 17

0 Answers0