Current behavior (bug description)
The documentation is missing a step that says that you need to define STATIC_ROOT in the settings.py:
for example
STATIC_ROOT = BASE_DIR / 'staticfiles'
If you don't have it you get this error:
PS C:\Users\Ethan\Desktop\code\ethanpolls> python manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "C:\Users\Ethan\Desktop\code\ethanpolls\manage.py", line 22, in <module>
main()
File "C:\Users\Ethan\Desktop\code\ethanpolls\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
utility.execute()
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\core\management\__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\core\management\base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\core\management\base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 209, in handle
collected = self.collect()
^^^^^^^^^^^^^^
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 135, in collect
handler(path, prefixed_path, storage)
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 368, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 278, in delete_file
if self.storage.exists(prefixed_path):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\core\files\storage\filesystem.py", line 165, in exists
return os.path.lexists(self.path(name))
^^^^^^^^^^^^^^^
File "C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\django\contrib\staticfiles\storage.py", line 39, in path
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
Expected behavior
following the documentation results in no error
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
Python version any
Django version 4.2.7
Package version 0.10.1
Current behavior (bug description) The documentation is missing a step that says that you need to define STATIC_ROOT in the settings.py: for example
If you don't have it you get this error:
Expected behavior following the documentation results in no error
Upvote & Fund