I'm trying to create a ModelForm with the following code snippet. I get this error "'str' object has no attribute 'META'". Why is that? Thanks
In my_app/forms.py
from django.contrib.auth.models import User
from django.forms import ModelForm
class UserProfileForm(ModelForm):
class Meta:
model = User
In may_app/views.py
def u(request):
form = UserProfileForm()
return render('/projects/templates/form.html',{'form':form})
def u(request):
form = UserProfileForm()
return render(request,'/projects/templates/form.html',{'form':form})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With