Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add a custom static storage class #166

Closed
pandafy opened this issue Dec 8, 2020 · 6 comments · Fixed by #172
Closed

[feature] Add a custom static storage class #166

pandafy opened this issue Dec 8, 2020 · 6 comments · Fixed by #172
Labels
enhancement good first issue Good for new contributors

Comments

@pandafy
Copy link
Member

pandafy commented Dec 8, 2020

Add custom static storage class with option to exclude files based on Unix shell-style wildcards. The code for this new class should reside in openwisp_utils.storage.py

Port changes from storage.py in ansible-openwisp2

@pandafy pandafy transferred this issue from openwisp/openwisp-users Dec 8, 2020
@pandafy pandafy added enhancement good first issue Good for new contributors labels Dec 8, 2020
@iprasandeep
Copy link

Hey, can i work on this issue ?? if yes please assign me.

@Arsh0023
Copy link
Contributor

Arsh0023 commented Feb 5, 2021

Hi! @pandafy i would like to work on this issue.

@pandafy
Copy link
Member Author

pandafy commented Feb 5, 2021

Go ahead @Arsh0023 👍

@Arsh0023
Copy link
Contributor

Hi @pandafy I have created a StaticStoragClass that pretends to ignore files based on Unix shell-style wildcards. So what it actually does is it prevents the files from getting copied to 'STATIC_ROOT'.So first all the files get copied into the 'STATIC_ROOT' and then I've defined a post_process method that deletes the files which were told to be ignored. Is this fine should I create a PR, If not then what changes I should do.

@pandafy
Copy link
Member Author

pandafy commented Feb 15, 2021

@Arsh0023 you just need to port the code from storage.py in ansible-openwisp2 which means you can just copy the code for storage class and mixin from there and put it under openwisp_utils/storage.py(you'll have to create this file). After that you are supposed to write tests and documentation for the feature.

@Arsh0023
Copy link
Contributor

@pandafy Oh I see I went a little out of way, thanks for helping I am actually new to open source. I'd be working on what you told

Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 3, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/.
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 3, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 3, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 5, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for CompressStaticFilesStorage in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added OPENWISP_STATICFILES_VERSIONED_EXCLUDE.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added django-compress-staticfiles~=1.0.1b in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 11, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for `CompressStaticFilesStorage` in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added `django-compress-staticfiles~=1.0.1b` in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 12, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/.
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 12, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 12, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 12, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for CompressStaticFilesStorage in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added OPENWISP_STATICFILES_VERSIONED_EXCLUDE.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added django-compress-staticfiles~=1.0.1b in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 12, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for `CompressStaticFilesStorage` in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added `django-compress-staticfiles~=1.0.1b` in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 12, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for `CompressStaticFilesStorage` in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added `django-compress-staticfiles~=1.0.1b` in install_requires in setup.py.

Updated with requested changes.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/.
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
…#166

Ported changes from  storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for CompressStaticFilesStorage in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added OPENWISP_STATICFILES_VERSIONED_EXCLUDE.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added django-compress-staticfiles~=1.0.1b in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for `CompressStaticFilesStorage` in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added `django-compress-staticfiles~=1.0.1b` in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/ .

Added documentation and written test for `CompressStaticFilesStorage` in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added `django-compress-staticfiles~=1.0.1b` in install_requires in setup.py.

Updated with requested changes.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 22, 2021
Ported changes from storage.py in ansible-openwisp2 to storage.py in openwisp_utils/
That is added class CompressStaticFilesStorage which can exclude files based on OPENWISP_STATICFILES_VERSIONED_EXCLUDE.

Added documentation and written test for CompressStaticFilesStorage in openwisp_utils.storage
In documentation created a separate storage utilities section and in settings added OPENWISP_STATICFILES_VERSIONED_EXCLUDE.

Created test_storage in tests/test_project/tests , The test creates a temporary folder and 2 text files in it and then runs collectstatic in that folder and checks whether the file hashed is correct or not and later deletes that folder.

Added django-compress-staticfiles~=1.0.1b in install_requires in setup.py.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 23, 2021
`CompressStaticFilesStorage` is added in storage.py which can exclude files based on `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.
Added Documetation and tests for the above.

Fixes openwisp#166
Arsh0023 added a commit to Arsh0023/openwisp-utils that referenced this issue Mar 23, 2021
`CompressStaticFilesStorage` is added in storage.py which can exclude files based on `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.
Added Documetation and tests for the above.

Fixes openwisp#166
nemesifier pushed a commit that referenced this issue Apr 3, 2021
`CompressStaticFilesStorage` is added in storage.py which can exclude files based on `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.
Added Documetation and tests for the above.

Closes #166
pandafy pushed a commit that referenced this issue Feb 18, 2022
`CompressStaticFilesStorage` is added in storage.py which can exclude files based on `OPENWISP_STATICFILES_VERSIONED_EXCLUDE`.
Added Documetation and tests for the above.

Closes #166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Good for new contributors
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants