1

Since I deployed my django application to heroku I am getting an error when opening the project. It works just fine localy but after pushing to django the following error is appearing:

ImportError at /
cannot import name 'login'
Request Method: GET
Request URL:    https://blooming-headland-56472.herokuapp.com/
Django Version: 2.1
Exception Type: ImportError
Exception Value:    
cannot import name 'login'
Exception Location: /app/Clientes/urls.py in <module>, line 5
Python Executable:  /app/.heroku/python/bin/python
Python Version: 3.6.6
Python Path:    
['/app/.heroku/python/bin',
 '/app',
 '/app/.heroku/python/lib/python36.zip',
 '/app/.heroku/python/lib/python3.6',
 '/app/.heroku/python/lib/python3.6/lib-dynload',
 '/app/.heroku/python/lib/python3.6/site-packages']
Server time:    Sex, 24 Ago 2018 11:32:30 +0000

My urls.py looks like this:

from django.urls import path
from . import views
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.contrib.auth.views import (
    login, logout, password_reset, password_reset_done, 
password_reset_confirm
)
from django.conf.urls.static import static

app_name = 'client'

urlpatterns = [
    path('register/', views.register, name='register'),
    path('login/', login, {'template_name': 'Clientes/login.html'}, 
name='login'),
    path('mail/', views.mail, name='mail'),
    path('profile/config', views.config_view, name="config"),
    path('profile/dashboard', views.dashboard_view, name="dashboard"),

    path('reset-password/', password_reset, name="reset_password"),
    path('reset-password/done/', password_reset_done, 
name="password_reset_done"),
    path('reset-password/confirm/', password_reset_confirm, 
name="password_reset_confirm"),

    path('profile/logout/', views.logout_view, name='logout'),
    path('profile/', views.ProfileView.as_view(), name='profile'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Matheus Sant'ana
  • 563
  • 2
  • 6
  • 23

0 Answers0