Ravenports generated: 02 Feb 2018 09:28
[ravenports.git] / bucket_5B / python-django-stronghold
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-django-stronghold
4 VERSION=                0.3.0
5 KEYWORDS=               python
6 VARIANTS=               py35 py36
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]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPI/d/django-stronghold
14 DISTFILE[1]=            django-stronghold-0.3.0.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[py35]=            single
17 SPKGS[py36]=            single
18
19 OPTIONS_AVAILABLE=      PY35 PY36
20 OPTIONS_STANDARD=       none
21 VOPTS[py35]=            PY35=ON PY36=OFF
22 VOPTS[py36]=            PY35=OFF PY36=ON
23
24 DISTNAME=               django-stronghold-0.3.0
25
26 LICENSE_SCHEME=         solo
27
28 GENERATED=              yes
29
30 [PY35].USES_ON=                         python:py35
31
32 [PY36].USES_ON=                         python:py36
33
34 [FILE:2121:descriptions/desc.single]
35 .. figure:: https://travis-ci.org/mgrouchy/django-stronghold.png?branch=master
36    :alt: travis
37
38 Stronghold
39 ==========
40
41 Get inside your stronghold and make all your Django views default
42 login\_required
43
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.
46
47 WARNING: still in development, so some of the DEFAULTS and such will be
48 changing without notice.
49
50 Installation
51 ------------
52
53 Install via pip.
54
55 .. code:: sh
56
57     pip install django-stronghold
58
59 Add stronghold to your INSTALLED\_APPS in your Django settings file
60
61 .. code:: python
62
63
64     INSTALLED_APPS = (
65         #...
66         'stronghold',
67     )
68
69 Then add the stronghold middleware to your MIDDLEWARE\_CLASSES in your
70 Django settings file
71
72 .. code:: python
73
74     MIDDLEWARE_CLASSES = (
75         #...
76         'stronghold.middleware.LoginRequiredMiddleware',
77     )
78
79 Usage
80 -----
81
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:
85
86 For function based views
87 ~~~~~~~~~~~~~~~~~~~~~~~~
88
89 .. code:: python
90
91     from stronghold.decorators import public
92
93
94     @public
95     def someview(request):
96         # do some work
97         #...
98
99 for class based views (decorator)
100 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
102 .. code:: python
103
104     from django.utils.decorators import method_decorator
105     from stronghold.decorators import public
106
107
108     class SomeView(View):
109         def get(self, request, *args, **kwargs):
110             # some view logic
111             #...
112
113         @method_decorator(public)
114         def dispatch(self, *args, **kwargs):
115             return super(SomeView, self).dispatch(*args, **kwargs)
116
117 for class based views (mixin)
118 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119
120 .. code:: python
121
122     from stronghold import StrongholdPublicMixin
123
124     class SomeView(StrongholdPublicMixin, View):
125         pass
126
127 Configuration (optional)
128 ------------------------
129
130 STRONGHOLD\_DEFAULTS
131 ~~~~~~~~~~~~~~~~~~~~
132
133 Use Strongholds defaults in addition to your own settings.
134
135
136
137 [FILE:109:distinfo]
138 9ffb2d5d61945b67061c60a39ec740a9670dda89d96b3c7ef890c1a1a08fd18a         7882 django-stronghold-0.3.0.tar.gz
139