2013-03-28 104 views
0

所以我決定部署我的第一個appjog應用程序,在appfog中創建應用程序,下載源代碼以便使用他們的項目結構,進行必要的更改和更新。它一切順利,直到我做了python manage.py collectstatic這收集了所有的靜態文件,但我無法對靜態文件進行更改,無法在模板中使用css。我只是不明白爲什麼。 在我的settings.py爲什麼我不能編輯css文件並在django模板中使用css?

ROOT_PATH = os.path.dirname(__file__) 
STATIC_ROOT = os.path.join(ROOT_PATH, 'static') 
STATIC_DIR = /absolute/path/to/static 

在urls.py

url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), 

我的項目結構看起來像這樣,基本結構與appfog

-env 
-.afignore 
-settings.py 
-templates 
-static 
-app1 

如何解決這個問題?

+0

嘿@catherine,我沒有得到你的意思..我感到困惑的聲明..'' – 2013-03-28 07:37:56

+0

現在我明白了...但它是聰明的與django文件搞砸,因爲staticfiles是一個django目錄的權利。 – 2013-03-28 07:53:39

+0

好吧,讓我們試試看吧 – 2013-03-28 08:02:39

回答

0

當你run python manage.py collectstatic它會create static folder其中copy the files inside staticfiles folder,對不對?

如果您想進行更改,請不要嘗試在靜態文件夾中對其進行更改。只需更改staticfiles文件夾內的文件即可。之後,運行python manage.py collectstatic在靜態文件夾中進行更新。

相關問題