I am running Django on an AWS EC2 instance.
I am receiving checkin POSTS from the Foursquare API. Foursquare requires an https address to send the POST to (but the certificate doesn’t have to be signed).
How do I get HTTPS to work with Django? I get the sense that I’m going to need another server, like Apache. If this is the case, I know very little about Apache and find most answer confusing.
I only need the https for this one case. What’s the easiest way to accomplish this?
If Apache is not a requirement, then you can use another server, for example NGINX. There is a tutorial for getting NGINX running on an EC2 environment. The reason I am suggesting NGINX is because it’s been performing better (note: I did compare with
abbut don’t take my word for it).Once you have NGINX running you can configure it to use SSL; here is the documentation to do so. The reason why you need something like NGINX is because python isn’t the best for all types of requests (e.g. for media / static files). You may also need NGINX to hand off the request to a WSGI handler (e.g.
uwsgiorgunicorn). You can read more about that here.If the SSL certificate does not have to be signed you can create a self-signed certificate, here is an example of tutorial where you can stop after the step that creates the certificate (or if you want to use Apache, proceed with all the steps).
Some good tutorials:
EDIT: to handle both
httpandhttps: