Vibhor Jain
Vibhor Jain

Reputation: 1476

404 Error: unable to serve static content from static_dir

I'm unable to serve static content from static_dir (css). when I visited the URL http://srvc1.appeng-vj.appspot.com/styles/index.htmll I get 404 Page Not Found error... I had expected the static content, index.html, from static_dir css should have been served as per app.yaml handlers!

app.yaml as follows:

runtime: python
env: flex
runtime_config:
python_version: 3
handlers:
- url: /styles
  static_dir: css
- url: /s1/
  script: home.application
entrypoint: gunicorn -b :$PORT m1:application
service: srvc1

app root directory structure is as follows (attach screenshot) enter image description here

Thanks for any clue what might be wrong here !

Upvotes: 0

Views: 385

Answers (1)

CodeBoy
CodeBoy

Reputation: 3300

Serving static files with static_dir is a GAE-Standard capability. It's able to do that because it is VERY different from GAE-Flexibile (which you appear to be using).

See the GAE-Flexible doc for "Serving Static Files": it doesn't say anything at all about using static_dir. For GAE-Flexible, it says your options are "You can serve static content directly from your application, host it on Cloud Storage, or use a third-party content delivery network".

Upvotes: 1

Related Questions