django注册应用程序和Django 1.5自定义用户模型 [英] django-registration app and Django 1.5 custom user model

查看:132
本文介绍了django注册应用程序和Django 1.5自定义用户模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用django注册应用程序和Django 1.5。如何创建(新的django)自定义用户模型,并在注册时保存此数据(请注意,我使用django注册):

  class CustomProfile(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length = 255)
bank = models.CharField(max_length = 255)
address = models.CharField(max_length = 255)

解决方案

django-registration的主叉与django 1.5现在不兼容。



检查此拉请求



您有三个选项:




  • 补丁django注册的代码。您可以从拉取请求中获取所需的更改。

  • 使用已经打补丁的非官方分支。 这一个。例如

  • 等待更新主叉...


I use django-registration app and Django 1.5. How to create (new in django) custom user model and save also this data during registration (Please note that I am using django-registration):

class CustomProfile(models.Model):
    user = models.ForeignKey(User)
    name = models.CharField(max_length=255)
    bank = models.CharField(max_length=255)
    address = models.CharField(max_length=255)

?

解决方案

django-registration's main fork is not compatible with django 1.5 for now.

Check this pull request.

You have three options:

  • Patch django-registration's code. You can get the changes needed from the pull request.
  • Use an unofficial fork that is already patched. This one for example.
  • Wait for an update on the main fork...

这篇关于django注册应用程序和Django 1.5自定义用户模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆