You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating a project from Django 1.11 to 3.2, and also migrating django-pipeline from 1.6.9 to 2.0.6.
Now, we have many django apps and in one app I'm importing less (CSS compiler) code from another app:
in admin_main/static/admin_main/less/common.less, which is located inside the admin_main app I have
All these 4 less files are located in the common app:
common/static/common/third_party/bootstrap/less/variables.less
common/static/common/less/styles/flexbox.less
common/static/common/less/lib/spacing.less
common/static/common/less/lib/ng-animate.less
The problem is when collecting statics and compiling admin_main/static/admin_main/less/common.less, lessc cannot find the imported files, because these files are in a complete different directory, and the relative paths cannot be found.
With django-pipeline 1.6.9 these files were found, because the file to process was not the project file, but the collected file inside my collectedstatic directory: deploy/admin/collectedstatic/admin_main/less/common.less, and of course the 4 imported files are also inside the collectedstatic directory, and all works, because lessc can find them in the same collectedstatic directory.
I have found that the problem was introduced by this commit: 63d1182
When I revert the commit it works as before. For now, I'm going to fork and use a customized version of django-pipeline.
I kindly ask: is it possible, and how do you suggest to solve these relative imports from a different Django application with the official django-pipeline package?
Is it OK to create a Pull Request to modify that commit and only use the project_infile when PIPELINE_COLLECTOR_ENABLED == False ?
Thank you for the time you can spend on this.
The text was updated successfully, but these errors were encountered:
camilotorresf
added a commit
to camilotorresf/django-pipeline
that referenced
this issue
Aug 17, 2021
If the collector is enabled (PIPELINE_COLLECTOR_ENABLED is True), use
the collected file. If the disabled (False), use the original project
source file to check if it is outdated and pick up the changes.
This will allow for static files (in particular less CSS compiler) files
to do relative imports from different apps.
See: jazzband#749
Importing other apps styles is handled differently in live and dev
environments as the dev environment processes the non collected file and
live processes the collected file.
There is an existing ticket for this: jazzband/django-pipeline#749
which has a PR. To fix this we've forked the fixed version and are using
that directly from github rather than pulling in an official package.
Hi,
I'm migrating a project from Django 1.11 to 3.2, and also migrating django-pipeline from 1.6.9 to 2.0.6.
Now, we have many django apps and in one app I'm importing less (CSS compiler) code from another app:
in
admin_main/static/admin_main/less/common.less
, which is located inside theadmin_main
app I haveAll these 4 less files are located in the
common
app:common/static/common/third_party/bootstrap/less/variables.less
common/static/common/less/styles/flexbox.less
common/static/common/less/lib/spacing.less
common/static/common/less/lib/ng-animate.less
The problem is when collecting statics and compiling
admin_main/static/admin_main/less/common.less
,lessc
cannot find the imported files, because these files are in a complete different directory, and the relative paths cannot be found.With django-pipeline 1.6.9 these files were found, because the file to process was not the project file, but the collected file inside my collectedstatic directory:
deploy/admin/collectedstatic/admin_main/less/common.less
, and of course the 4 imported files are also inside the collectedstatic directory, and all works, becauselessc
can find them in the same collectedstatic directory.I have found that the problem was introduced by this commit:
63d1182
When I revert the commit it works as before. For now, I'm going to fork and use a customized version of django-pipeline.
I kindly ask: is it possible, and how do you suggest to solve these relative imports from a different Django application with the official django-pipeline package?
Is it OK to create a Pull Request to modify that commit and only use the
project_infile
whenPIPELINE_COLLECTOR_ENABLED == False
?Thank you for the time you can spend on this.
The text was updated successfully, but these errors were encountered: