1
我是新來的Django。我正在使用Google App引擎和Google CloudSQL來爲django1.2項目提供服務。我一直在關注教程here,並遇到了麻煩。谷歌應用程序引擎不加載管理靜態媒體文件
我啓用了管理後臺在我的settings.py,但是當我去http://www.examplesite.com/admin/找不到css文件。
管理HTML頁面加載罰款,但靜態文件給予404
這裏是我的app.yml:
application: myapp
version: 1
runtime: python27
api_version: 1
threadsafe: true
libraries:
- name: django
version: "1.2"
builtins:
- django_wsgi: on
我離開這些默認的settings.py:
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'
我知道這些文件位於google_appengine/lib/django_1_2/django/contrib/admin/media/
我需要將這些靜態資源複製到我的項目目錄中嗎?或者我有一個設置錯誤?
結束了創建一個符號鏈接到了contrib /管理/ media目錄並創建一個處理程序,它,就像你指出出。處理程序: - url: – dmoss18