5
settings.pyDjango的AUTH_PROFILE_MODULE更改登錄成功url?
AUTH_USER_MODEL = "app_registration.MyUser"
AUTH_PROFILE_MODULE = 'app_registration.MyUserProfile'
models.py
class MyUserProfile(models.Model):
user = models.ForeignKey(MyUser, unique=True)
...
MyUser.profile = property(lambda u: MyUserProfile.objects.get_or_create(user=u)[0])
的login.html
<form id="login_form" method="post" action=".">
....
<input type="hidden" name="next" value="" />
<input type="submit" value="LogIn" />
</form>
所以我做這個創造MyUserProfile模型我自定義MyUser模型。 一切工作正常,除了當我登錄(本地主機/帳戶/登錄)時,url被重定向到htp://localhost:9999/accounts/profile
而不是索引頁,如我在窗體的隱藏輸入中指定的。
這個重定向url在哪裏定義.. ??