2013-02-27 75 views
1

熊與我,我還是很新的Python和Django的加載Django項目我家的電腦

我複製一個項目中,我從我的大學工作的電腦上USB,當我加載它在我的筆記本電腦,並嘗試在CMD使用此代碼來運行它:python manage.py runserver

我得到這個錯誤:

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x01D4EB70>> 
Traceback (most recent call last): 
    File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 91, in inner_run 
    self.validate(display_num_errors=True) 
    File "C:\Python27\lib\site-packages\django\core\management\base.py", line 270, in validate 
    raise CommandError("One or more models did not validate:\n%s" % error_text) 
django.core.management.base.CommandError: One or more models did not validate: 
groupcraft.userprofile: "picture": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ 

誰能告訴我什麼是錯還是什麼我不這樣做?

回答

3

One or more models did not validate: groupcraft.userprofile: "picture": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/

您使用Django的ImageField在你的機型之一,依靠PIL。你可以download and install a Windows installer for PIL(確保你根據你的Python版本選擇正確的文件)。

+0

在Windows機器上安裝PIL不使用畫中畫,它必須使用MSI文件,因爲WinSxS很糟糕。 – boatcoder 2013-02-28 23:16:47

1

爲最新版本PIL,只需鍵入:

easy_install http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe 

您應經常檢查現有項目的內部「requirements.txt」文件,以確保您擁有所有的Python庫包括在內。

在windows上工作時,您需要確保安裝其中一些庫的二進制版本。

相關問題