1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-stronghold
7 SDESC[py35]= Get inside your stronghold and make all yo (PY 35)
8 SDESC[py36]= Get inside your stronghold and make all yo (PY 36)
9 HOMEPAGE= https://github.com/mgrouchy/django-stronghold
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPI/d/django-stronghold
14 DISTFILE[1]= django-stronghold-0.3.0.tar.gz:main
19 OPTIONS_AVAILABLE= PY35 PY36
20 OPTIONS_STANDARD= none
21 VOPTS[py35]= PY35=ON PY36=OFF
22 VOPTS[py36]= PY35=OFF PY36=ON
24 DISTNAME= django-stronghold-0.3.0
30 [PY35].USES_ON= python:py35
32 [PY36].USES_ON= python:py36
34 [FILE:2121:descriptions/desc.single]
35 .. figure:: https://travis-ci.org/mgrouchy/django-stronghold.png?branch=master
41 Get inside your stronghold and make all your Django views default
44 Stronghold is a very small and easy to use django app that makes all
45 your Django project default to require login for all of your views.
47 WARNING: still in development, so some of the DEFAULTS and such will be
48 changing without notice.
57 pip install django-stronghold
59 Add stronghold to your INSTALLED\_APPS in your Django settings file
69 Then add the stronghold middleware to your MIDDLEWARE\_CLASSES in your
74 MIDDLEWARE_CLASSES = (
76 'stronghold.middleware.LoginRequiredMiddleware',
82 If you followed the installation instructions now all your views are
83 defaulting to require a login. To make a view public again you can use
84 the public decorator provided in ``stronghold.decorators`` like so:
86 For function based views
87 ~~~~~~~~~~~~~~~~~~~~~~~~
91 from stronghold.decorators import public
95 def someview(request):
99 for class based views (decorator)
100 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 from django.utils.decorators import method_decorator
105 from stronghold.decorators import public
108 class SomeView(View):
109 def get(self, request, *args, **kwargs):
113 @method_decorator(public)
114 def dispatch(self, *args, **kwargs):
115 return super(SomeView, self).dispatch(*args, **kwargs)
117 for class based views (mixin)
118 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122 from stronghold import StrongholdPublicMixin
124 class SomeView(StrongholdPublicMixin, View):
127 Configuration (optional)
128 ------------------------
133 Use Strongholds defaults in addition to your own settings.
138 9ffb2d5d61945b67061c60a39ec740a9670dda89d96b3c7ef890c1a1a08fd18a 7882 django-stronghold-0.3.0.tar.gz