django views error

42 views
Skip to first unread message

Mosharof sabu

unread,
Jan 27, 2015, 2:03:43 AM1/27/15
to django...@googlegroups.com
my view


def index(request):
    category_list = Status.objects.filter(comment__startswith="d")
    context_dict = {'categories': category_list}
    return render(request, 'idesk/index.html', context_dict)

it shows result in index.html page

but when i try to show query in profile.html page like bellow,

def profile(request):
    
   category_list = Status.objects.filter(comment__startswith="d")
    context_dict = {'categories': category_list}***
    return render(request, 'idesk/profile.html', context_dict)

it shows

IndentationError at /idesk/

unexpected indent (views.py, line 52)

Request Method:     POST
Request URL:     http://127.0.0.1:8000/idesk/
Django Version:     1.7.1
Exception Type:     IndentationError
Exception Value:    

unexpected indent (views.py, line 52)



anyone  can please help me?

Stephen J. Butler

unread,
Jan 27, 2015, 2:31:20 AM1/27/15
to django...@googlegroups.com
Not all your lines have the same indent level in your profile method. Line 52.
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/03c70c0f-8293-4388-87cd-53ce3d5f801f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Sergiy Khohlov

unread,
Jan 28, 2015, 3:17:12 PM1/28/15
to django-users

Second function has ident mistakes .2last lines have additional space.

27 січ. 2015 09:31, користувач "Stephen J. Butler" <stephen...@gmail.com> написав:
Reply all
Reply to author
Forward
0 new messages