1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-stronghold
7 SDESC[py35]= Django app requiring login for all views (PY 35)
8 SDESC[py36]= Django app requiring login for all views (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]
36 https://travis-ci.org/mgrouchy/django-stronghold.png?branch=master
42 Get inside your stronghold and make all your Django views default
45 Stronghold is a very small and easy to use django app that makes all
46 your Django project default to require login for all of your views.
48 WARNING: still in development, so some of the DEFAULTS and such will be
49 changing without notice.
58 pip install django-stronghold
60 Add stronghold to your INSTALLED\_APPS in your Django settings file
70 Then add the stronghold middleware to your MIDDLEWARE\_CLASSES in your
75 MIDDLEWARE_CLASSES = (
77 'stronghold.middleware.LoginRequiredMiddleware',
83 If you followed the installation instructions now all your views are
84 defaulting to require a login. To make a view public again you can use
85 the public decorator provided in ``stronghold.decorators`` like so:
87 For function based views
88 ~~~~~~~~~~~~~~~~~~~~~~~~
92 from stronghold.decorators import public
96 def someview(request):
100 for class based views (decorator)
101 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105 from django.utils.decorators import method_decorator
106 from stronghold.decorators import public
109 class SomeView(View):
110 def get(self, request, *args, **kwargs):
114 @method_decorator(public)
115 def dispatch(self, *args, **kwargs):
116 return super(SomeView, self).dispatch(*args, **kwargs)
118 for class based views (mixin)
119 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123 from stronghold import StrongholdPublicMixin
125 class SomeView(StrongholdPublicMixin, View):
128 Configuration (optional)
129 ------------------------
134 Use Strongholds defaults in addition to your own settings.
139 9ffb2d5d61945b67061c60a39ec740a9670dda89d96b3c7ef890c1a1a08fd18a 7882 django-stronghold-0.3.0.tar.gz