jquery - Static files are missing -
in app there /static
folder contains static resources needed app. here handlers static resources:
- url: /static static_dir: static
this works files directly in /static
, let's have folder containing jquery:
static |- jquery | \- jquery.js | \- images \- ...
when try reach [myapp].appspot.com/static/jquery/jquery.js
return 404 , have no idea why.
also of files including .css
, .ttf
etc. giving me could not guess mimtype
error. have no idea how solve that.
edit
added (new) app.yaml. don't have dispatch.yaml.
version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /static/pages_style mime_type: text/css static_dir: /static/pages_style - url: /static/images/(.*\.(gif|png|jpg))$ static_files: static/images/\1 upload: static/images/.*\.(gif|png|jpg)$ - url: /static/bootstrap 3.3.5 static_dir: /static/bootstrap 3.3.5 - url: /static/jquery 2.1.4 static_dir: /static/jquery 2.1.4 - url: /.* script: myapp.app libraries: - name: webapp2 version: latest - name: jinja2 version: latest
the 404
errors on [myapp].appspot.com/static/jquery/jquery.js
requests caused static_files
url pattern being under static_dir
url path:
- url: /static/(.*\.css)$ static_files: static/\1 upload: static/(.*\.css)$ - url: /static static_dir: static
in above example /static/(.*\.css)$
matches located under /static
. guess static dir/files routing in gae infra gets confused in such cases.
the solution make paths more specific such static_dir
urls never include paths matching static_files
url patterns or other static_dir
urls.
about could not guess mimetype
error, q&a explains well: could not guess mimetype
Comments
Post a Comment