Where are my static files in a Dokku based installation?
Asked Answered
D

1

6

I finished a Dokku deployment on a Digitalocean server. My application seems to work, except for my static files.

Here are the relevant parts of my settings.py file:

PROJECT_DIR = Path(__file__).absolute().ancestor(2)

MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    PROJECT_DIR.child('static'),
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

STATIC_ROOT = PROJECT_DIR.child('staticroot')

Does someone know how can I point my app at my static files on a Dokku based system?

Though it's not answering my question, we're currently serving the static files from AWS S3, and that works. It makes my question less urgent, but I still would like to know if it is possible to solve it "locally".

Diandre answered 28/1, 2014 at 20:15 Comment(0)
G
-2

You may need to do a few things

  1. run ./manage.py collectstatic to move static files to your static folder
  2. Update your web server config so that /static/ points to the static folder.

Have you done this already?

Godhead answered 28/1, 2014 at 20:25 Comment(4)
i did run ./manage.py collectstatic (although it does it automatically during git push). I'm not sure what do you mean in (2). How should i do that (aside from my settings as written above)? Thanks!Diandre
are you running apache or nginx or some other webserver?Godhead
nginx, but the whole deployment is through dokku.Diandre
Did you ever figure this out? Deploying for the first time and having this issue.Odonnell

© 2022 - 2024 — McMap. All rights reserved.