Import error No module named urls to url login_in in html page

106 views
Skip to first unread message

Guevara

unread,
Apr 18, 2011, 7:41:54 PM4/18/11
to Django users
Hello!!

I am getting the following error on my index.html page:

Exception Type: TemplateSyntaxError
Exception Value:

Caught ImportError while rendering: No module named urls


In this line:

<a href="{% url login_in %}">Login</a>

My urls.py:

(r'^imobiliaria/', include('auth.urls')),

In my auth app, i have this:

urlpatterns = patterns('auth.views',
url(r'^$', views.index, name="index"), <-- this is index page
url(r'^accounts/login/$', views.login_in, name="login_in"), <--
this is login page
url(r'^logout/$', views.logout_view, name="logout_view"),
url(r'^register/$', views.register, name="register"),
url(r'^home/$', views.home, name="home"),
)


My view to render index.html is:

def index(request):
return render_to_response('imobiliaria/auth/index.html')


In my settings.py i have this:

AUTH_PROFILE_MODULE = 'imobiliaria.imobiliaria'
LOGIN_URL = '/imobiliaria/accounts/login/'

INSTALLED_APPS = (
'imobiliaria.auth',
)

ROOT_URLCONF = 'imobiliaria.urls'



Anyone know where the problem might be?
Thanks!!

Subhranath Chunder

unread,
Apr 19, 2011, 5:49:22 AM4/19/11
to django...@googlegroups.com
Hi,

The problems seems to be with the way you are using the view prefixes in the 'patterns' function in your urls.py
Refer to: http://docs.djangoproject.com/en/dev/topics/http/urls/#the-view-prefix

You have used 'view' string twice.

Thanks,
Subhranath Chunder.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


Guevara

unread,
Apr 19, 2011, 11:41:18 AM4/19/11
to Django users
Thank you Subhranath!

I do not know what happened, but I created a new project and put the
same configuration and is now working. I think it was a problem with
the framework.

I made the correction on this line:

AUTH_PROFILE_MODULE = 'imobiliaria.login' <-- login app

Thanks!
Reply all
Reply to author
Forward
0 new messages