0

I have a issue with running my django application on the production server, Its working fine when i use nginx webserver to serve the static files.

But i have my django application running on one server and my webserver is running on other server.So, i cannot configure nginx to serve the static files.

I Want to know is there any way to serve the Django static files which using nginx server? I mean django should directly serve the static files for my application.

Irfan wani
  • 4,084
  • 2
  • 19
  • 34

1 Answers1

1

Use whiteNoise. WhiteNoise is a package which will help you to serve the staticfiles with very ease. http://whitenoise.evans.io/en/stable/django.html

Irfan wani
  • 4,084
  • 2
  • 19
  • 34
  • Thanks for the quick response, Let me check it once. But I have a doubt, If i use whitenoise, then i dont get any requirement to use nginx right?? – Sanjeeva Dec 11 '20 at 13:59
  • If the problem is only with the static files, then yes, whiteNoise will handle all of that. You don't need any other requirement. But do the setup in a proper manner as shown in the link. Please leave an upvote if it helps and mark it as accepted. – Irfan wani Dec 11 '20 at 16:02