Coder Social home page Coder Social logo

django-sslserver's Introduction

Django SSL Server

image

image

Django SSL Server is a SSL-enabled development server for the Django Framework.

Please note that this should not be used for production setups. This app is intended for special use-cases. Most people should instead do a proper production deployment where a real webserver such as Apache or NGINX handles SSL.

Getting Started

Install the module in your Python distribution or virtualenv:

$ pip install django-sslserver

Add the application to your `INSTALLED_APPS`:

INSTALLED_APPS = (...
"sslserver",
...
)

Start a SSL-enabled debug server:

$ python manage.py runsslserver

and access app on https://localhost:8000 or start server on specified port:

$ python manage.py runsslserver 127.0.0.1:9000

IPv6 support:

$ python manage.py runsslserver -6 [::]:7443

You'll now be able to access your Django app on https://localhost:9000/

Browser Certificate Errors

Using the default settings, your local browser will make all sorts of noise that it doesn't trust the certificate. This is expected.

Django SSL Server ships "batteries included" with a self-signed server certificate. With self-signed certificates, the server is effectively telling the user, "I'm such-and-such server, because I said so". Whereas, with a commercial SSL certificate, the server tells the user, "I'm Bank of America, because VeriSign said so (or any other commercial certificate authority)."

There are two options for making the certificate warning go away in development:

Option 1: Tell your browser to explicitly trust the certificate. You can do this in your browser's "advanced settings" tab, by installing sslserver/certs/development.crt as a trusted certificate. The mechanism for this varies from browser to browser.

Option 2: Use a certificate from a CA that your browser trusts, for example Letsencrypt. If you have a certificate/key pair from a certificate authority, you can tell Django SSL Server to use it with the following arguments:

$ python manage.py runsslserver --certificate /path/to/certificate.crt --key /path/to/key.key

Third-Party Static File Handlers

If you're using a wrapper around your WSGI application such as dj_static or WhiteNoise, you probably want to let it handle serving static files. Otherwise, you may see 404s when requesting static files. You can disable the default behavior by using the --nostatic option.

Getting Involved

Feel free to open pull requests or issues. GitHub is the canonical location of this project.

django-sslserver's People

Contributors

teddziuba avatar johnthagen avatar zulupro avatar morganead avatar steve-gregory avatar zofy29 avatar titusz avatar ajsierakowski avatar allandaemon avatar ahivert avatar collinanderson avatar joehybird avatar jasonm avatar boydjj avatar jaschilz avatar justinabrahms avatar keturn avatar cmpitg avatar rfleschenberg avatar robdennis avatar psachin avatar shalltell avatar myrs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.