Instead of providing the view itself, i want to  pass its module path as a 
string in the urls.py file  as the code below


urlpatterns = ['',
     url(r'^$', main_page),
     url(r'^user/(\w+)/$', user_page),
     url(r'^login/$', 'django.contrib.auth.views.login'),
]

but it return this information
TypeError: view must be a callable or a list/tuple in the case of include()


please any help

below is also the HTML form .

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Django Bookmark - User Login</title>
</head>
<body>
    <h1>User Login</h1>
    {% if form.has_errors %}
        <p>Your username and password didn't match.</p>

    {% endif %}
    <form method="post" action=".">
        <p><label for="id_username">Username:</label>{{ form.username }}</p>
        <p><label for="id_password">Password:</label>{{ form.password }}</p>
        <input type="hidden" name="next" value="/"/>
        <input type="submit" value="login"/>
    </form>
</body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bc8c139d-7997-44d5-a1a2-183d56eb1a59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to