How to setup SSL on a local django server to test a facebook app?

I've configured my local machine's HOSTS configuration to access the local server ( @ ) whenever I hit on the browser.

And I was using this to interact with facebook's graph api to build my app. But now facebook requires us to have an HTTPS url or rather an SSL secured url to interact with their api.

So the question is -> How do I setup SSL on a local django server ?


Short answer is you'll need to setup a proper webserver on your development machine. Use whichever one (Apache, nginx, cherokee etc) you're most familiar with.

Longer answer is that the django development server ( runserver) isn't designed to do SSL etc and the effort to make it do so is likely greater than you'd want to spend.

See discussions of this passim on the django-users list:

Not to necro a thread, but I found this tool to be extremely easy to use.

It's a premade django application with very simple install instructions.

You can add a certified key once it is installed simply by running:

python runsslserver --certificate /path/to/certificate.crt --key /path/to/key.key

I hope this helps any passer-by who might see this.

With django-extensions you can run the following command:

python runserver_plus --cert certname

It will generate a (self-signed) certificate automatically if it doesn't exist. Almost too simple.

You just need to install the following dependencies:

pip install django-extensions
pip install Werkzeug
pip install pyOpenSSL

Now, as Ryan Pergent pointed out in the comments, you lastly only need to add 'django_extensions', to your INSTALLED_APPS and should be good to go.

I used a tunnel before, which worked, but this is much easier and comes with many other commands.

Need Your Help

how to add cursor type on a table row using javascript?


var tbl = document.getElementById(TABLE_NAME);

Is a single thread guaranteed to execute a Servlet and its Filters?

java java-ee tomcat servlets servlet-filters

I already know that most implementations use a single thread, but is there anything in the specification that implies the single thread? I remember reading about distributed app servers which use a