简体   繁体   中英

GAE python: how to configure folder in app yaml?

I am getting this error:

   raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: '/dist/index.html'

In my app.yaml file, I tried:

- url: /html
  static_dir: dist/html

- url: /assets
  static_dir: dist/assets

- url: /dist\.*
  script: main.app

- url: .*
  script: main.app

main.py:

template_dir = os.path.join(os.path.dirname(__file__), "/dist")

When rendering the html files in my handler, I don't seem to be able to access the files. Within my dist folder, there are css, images and html files that I want to be able to use.

What am I doing wrong? How to setup the app.yaml file to access the files? Any advice would be appreciated.

Change

template_dir = os.path.join(os.path.dirname(__file__), "/dist")

to

template_dir = os.path.join(os.path.dirname(__file__), "dist")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM