Python webapp2应用程序引擎静态图像未显示
我正在做一个使用python(2.7)、webapp2和AppEngine的项目,在这个项目中我试图显示一些静态图像,但bot成功了 这是我的导演结构:Python webapp2应用程序引擎静态图像未显示,python,python-2.7,google-app-engine,webapp2,Python,Python 2.7,Google App Engine,Webapp2,我正在做一个使用python(2.7)、webapp2和AppEngine的项目,在这个项目中我试图显示一些静态图像,但bot成功了 这是我的导演结构: |Root ├── bp_content │ └── themes │ └── default │ ├── config │ ├── handlers │ ├── routes │ ├── static │ │ ├── css
|Root
├── bp_content
│ └── themes
│ └── default
│ ├── config
│ ├── handlers
│ ├── routes
│ ├── static
│ │ ├── css
│ │ ├── img
│ │ ├── js
│ │ └── less
│ └── templates
│ ├── emails
│ ├── errors
│ └── seo
| └── base.html
| └── home.html
在我项目的根目录中,我有app.yaml
以下是我的app.yaml
中的部分:
handlers:
- url: /favicon\.ico
mime_type: image/vnd.microsoft.icon
static_files: bp_content/themes/default/static/favicon.ico
upload: bp_content/themes/default/static/favicon.ico
- url: /(\w*)/favicon\.ico
mime_type: image/vnd.microsoft.icon
static_files: bp_content/themes/\1/static/favicon.ico
upload: bp_content/themes/(\w*)/static/favicon.ico
- url: /(\w*)/(apple-touch-icon.*\.(png))
static_files: bp_content/themes/\1/static/\2
upload: bp_content/themes/(\w*)/static/(apple-touch-icon.*\.(png))
- url: /(robots\.txt|humans\.txt|sitemap\.xml|crossdomain\.xml)
script: main.app
- url: /boilerplate/css
mime_type: text/css
static_dir: bp_includes/static/css
- url: /boilerplate/js
mime_type: text/javascript
static_dir: bp_includes/static/js
- url: /boilerplate/img/(.*\.(gif|png|jpg))
static_files: bp_includes/static/img/\1
upload: bp_includes/static/img/(.*\.(gif|png|jpg))
- url: /(\w*)/css/(.*\.css)$
mime_type: text/css
static_files: bp_content/themes/\1/static/css/\2
upload: bp_content/themes/(\w*)/static/css/(.*\.css)$
- url: /(\w*)/js/(.*\.js)$
mime_type: text/javascript
static_files: bp_content/themes/\1/static/js/\2
upload: bp_content/themes/(\w*)/static/js/(.*\.js)$
- url: /(\w*)/img/(.*\.(gif|png|jpg|jpeg))
static_files: bp_content/themes/\1/static/img/\2
upload: bp_content/themes/(\w*)/static/img/(.*\.(gif|png|jpg|jpeg))
- url: /(\w*)/fonts/(.*\.eot)$
mime_type: application/vnd.ms-fontobject
static_files: bp_content/themes/\1/static/fonts/\2
upload: bp_content/themes/(\w*)/static/fonts/(.*\.eot)
- url: /boilerplate/fonts/(.*\.(eot|svg|ttf|woff))
static_files: bp_includes/static/fonts/\1
upload: bp_includes/static/fonts/(.*\.(eot|svg|ttf|woff))
- url: /(\w*)/fonts/(.*\.otf)$
mime_type: font/opentype
static_files: bp_content/themes/\1/static/fonts/\2
upload: bp_content/themes/(\w*)/static/fonts/(.*\.otf)
- url: /(\w*)/fonts/(.*\.ttf)$
mime_type: application/x-font-ttf
static_files: bp_content/themes/\1/static/fonts/\2
upload: bp_content/themes/(\w*)/static/fonts/(.*\.ttf)
- url: /(\w*)/fonts/(.*\.woff)$
mime_type: application/x-font-woff
static_files: bp_content/themes/\1/static/fonts/\2
upload: bp_content/themes/(\w*)/static/fonts/(.*\.woff)
- url: /(\w*)/fonts/(.*\.svg)$
mime_type: image/svg+xml
static_files: bp_content/themes/\1/static/fonts/\2
upload: bp_content/themes/(\w*)/static/fonts/(.*\.svg)
- url: /.*
script: main.app
我在bp\u content->themes->default->static->img
然后将其用作:
<img src="../static/img/teamwork1.jpg" alt="" />
我非常确定您的html需要如下:
假设你的图片在这里,我很确定你的html应该是这样的:
假设您的图像在这里/bp\u content/themes/default/static/img/teamwork1.jpg