I'm developing a site, but there's an error in the process of creating a login, how do I solve it ㅠ<
Import Error: Cannot import name 'LoginForm' project/account/forms.py
class SignupForm(UserCreationForm):
email=forms.EmailField(
required=True,
widget=forms.EmailInput(
attrs={
'class':'form-control',
'placeholder':'E-mail',
'required':'True',
}
)
)
project/urls.py
from django.conf.urls import url,include
from django.contrib import admin
from django.views.generic import TemplateView
from account.forms import LoginForm <-- This error
urlpatterns = [
#~~
url(r'^login/$', 'django.contrib.auth.views.login',{'authentification_form':LoginForm}, name='login_url'),
url(r'^logout/$', 'django.contrib.auth.views.logout',{'next_page':'/login/',}, name='logout_url'),
]
Does the _init__.py
file exist in the project/account directory?
If not, create a _init__.py
file with an empty file,
Maybe settings.Have you registered an app called account on pi's INSTALLED_APPS?
© 2024 OneMinuteCode. All rights reserved.