我在開發新的,所以請patiente :)靜態樣式與谷歌應用程序引擎
我決定設計我的網站jetstrap(用於引導可視化設計器),下載HTML,然後編程後端與python並將其上傳到谷歌應用程序引擎。
當我從jetstrap下載文件時,我有一個文件夾和我的html以及一個名爲assets的文件夾,裏面有3個文件夾。 CSS,圖像,JS。
如果我用瀏覽器打開html,我可以看到像我設計的網站。但是如果我用python渲染它並在localhost上打開它,我可以看到它沒有任何css。
我嘗試添加文件夾app.yamal
application: web-development-test
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /templates/assets
static_dir: stylesheet
- url: .*
script: main.app
libraries:
- name: jinja2
version: latest
模板是對我所有的HTMLS和資產與CSS,JS和圖片的文件夾我的應用程序目錄的文件夾。
從jetstrap HTML的部分是:
<link href="assets/css/bootstrap.css" rel="stylesheet">
<style>
body { padding-top: 60px; /* 60px to make the container go all the way
to the bottom of the topbar */ }
</style>
我看到的rel =樣式出現,這就是爲什麼我添加上app.yamal的static_dir:樣式
幾乎所有的東西我都做了,是從在線教程。
預先感謝您!
編輯: 我的app文件夾
google project
app.yaml
favicon.ico
index.yaml
main.py
templates
page1.html
page2.html
assets
css
img
js
你能發佈更多關於你的目錄結構的細節嗎?你的項目的頂層有哪些目錄,下一個目錄等等?您也可以在[靜態目錄處理程序](https://developers.google.com/appengine/docs/python/config/appconfig#Static_Directory_Handlers)上找到有用的文檔。 – 2013-03-15 00:21:55
我編輯我的目錄結構的第一篇文章。我也會看到你給我的文檔。 – Tasos 2013-03-15 00:43:14