Static files won't match the path given

19 views
Skip to first unread message

Rookies DJ

unread,
May 11, 2019, 1:23:11 AM5/11/19
to Django users
I apologise, I'm a hardware engineer, I'm not very familiar with coding; I'm only on Django for the past 5 months. (under my boss order)

I had managed to develop and establish a Django App, and manage to upload it to remote server NameCheap. There on the server, the issue is unable to locate the static files. Even when we directed the path to static files folder.

This static files, infrequently work and load the static, that's how we concluded the static error was caused by the misdirection of the path.

But reading over the Django documentary multiple time didn't help resolve 

Please help our team had been trying resolve this issue for past 2months 

Anirudh Jain

unread,
May 11, 2019, 1:52:51 AM5/11/19
to django...@googlegroups.com
On server you will have to run - python manage.py collectstatic
and this is after you have setup nginx for serving static files on the server. Have you set it up yet?

--
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/e2f33470-0ad3-4387-9fbe-cd20b40eee82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Dewhirst

unread,
May 11, 2019, 2:06:54 AM5/11/19
to django...@googlegroups.com
Have you used manage.py collectstatic?

Connected by Motorola

Rookies DJ

unread,
May 11, 2019, 2:55:15 AM5/11/19
to Django users
Dear Anirudh Jain

Thank you for reply

Really, apprentice it

Yes we run collectstaitc command

And we try within setting.py files

Set path static_root/url as the same

As for web server software we using apache not nigx.

I apologize for not including this information

Really appreciate if you could help.

Joe Reitman

unread,
May 12, 2019, 5:40:11 AM5/12/19
to Django users
Configuring static files can be a headache. I personally use Whitenoise to serve my static files. It is self contained and can be configured in Django settings after installation. 

A couple of advantages of Whitenoise:

1. During development you can override the Django's static file server by putting 'whitenoise.runserver_nostatic' in Installed Apps. This way you can have the same behaviour on your local machine as you'll have on your hosted server.
2. You don't have to mess with Apache or Nginx settings. 
Reply all
Reply to author
Forward
0 new messages