Is it possible to ignore CSS or JS from venv when building a pex file using django? #15591
-
Hi guys, I have a project that is built using django. So normally when i try to run this project. I would simply run :
Which will copy my staticfiles ( eg : css, js ) into a separate directory named I can syslink the files using
which helps with the double copy problem but it doesn't fix it fully. ( by fully fixing i mean, the collectstatic command should copy all files and then remove all other references of the files ) Now when using pantsbuild, is it possible to remove the staticfiles from venv during build process? I haven't fully checked pants yet ( planning to do after exam ) Any help will be appreciated.( i am just trying to understand if this is in the scope of pants). Thanks for reading this. I wish you guys a good day :D and thanks for creating an awesome software like this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Sorry this didn't get answered! We weren't using GitHub Discussions at the time. But we are now! |
Beta Was this translation helpful? Give feedback.
-
The copying you're referring to is the normal behavior of Django, yes? In normal use, deleting the originals would be deleting your source files (not to mention, messing up the venv for any 3rdparty apps installed from wheels, such as the standard apps, like admin, that ship with Django). So that would definitely not be advised. Pants has no particular support for doing this, and it would be dangerous, because the venvs Pants uses are cached. So my question is: what would be the reason to do this? |
Beta Was this translation helpful? Give feedback.
The copying you're referring to is the normal behavior of Django, yes?
collectstatic
copies/links the assets from their source location in each app your settings.py lists into a single merged directory that you can then deploy to a server.In normal use, deleting the originals would be deleting your source files (not to mention, messing up the venv for any 3rdparty apps installed from wheels, such as the standard apps, like admin, that ship with Django). So that would definitely not be advised. Pants has no particular support for doing this, and it would be dangerous, because the venvs Pants uses are cached.
So my question is: what would be the reason to do this?