Skip to content

RaD/django-securelayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecureLayer agent for Django Projects

Application django-securelayer allows your site to get SSL faster.

It uses https://securelayer.ru/ as backend. Feel free to join us. Secure your forms!

Installation

Install application into system

python setup.py install

or use PIP

Add 'securelayer' into 'INSTALLED_APPS' in settings.py.

Add the following parameters into settings.py:

SECURELAYER_HOST = 'securelayer.ru'
SECURELAYER_PORT = 443
GPG_HOMEDIR = '<PATH TO/gpgring>'
GPG_PASSPHRASE = '<PASSWORD FOR YOUR PRIVATE GPG KEY>'

GPG key pair generation

Edit PGP template (see gen_key.template) and change as you wish.

Generate your own PGP key pair:

gpg --homedir=<PATH TO/gpgring> --batch --gen-key <PATH TO/gen_key.template>

Register your Web site

Register your account on https://securelayer.ru/ and submit your PGP public key there.

Secure your Web forms

Let your form to work with SecureLayer:

a) add the following into your forms' module:

from securelayer import SecuredForm

b) inherite your form from SecuredForm, not forms.Form.

c) add the following into your views' module:

from securelayer import views as securelayer

d) prepend your view with the decorator:

@securelayer.form(<form_class>,
                  caption=ugettext(u'The title of a form.'),
                  desc=ugettext(u'Enter here a form's description.'))

e) process your form with a code like this:

if request.method == 'POST' or \
   'JSON' == getattr(form, 'source', None):
    if form.is_valid():
        form.save()
        return redirect('post_success_view')

License

The MIT License

Copyright (c) 2011 Ruslan Popov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

The helper application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published