Simulating REMOTE_USER login with the test server

86 views
Skip to first unread message

Gergely Polonkai

unread,
Jun 9, 2015, 5:08:19 PM6/9/15
to django...@googlegroups.com
Hello,

I’m about to use the test server with REMOTE_USER based logins. I already know how to set it up with my Apache based server, but I can see no way of doing the same with the dev server (manage.py runserver). I have tried setting the environment variable REMOTE_USER to a desired value, as I saw some env vars in request.META earlier, but it doesn’t seem to help. Does anybody know if this is possible, and if so, how?

Best,
Gergely

Mike Dewhirst

unread,
Jun 9, 2015, 6:40:28 PM6/9/15
to django...@googlegroups.com
On 10/06/2015 7:07 AM, Gergely Polonkai wrote:
> Hello,
>
> I’m about to use the test server with REMOTE_USER based logins. I
> already know how to set it up with my Apache based server, but I can see
> no way of doing the same with the dev server (manage.py runserver). I
> have tried setting the environment variable REMOTE_USER to a desired
> value, as I saw some env vars in request.META earlier, but it doesn’t
> seem to help. Does anybody know if this is possible, and if so, how?

You can also set up Apache locally as your dev server. I think the dev
server is more convenient for automatic reloading after saving code
changes but you can restart Apache easily enough to live with a little
inconvenience during development of that part of your project.

Mike

>
> Best,
> Gergely
>
> --
> 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
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto: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/CACczBU%2BX%2BHESqWb7P17LdmBB%2BysMZFo42ab_AsoerMBELp1_OQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACczBU%2BX%2BHESqWb7P17LdmBB%2BysMZFo42ab_AsoerMBELp1_OQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Tom Evans

unread,
Jun 10, 2015, 5:55:38 AM6/10/15
to django...@googlegroups.com
Write a piece of custom middleware that is only active with DEBUG=True
that sets the REMOTE_USER you desire.

Cheers

Tom

Gergely Polonkai

unread,
Jun 10, 2015, 6:37:53 AM6/10/15
to django...@googlegroups.com
That’s exactly what I was doing, just haven’t had the time yet to share my experience :)


Tom

--
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.
Reply all
Reply to author
Forward
0 new messages