1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-stronghold
7 SDESC[py36]= Django app requiring login for all views (PY 36)
8 SDESC[py37]= Django app requiring login for all views (PY 37)
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= PY36 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py36]= PY36=ON PY37=OFF
22 VOPTS[py37]= PY36=OFF PY37=ON
24 DISTNAME= django-stronghold-0.3.0
28 [PY36].USES_ON= python:py36
30 [PY37].USES_ON= python:py37
32 [FILE:2121:descriptions/desc.single]
34 https://travis-ci.org/mgrouchy/django-stronghold.png?branch=master
40 Get inside your stronghold and make all your Django views default
43 Stronghold is a very small and easy to use django app that makes all
44 your Django project default to require login for all of your views.
46 WARNING: still in development, so some of the DEFAULTS and such will be
47 changing without notice.
56 pip install django-stronghold
58 Add stronghold to your INSTALLED\_APPS in your Django settings file
68 Then add the stronghold middleware to your MIDDLEWARE\_CLASSES in your
73 MIDDLEWARE_CLASSES = (
75 'stronghold.middleware.LoginRequiredMiddleware',
81 If you followed the installation instructions now all your views are
82 defaulting to require a login. To make a view public again you can use
83 the public decorator provided in ``stronghold.decorators`` like so:
85 For function based views
86 ~~~~~~~~~~~~~~~~~~~~~~~~
90 from stronghold.decorators import public
94 def someview(request):
98 for class based views (decorator)
99 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103 from django.utils.decorators import method_decorator
104 from stronghold.decorators import public
107 class SomeView(View):
108 def get(self, request, *args, **kwargs):
112 @method_decorator(public)
113 def dispatch(self, *args, **kwargs):
114 return super(SomeView, self).dispatch(*args, **kwargs)
116 for class based views (mixin)
117 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121 from stronghold import StrongholdPublicMixin
123 class SomeView(StrongholdPublicMixin, View):
126 Configuration (optional)
127 ------------------------
132 Use Strongholds defaults in addition to your own settings.
137 9ffb2d5d61945b67061c60a39ec740a9670dda89d96b3c7ef890c1a1a08fd18a 7882 django-stronghold-0.3.0.tar.gz