Thanks Luca.

Yeah, I have https setup, but that is for UI, not for REST, the REST is 
purely handled by django run server port. Based on Eric's comment, it seems 
that I need change user to send request to apache using https, and then I 
need config redirect on apache to django. then django will handle the call 
and return to apache and then apache response to user. 

Thanks again for your help. let me try to set it up to see it works.

thanks.

/zhenwu

On Thursday, February 13, 2014 3:38:35 AM UTC-8, Luca Corti wrote:
>
> Il 2014-02-13 06:16 zhenwu he ha scritto: 
> > 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. 
>
> I'm guessing you have already setup your Django app behind a webserver 
> (Apache, nginx + uwsgi, whatever). 
> I'm also assuming you have already set up an HTTPS virtualhost in your 
> webserver to serve at least your REST API urls. 
>
> If I understand correctly, you want to avoid API access using standard 
> HTTP. So what you can do is, when accessing any webservice URL, redirect 
> the request via HTTP 301 to the equivalent HTTPS url. 
>
> With nginx you can easily do this in your HTTP virtualhost configuration 
> with something like 
>
> ... 
>
>          location /your-REST-URL-endpoint { 
>                  rewrite ^(.*) https://www.example.com$1 permanent; 
>          } 
>
> ... 
>
> ciao 
>
> Luca 
>

-- 
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/02b59fa4-5b58-4997-b217-02873c9c6f00%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to