Python Web2py:auth用户图像字段错误2
我尝试在web2py的auth用户注册表单中添加一些额外的字段。part auth.setting.extra_字段['auth_user']是我添加到models/db.py中的内容Python Web2py:auth用户图像字段错误2,python,web2py,Python,Web2py,我尝试在web2py的auth用户注册表单中添加一些额外的字段。part auth.setting.extra_字段['auth_user']是我添加到models/db.py中的内容 auth = Auth(db) crud, service, plugins = Crud(db), Service(), PluginManager() auth.settings.extra_fields['auth_user'] = [
auth = Auth(db)
crud, service, plugins = Crud(db), Service(), PluginManager()
auth.settings.extra_fields['auth_user'] = [
Field('address'),
Field('city'),
Field('zip'),
Field('image','upload')
]
## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)
除图像字段外的所有字段都工作正常。
但当我试图上传一个图像来“应用更改”时,
我得到IOERROR Error2没有这样的文件或目录:“……jpg”
web服务器在本地运行,映像在我的计算机中
我错过什么了吗?
谢谢 我尝试创建一个新应用程序并添加以下内容:
auth.settings.extra_fields['auth_user'] = [
Field('address'),
Field('city'),
Field('zip'),
Field('image','upload')
]
在app/models/db.py中,就像我所看到的那样
然后,我用appadmin创建一个新用户,并在我的图像字段中插入一个类型为upload的图像。它在Web2Py2.4.7中开箱即用
也许提供您使用的web2py版本有助于找到您面临的问题
您的问题可能来自权限或web服务器配置,但如果没有有关您设置的详细信息,我将无法帮助您
注意:您可以在以下邮件列表中获得更多帮助:
web2py社区非常友好,也很有帮助
干杯
理查德