Thanks, Amitesh, for this info. It makes sense to me now!

Since nothing worked, I manually copied all the necessary libraries to a 
folder where the NginX serves its static files—it worked. However, while I 
was copying those files, I had noticed a file with an empty name (shown as 
'/' in the Linux system) in one of my folders!

I will test this in another environment with the above info in mind.

Thanks once again.
With regards, 
Maadis

On Wednesday, July 24, 2024 at 8:30:02 AM UTC+1 Amitesh Sahay wrote:

> Please my reply below
>
> *The error SuspiciousFileOperation: Could not derive file name from '' 
> indicates that a file operation is being attempted without a valid file 
> name. This can occur if a file is being saved or uploaded with an empty or 
> invalid name.*
>
> Regards,
> Amitesh 
>
>
> On Tuesday, 23 July, 2024 at 08:59:59 pm IST, Maadis Ie <[email protected]> 
> wrote: 
>
>
> 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/staticfiles
>
> 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 "/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, 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" 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-users/65c45fc1-2bb8-4175-a796-05223023f28fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/65c45fc1-2bb8-4175-a796-05223023f28fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users/3299497d-70d9-432a-9860-ea0223fae0f9n%40googlegroups.com.

Reply via email to