我想在我的Django upload_to
models.py
from mongoengine import *
from <project_name>.settings import DBNAME
from embed_video.fields import EmbedVideoField
class Author(Document):
fk_user = IntField() #points to user id in sqlite3.
first_name = StringField()
last_name = StringField()
# photo = FileField()
photo = ImageField(upload_to="avatars")
photoname = StringField()
status = StringField()
summary = StringField()
name = StringField()
我遇到了这个令人困惑的错误:
photo = ImageField(upload_to="avatars")
File "C:\Python27\lib\site-packages\mongoengine\fields.py", line 1642, in __init__
**kwargs)
File "C:\Python27\lib\site-packages\mongoengine\fields.py", line 1397, in __init__
super(FileField, self).__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'upload_to'
有谁知道如何解决它?
我正在使用Django 1.5.11
这些是我使用的所有模块和版本