Я работаю над проектом, использующим python (2.7), webapp2 и App Engine, в котором я пытаюсь отобразить некоторые статические изображения, но бот получил это.
Вот моя структура директора:
|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_content -> themes -> default -> static -> img
, а затем использовал его как:
<img src="../static/img/teamwork1.jpg" alt="" />