Django deployment on production gives error SuspiciousFileOperation

610 views
Skip to first unread message

mohit basantani

unread,
Dec 19, 2018, 1:10:29 AM12/19/18
to Django users
I am getting a error when i am running the command 

  python manage.py collectstatic

I have deployed my project on the production server I am only using the django admin part for my project, All the functionality is working fine but the css,js and images are not loaded, So to collect the static files i am running the above command and getting error
 
django.core.exceptions.SuspiciousFileOperation: The joined path (D:\clearance_tool\swmaster\new\static\admin\css\autocomplete.css) is located outside of the base path component (D:\clearance_tool\swmaster\new\static\) 

Please help and let me know facing about this issue

code.png


project.PNG

 

command.PNG

Pradeep Sukhwani

unread,
Dec 19, 2018, 1:18:59 AM12/19/18
to Django users
Hi Mohit,
Can you please share the settings.py file which is being used for production? Specially that part where you have defined the static_url and static_root

mohit basantani

unread,
Dec 19, 2018, 1:42:04 AM12/19/18
to django...@googlegroups.com
Hello pradeep

 I found the my mistake I was giving the hard coded path of the static root which is wrong I have attached my settings.py file above now it's working fine ...Thanks for your concern really appreciated!

On Wed 19 Dec, 2018, 11:49 Pradeep Sukhwani, <ps.su...@gmail.com> wrote:
Hi Mohit,
Can you please share the settings.py file which is being used for production? Specially that part where you have defined the static_url and static_root

--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5e4299c7-37e2-465e-9442-5f98e297c785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Devender Kumar

unread,
Dec 19, 2018, 5:18:19 AM12/19/18
to django...@googlegroups.com
Use collectstatic command 

Reply all
Reply to author
Forward
0 new messages