I am migrating my model in Django project but error is being generated.Below is the code. What should be corrections in my code to solve this
Models.py
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class UserProfileInfo(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
#addtional
portfolio_site = models.URLField(blank=True)
profile_pic = models.ImageField(blank=True,upload_to="profile_pics")
def __str__(self):
return (self.user.username)
Forms.py
from django import forms
from django.contrib.auth.models import User
from basic_app.models import UserProfileInfo
class UserForm(forms.ModelForm):
password = User.CharField(widget=forms.PasswordInput())
class Meta():
model = User
fields = ['username','email', 'password']
class UserProfileInfo(forms.ModelForm):
class Meta():
model = UserProfileInfo
fields=['portfolio_site','profile_pic']
Admin.py
from django.contrib import admin
from basic_app.models import UserProfileInfo
# Register your models here.
admin.site.register('UserProfileInfo')
I am getting Attribute Error: 'str' object has no attribute '_meta'