# Path: humans/forms.py
# class LoginForm(BaseLoginForm):
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.fields['login'].widget.attrs["placeholder"] = ""
#         self.fields['password'].widget.attrs["placeholder"] = ""
#         self.fields['password'].widget.attrs["autocomplete"] = "off"
# 
#     def user_credentials(self):
#         credentials = super().user_credentials()
#         credentials['login'] = credentials.get(
#             'email') or credentials.get('username')
#         return credentials


from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from django.utils.decorators import method_decorator
from allauth.account.views import LoginView
from axes.decorators import axes_dispatch
from axes.decorators import axes_form_invalid
from humans.forms import LoginForm
    import debug_toolbar
"""hawkpost URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""



LoginView.dispatch = method_decorator(axes_dispatch)(LoginView.dispatch)
LoginView.form_invalid = method_decorator(
    axes_form_invalid)(LoginView.form_invalid)

urlpatterns = [
    url(r'^admin/login/$', admin.site.login),
    url(r'^admin/', admin.site.urls),

# Path: humans/forms.py
# class LoginForm(BaseLoginForm):
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.fields['login'].widget.attrs["placeholder"] = ""
#         self.fields['password'].widget.attrs["placeholder"] = ""
#         self.fields['password'].widget.attrs["autocomplete"] = "off"
# 
#     def user_credentials(self):
#         credentials = super().user_credentials()
#         credentials['login'] = credentials.get(
#             'email') or credentials.get('username')
#         return credentials


# Path: hawkpost/urls.py
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from django.utils.decorators import method_decorator
from allauth.account.views import LoginView
from axes.decorators import axes_dispatch
from axes.decorators import axes_form_invalid
from humans.forms import LoginForm
    import debug_toolbar

"""hawkpost URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""



LoginView.dispatch = method_decorator(axes_dispatch)(LoginView.dispatch)
LoginView.form_invalid = method_decorator(
    axes_form_invalid)(LoginView.form_invalid)

urlpatterns = [
    url(r'^admin/login/$', admin.site.login),
    url(r'^admin/', admin.site.urls),

    url(r'^users/login/$', LoginView.as_view(form_class=LoginForm),