1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-stronghold
7 SDESC[py37]= Django app requiring login for all views (PY37)
8 SDESC[py38]= Django app requiring login for all views (PY38)
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.2.tar.gz:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
24 DISTNAME= django-stronghold-0.3.2
28 [PY37].USES_ON= python:py37
30 [PY38].USES_ON= python:py38
32 [FILE:1986:descriptions/desc.single]
33 [![Build Status]](https://travis-ci.org/mgrouchy/django-stronghold)
37 Get inside your stronghold and make all your Django views default
40 Stronghold is a very small and easy to use django app that makes all your
41 Django project default to require login for all of your views.
43 WARNING: still in development, so some of the DEFAULTS and such will be
44 changing without notice.
51 pip install django-stronghold
54 Add stronghold to your INSTALLED_APPS in your Django settings file
64 Then add the stronghold middleware to your MIDDLEWARE_CLASSES in your
68 MIDDLEWARE_CLASSES = (
70 'stronghold.middleware.LoginRequiredMiddleware',
77 If you followed the installation instructions now all your views are
78 defaulting to require a login.
79 To make a view public again you can use the public decorator provided in
80 `stronghold.decorators` like so:
82 ### For function based views
85 from stronghold.decorators import public
88 def someview(request):
94 ### For class based views (decorator)
97 from django.utils.decorators import method_decorator
98 from stronghold.decorators import public
100 class SomeView(View):
101 def get(self, request, *args, **kwargs):
105 @method_decorator(public)
106 def dispatch(self, *args, **kwargs):
107 return super(SomeView, self).dispatch(*args, **kwargs)
110 ### For class based views (mixin)
113 from stronghold.views import StrongholdPublicMixin
115 class SomeView(StrongholdPublicMixin, View):
119 ## Configuration (optional)
121 ### STRONGHOLD_DEFAULTS
123 Use Strongholds defaults in addition to your own settings.
128 STRONGHOLD_DEFAULTS = True
131 You can add a tuple of url regexes in your settings file with the
132 `STRONGHOLD_PUBLIC_URLS` setting. Any url that matches against these
136 6abab3641369d9776629b974ba17af4f6a1b3144c268394aaf3a08cdc9e7d1e8 7086 django-stronghold-0.3.2.tar.gz