get_directories in staticfiles.py has bad asserts
See original GitHub issueI don’t think you can use F-Strings in assert statements. I get “invalid syntax” if I try.
The line:
directory = os.path.normpath(os.path.join(spec.origin, "..", "statics"))
Always assumes there is a folder statics
? I believe the standard is static
and not statics
and the user is not given the option to circumvent the step. Does it make more sense to only include this step if directory is None
.
The directory argument does not get the package path prepended, which I feel is implied in the documentation.
The assert os.path.isdir(directory)
will fail every time since it will return the __init__.py
of a package.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Why won't collectstatic copy my static files? - Stack Overflow
When I run ./manage.py collectstatic , I expect the MyApp directory be copied to STATIC_ROOT , but it doesn't. I have DownloadedApp/static/ ...
Read more >How to manage static files (e.g. images, JavaScript, CSS)
This method is grossly inefficient and probably insecure, so it is unsuitable for production. See How to deploy static files for proper strategies...
Read more >error while running '$ python manage.py collectstatic --noinput ...
The absolute path to the directory where collectstatic will collect static files for deployment. Something like this should work:.
Read more >Whta is the point of the /static/ directory? (Example) - Treehouse
/staticfiles.py is the name of the file where the loaded "static" method lives. Prior to Django 2.0 we had to explicitly tell the...
Read more >Nixpkgs 22.11 manual - NixOS
Nix expressions describe how to build packages from source and are collected in the nixpkgs repository. Also included in the collection are Nix...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closed via #535 and released as 0.12.3.
Happy to also resconsider our static dir naming, but let’s treat that as a sperate issue if anyone wants to open it.
@tomchristie this page of the Django docs says:
I believe this is reflected in the code here.