0๐
โ
I figured out that in my view (TokenView) Iโm referencing to the Auth user and not the User Model in my models.
So to add another attributes to the Authenticating user (provided by Django by default), I must associate the Auth user to another model and add the attributes I want, I found it here : Django Profiles
from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
activity = models.IntegerField(default=500)
def _str_(self):
return self
๐คOussama Eddahri
1๐
Please go into your root directory and delete all migrations from the root directory leaving only init file then go back into your command console and apply the migrations before you sync it to your database with migrate. Your from problem seems to come from the โfake migrate as it does not actually sync it to the databased.
๐คGodda
- [Answered ]-Test post django function
- [Answered ]-Tracing requests of users by logging their actions to DB in django
- [Answered ]-Django: Request REMOTE_ADDR is void in production
- [Answered ]-Keep old value input in django model form
- [Answered ]-Correct way to redirect two views to one template with different url id Django
Source:stackexchange.com