正如dotcloud教程指導,這是我postinstall
代碼:collectstatic拋出 'OSERROR:[錯誤2]沒有這樣的文件或目錄:' 在dotcloud
#!/bin/sh
python createdb.py
python some_project/manage.py syncdb --noinput
python mkadmin.py
mkdir -p /home/dotcloud/data/media /home/dotcloud/volatile/static
ln -sf /home/dotcloud/volatile/static /home/dotcloud/static
python some_project/manage.py collectstatic --noinput
... nginx.conf
location /media/ { root /home/dotcloud/data ; }
...和settings.py
....
MEDIA_ROOT = '/home/dotcloud/data/media/'
MEDIA_URL = '/media/'
STATIC_ROOT = '/home/dotcloud/volatile/static/'
STATIC_URL = '/static/'
....
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'some_project',
)
當postinstall
運行時,將引發此錯誤:
OSError: [Errno 2] No such file or directory: '/home/dotcloud/rsync-1346498181296/some_project/static'
我一直在很長一段時間,它的混亂,因爲該文件說/static/
已經建立由Python服務和鏈接/home/dotcloud/static
燦有人協助?一切運行良好,直到我設置應用程序的靜態內容。 Python 2.7上的Django版本是1.4.1
嗨,我是一個django + dotcom新手試圖根據最新的文檔設置靜態:http://docs.dotcloud.com/0.9/tutorials/python/django/#handle-static-and-media -資產。我還得到 22:33:43.553537:[www.0] OSError:[Errno 2]沒有這樣的文件或目錄:'/ home/dotcloud/rsync-1360362707945/static' 需要做的任何更改到本教程中給出的配置? – zbyszek26104