Re: TypeError: view must be a callable or a list/tuple in the case of include(). in urls.py

2016-09-05 Thread James Schneider
On Sep 5, 2016 6:06 AM, "arun kumar"  wrote:
>
> Hi,
>
>I'm working in Django 1.10 and I got the type error  in the below file
at this line " url(r'^$', views.dashboard, name = 'dashboard'),"
>
> from django.conf.urls import include, url
> from . import views
>
> urlpatterns = [
> #preview login view
> #url(r'^login/$',views.user_login, name='login')
>
> # logged - in user dashboard
> url(r'^$', views.dashboard, name = 'dashboard'),
>
> #login / logout urls
> url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
>

Here is where your problem starts. Django 1.10 removed the ability to use
string arguments to refer to views. See the deprecation notice in 1.8:

https://docs.djangoproject.com/en/1.8/ref/urls/#django.conf.urls.url

Import your views and pass them along directly.

-James

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CA%2Be%2BciVqSYGyBn0d8zE6FZGuWDCG9P-m_JXtL-83r7U_tNfpTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TypeError: view must be a callable or a list/tuple in the case of include(). in urls.py

2016-09-05 Thread 'Abraham Varricatt' via Django users
Not sure what the issue is without more info about the error, but is the 
regular expression for that view correct? Assuming that you want to divert 
folks to the root of your site can you try the following?

url(r'^/$', views.dashboard, name = 'dashboard')


NOTE: if the error still persists, it will help if you include the full 
traceback in your email.

Yours,
Abraham V.



On Monday, September 5, 2016 at 6:36:37 PM UTC+5:30, arun kumar wrote:
>
> Hi,
>
>I'm working in Django 1.10 and I got the type error  in the below file 
> at this line "* url(r'^$', views.dashboard, name = 'dashboard'),*"
>
> *from django.conf.urls import include, url*
> *from . import views*
>
> *urlpatterns = [*
> *#preview login view*
> *#url(r'^login/$',views.user_login, name='login')*
>
> *# logged - in user dashboard*
> *url(r'^$', views.dashboard, name = 'dashboard'),*
>
> *#login / logout urls*
> *url(r'^login/$', 'django.contrib.auth.views.login', name='login'),*
>
> *url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),*
>
> *
> url(r'^logout-then-login/$','django.contrib.auth.views.logout_then_login', 
> name='logout_then_login')*
>
> *]*
>
> I'm new to Django and stuck because of this 
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/e58d1158-ad6b-47af-8ae9-be77e08e9ee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TypeError: view must be a callable or a list/tuple in the case of include(). in urls.py

2016-09-05 Thread arun kumar
Hi,

   I'm working in Django 1.10 and I got the type error  in the below file 
at this line "* url(r'^$', views.dashboard, name = 'dashboard'),*"

*from django.conf.urls import include, url*
*from . import views*

*urlpatterns = [*
*#preview login view*
*#url(r'^login/$',views.user_login, name='login')*

*# logged - in user dashboard*
*url(r'^$', views.dashboard, name = 'dashboard'),*

*#login / logout urls*
*url(r'^login/$', 'django.contrib.auth.views.login', name='login'),*

*url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),*

*
url(r'^logout-then-login/$','django.contrib.auth.views.logout_then_login', 
name='logout_then_login')*

*]*

I'm new to Django and stuck because of this 

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/e7687a0c-8ba6-40a7-b835-2ac304d6fdf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.