settings.pyAUTH_PROFILE_MODULE của Django thay đổi url thành công khi đăng nhập?
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>
Vì vậy, tôi đã làm điều này để tạo ra mô hình MyUserProfile cho tôi mô hình MyUser tùy chỉnh. Mọi thứ hoạt động tốt, ngoại trừ khi tôi đăng nhập (localhost/accounts/login), url được chuyển hướng đến htp://localhost:9999/accounts/profile
thay vì trang chỉ mục như tôi đã chỉ định trong đầu vào bị ẩn của biểu mẫu.
Url chuyển hướng này được xác định ở đâu .. ??