Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving static files #243

Closed
ChibahAbdelwahab opened this issue Dec 29, 2018 · 1 comment
Closed

Serving static files #243

ChibahAbdelwahab opened this issue Dec 29, 2018 · 1 comment

Comments

@ChibahAbdelwahab
Copy link

ChibahAbdelwahab commented Dec 29, 2018

Hi,
I'm trying to use Daphne on production for all traffic HTTP and WebSocket, the problem is that the static files are not found,
I saw in a previous issue that i should follow these 3 steps from https://docs.djangoproject.com/en/2.0/howto/static-files/deployment/#serving-static-files-in-production

  • Push your code up to the deployment server.
  • On the server, run collectstatic to copy all the static files into STATIC_ROOT.
  • Configure your web server to serve the files in STATIC_ROOT under the URL STATIC_URL.
    How can i configure Daphne so that it can serve the static files?
@andrewgodwin
Copy link
Member

Django (including when it runs under Daphne) does not serve static files when DEBUG=False - you're meant to configure another server (like nginx) to serve them for you.

If you do want it to serve them, you'll have to use an app that lets Django serve static files in production, like whitenoise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants