All of a sudden and out of the blue, it just worked. I had the re-run my 
server

On Sunday, November 19, 2017 at 5:54:11 AM UTC-8, Jani Tiainen wrote:
>
> Hi.
>
> Could you paste the full traceback here because having an OSError sounds 
> like there is is something else wrong in your system.
>
> On 19 Nov 2017, at 15.22, yingi keme <ying...@gmail.com <javascript:>> 
> wrote:
>
> I have a function that i want to be accessed only if the user is a 
> supersuser.
>
> I have tried this
>
> from django.contrib.admin.views.decorators import staff_member_required
>
> @staff_member_required
> def my_view(request):
>     template_name = 'Core\CustomizedAdmin.html'
>     return render(request, template_name)
>
>
> What happens is that when i try to access this view, it directs me to the 
> default login admin page. 
> And then when i login as a superuser, it gives an OSError invalid argument:
>
> I expected that after login in as a superuser it will redirect to the Page 
> i want.
>
> Am i doing it the wrong way?
>
> Is there an alternative way to Limit a view to superuser only?
>
> -- 
> 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 <javascript:>.
> To post to this group, send email to django...@googlegroups.com 
> <javascript:>.
> 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/fc05e300-5e71-4bc5-b388-2996c5b8bb0a%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/fc05e300-5e71-4bc5-b388-2996c5b8bb0a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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/47bc5cb1-0b67-4849-b621-ef2f066f25e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to