#35708: [Django 5.1.0] The STATIC_URL is set but STATIC_ROOT is required?!
-------------------------------------+-------------------------------------
     Reporter:  NFSpeedy             |                     Type:
                                     |  Uncategorized
       Status:  new                  |                Component:  Template
                                     |  system
      Version:  5.1                  |                 Severity:  Normal
     Keywords:  collectstatic,       |             Triage Stage:
  static, aws                        |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 With updating the django-ckeditor-5 and Django, the STATIC_ROOT and
 STATIC_URL are not working properly.

 I have configured AWS S3, it is proven in battle, and without no change to
 the storages and so on, the collect static started requiring STATIC_ROOT
 when working with STATIC_URL.

 When downgrading to 5.0.8, the process started working as expected again.
 Below you can see the traceback.
 {{{
 Traceback (most recent call last):
   File "/Users/nfspeedy/.pyenv/versions/3.12.3/lib/python3.12/runpy.py",
 line 198, in _run_module_as_main
     return _run_code(code, main_globals, None,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/Users/nfspeedy/.pyenv/versions/3.12.3/lib/python3.12/runpy.py",
 line 88, in _run_code
     exec(code, run_globals)
   File "/Users/nfspeedy/.vscode/extensions/ms-python.debugpy-2024.10.0
 -darwin-
 
arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py",
 line 39, in <module>
     cli.main()
   File "/Users/nfspeedy/.vscode/extensions/ms-python.debugpy-2024.10.0
 -darwin-
 
arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py",
 line 430, in main
     run()
   File "/Users/nfspeedy/.vscode/extensions/ms-python.debugpy-2024.10.0
 -darwin-
 
arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py",
 line 284, in run_file
     runpy.run_path(target, run_name="__main__")
   File "/Users/nfspeedy/.vscode/extensions/ms-python.debugpy-2024.10.0
 -darwin-
 arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py",
 line 321, in run_path
     return _run_module_code(code, init_globals, run_name,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/Users/nfspeedy/.vscode/extensions/ms-python.debugpy-2024.10.0
 -darwin-
 arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py",
 line 135, in _run_module_code
     _run_code(code, mod_globals, init_globals,
   File "/Users/nfspeedy/.vscode/extensions/ms-python.debugpy-2024.10.0
 -darwin-
 arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py",
 line 124, in _run_code
     exec(code, run_globals)
   File "/Users/nfspeedy/Coding/avtodosie/manage.py", line 22, in <module>
     main()
   File "/Users/nfspeedy/Coding/avtodosie/manage.py", line 18, in main
     execute_from_command_line(sys.argv)
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/core/management/__init__.py", line 442, in
 execute_from_command_line
     utility.execute()
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/core/management/__init__.py", line 436, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/core/management/base.py", line 413, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/core/management/base.py", line 459, in execute
     output = self.handle(*args, **options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 209, in handle
     collected = self.collect()
                 ^^^^^^^^^^^^^^
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 135, in collect
     handler(path, prefixed_path, storage)
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/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 "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 278, in delete_file
     if self.storage.exists(prefixed_path):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/site-
 packages/django/core/files/storage/filesystem.py", line 205, in exists
     return os.path.lexists(self.path(name))
                            ^^^^^^^^^^^^^^^
   File "/Users/nfspeedy/Coding/avtodosie/.venv/lib/python3.12/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.
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35708>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701918b04df38-b5efd1e8-a9ce-45e5-a103-6516166dfbba-000000%40eu-central-1.amazonses.com.

Reply via email to