Reputation: 44491
My static files are not being served. What I have verified:
settings.STATIC_ROOT
is properly defined: STATIC_ROOT = os.path.join(BASE_DIR, '..', 'collectstatic/')
settings.STATIC_URL
is properly defined: STATIC_URL = '/static/'
python manage.py collectstatic
collectstatic/
directory has the right assetscollectstatic/
directory is tracked in my git repogit push google
(I am not sure if gae is using the gae repo copy for staging, or my local repo)gcloud preview app deploy app.yaml --promote -q
app.yaml
is properly configured, as explained hereSpecifically:
handlers:
- url: /static
static_dir: collecstatic
- url: .*
script: myproj.wsgi.application
Still I get 404 for:
https://my-site.appspot.com/static/admin/css/base.css
Why could this be? What else can I verify?
On The logging tab of the Google Cloud Platform I see warning messages:
Static file referenced by handler not found: collecstatic/admin/css/base.css
I would say all my settings are correct though.
How can I verify if my app instance has the right assets in the right places? Is there a way of checking the filesystem structure of a running instance?
Upvotes: 3
Views: 1367
Reputation: 44491
Embarassing, but the problem was a spelling error. I had:
handlers:
- url: /static
static_dir: collecstatic
And should be:
handlers:
- url: /static
static_dir: collectstatic
I'll keep this. Maybe helps somebody else.
Upvotes: 3