Hi,
I am trying to deploy my first Django app (5.0.7). When I run 'python mange.py collectstatic' it copies some of the admin and css files and exit with the following error message:
"python manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings:
/webapps/dsite/
dcork.ie/dproject/staticfilesThis 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 "/webapps/dsite/
dcork.ie/dproject/manage.py", line 22, in <module>
main()
File "/webapps/dsite/
dcork.ie/dproject/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
collected = self.collect()
^^^^^^^^^^^^^^
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect
handler(path, prefixed_path, storage)
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file
self.storage.save(prefixed_path, source_file)
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/files/storage/base.py", line 44, in save
name = self.get_available_name(name, max_length=max_length)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/files/storage/base.py", line 82, in get_available_name
validate_file_name(file_name)
File "/webapps/dsite/
dcork.ie/virt/lib/python3.12/site-packages/django/core/files/utils.py", line 10, in validate_file_name
raise SuspiciousFileOperation("Could not derive file name from '%s'" % name)
django.core.exceptions.SuspiciousFileOperation: Could not derive file name from ''
Has anybody entered this error? I am getting this error both on Nginx alone and Whitenoise. It copies some files in the destination directory before this error.
Any pointers would be highly appreciated.
Thanks,