1

All I want to know is, how do I make test.html (a file in the static folder, in the frontend package) show up?

I put the handler for it in the include.yaml file( file outside the static folder), and listed frontend under the includes in the app.yaml file (a file outside the frontend package)

My directory looks like this:

    frontend (package)
        handlers (package in frontend)
            __init__.py (file in handlers)
        sass (folder in frontend)
        static (folder in frontend)
            test.html (file in static)
        __init__.py (file in frontend)
        include.yaml(file in frontend)
   app.yaml (file not in frontend)

//================================

My include.yaml (in the frontend package) looks like this (Yes, everything is commented out because nothing I try is working):

    handlers:

    #- url: /frontend/static
    #  static_dir: frontend/static ### this works in app.yaml, but does not work in this file

    #- url: /static
    #  static_dir: static ### doesn't work in this file

    #- url: /frontend/static
    #  static_dir: frontend.static ### doesn't work in this file

    #- url: /frontend/static
    #  static_dir: /frontend/static ### this does not work in app.yaml, or in this file

//===============================================

My app.yaml file (not in the frontend package, same level as it) looks like this:

application: edev
version: 1
runtime: python27
api_version: 1
threadsafe: true


includes:
 - frontend
#- frontend_admin
#- api
#- mapreduce


handlers:

#- url: /frontend/static
#  static_dir: frontend/static ### this works in app.yaml

#- url: /frontend/static
#  static_dir: /frontend/static ### this does not work in app.yaml

#- url: /
#  script: main.app

#- url: /_ah/warmup
#  script: warmup.application



#- url: /.*
#  script: main.app


builtins:
- remote_api: on

inbound_services:
- warmup

#skip_files:
#- ^(.*/)?#.*#$
#- ^(.*/)?.*~$
#- ^(.*/)?.*\.py[co]$
#- ^(.*/)?.*/RCS/.*$
#- ^(.*/)?\..*$
#- tools.*

libraries:
- name: webapp2
  version: "2.5.2"
- name: jinja2
  version: latest

Thoughts?

1 Answers1

0

For my appengine project I've got an include named statics.yaml that looks like this. With this I can serve files directly from the ?_? context. I hope you can find something here that helps you, if you only want to serve a static file then you should be able to do it with no program and just yaml and the static directories like used below.

handlers:
- url: /(robots\.txt|favicon\.ico)
  static_files: static/\1
  upload: static/.*

- url: /vi/(.*)\%7D%7D
  static_files: static/robots.txt
  upload: static/robots.txt

- url: /static
  static_dir: static

- url: /assets
  static_dir: assets

- url: /img
  static_dir: static/img

- url: /_
  static_dir: static

- url: /stylesheets
  static_dir: static/stylesheets

- url: /stylesheets/main.css
  static_files: stylesheets/main.css
  upload: stylesheets/main.css
- url: /stylesheets/facebook.css
  static_files: stylesheets/facebook.css
  upload: stylesheets/facebook.css
- url: /stylesheets/awesome-buttons.css
  static_files: stylesheets/awesome-buttons.css
  upload: stylesheets/awesome-buttons.css
- url: /stylesheets/kool.css
  static_files: stylesheets/kool.css
  upload: stylesheets/kool.css
- url: /stylesheets/a.css
  static_files: stylesheets/a.css
  upload: stylesheets/a.css
- url: /stylesheets/index.css
  static_files: stylesheets/index.css
  upload: stylesheets/index.css
- url: /stylesheets/1.css
  static_files: stylesheets/1.css
  upload: stylesheets/1.css
- url: /googleb4b3b9748fe57cbf.html
  static_files: static/googleb4b3b9748fe57cbf.html
  upload: static/googleb4b3b9748fe57cbf.html
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424