python manage.py runserver
I get the following error -
File "C:\pyprojects\focus\site\general\forms.py", line 26, in Meta model = models.UserProfile AttributeError: 'module' object has no attribute 'UserProfile'
As models.py and forms.py is under same directory(general) so I have imported the model in forms.py in this way
from .models import models
Now in models.py I have defined the class
class UserProfile(models.Model, HashedPk): user = models.OneToOneField(User, unique=True) is_pro = models.BooleanField(default=False, blank=True) ......................................................
In forms.py the code is
class UserProfileForm(forms.ModelForm): class Meta: model = models.UserProfile .....................
Is there any special way to call the model in python 3.4.
Any help is highly appreciated.
from . import models