Thanks Eric for your help.

Basically, user has to send REST API to apache using https, and then apache 
redirect this call to django using http. Should I config anything on django 
besides configuration redirect on apache. Based on what you are saying, I 
do not need config anything on django side. thanks.

/zhenwu

On Thursday, February 13, 2014 12:20:51 AM UTC-8, Erik Cederstrand wrote:
>
> Den 13/02/2014 kl. 06.16 skrev zhenwu he <zhen...@gmail.com <javascript:>>: 
>
>
> > 
> > Thanks for your help, Luca. 
> > 
> > Could you elaborate a little bit? I am kind of new to this kind of 
> thing. What I am doing is that, I am using django to redirect all url calls 
> to python API to handle something and then return as response. you want me 
> to redirect this http call to where? and where do I setup this redirect? in 
> django? BTW, I am using manage.py run server 0:xxxx, and it started 
> listening to http port. 
>
> runserver doesn’t support HTTPS. You need to run a real webserver like 
> Apache to start serving HTTPS requests, or at least install stunnel (
> http://stackoverflow.com/questions/8023126/how-can-i-test-https-connections-with-django-as-easily-as-i-can-non-https-connec).
>  
>
>
> To tell your users that you are now serving everything over HTTPS instead 
> of HTTP, tell your webserver to redirect everything. This is for Apache: 
>
> <VirtualHost *:80> 
>     [...] 
>     ServerName example.com 
>     RewriteEngine On 
>     RewriteRule ^/(.*)$ https://example.com/$1 [R=301] 
> </VirtualHost> 
>
>
> You could also do the redirection in Django by looking at 
> HttpRequest.is_secure(), if your redirection logic is more complicated. 
>
>
> Erik

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bc2eb08-6d60-415e-9422-c19465f9b4bd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to