シンプルなキャプチャをジャンゴで動作させようとしています。
4 つの手順を実行した後:
走ったpython manage.py test captcha.
それは私にこれを与えました:
Traceback (most recent call last):
File "/Users/cnnlakshmen_2000/Projects/Permissions/captcha/tests/__init__.py", line 26, in testImages
response = self.client.get(reverse('captcha-image', kwargs=dict(key=key)))
File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/django/test/client.py", line 439, in get
response = super(Client, self).get(path, data=data, **extra)
File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/django/test/client.py", line 244, in get
return self.request(**r)
File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/Users/cnnlakshmen_2000/Projects/Permissions/captcha/views.py", line 27, in captcha_image
font = ImageFont.truetype(settings.CAPTCHA_FONT_PATH, settings.CAPTCHA_FONT_SIZE)
File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL/ImageFont.py", line 218, in truetype
return FreeTypeFont(filename, size, index, encoding)
File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL/ImageFont.py", line 134, in __init__
self.font = core.getfont(file, size, index, encoding)
File "/Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL/ImageFont.py", line 34, in __getattr__
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed
しかし、私は実際にpilをインストールしました。
sudo pip install pil と入力すると、次のようになります。
Requirement already satisfied (use --upgrade to upgrade): pil in /Users/cnnlakshmen_2000/Projects/env/lib/python2.7/site-packages/PIL
Cleaning up...
私のエラーがどこにあるのかわからない...いくつかのガイダンスが必要です...