Ravenports generated: 04 Feb 2018 11:38
[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::
36 https://travis-ci.org/mgrouchy/django-stronghold.png?branch=master
37    :alt: travis
38
39 Stronghold
40 ==========
41
42 Get inside your stronghold and make all your Django views default
43 login\_required
44
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.
47
48 WARNING: still in development, so some of the DEFAULTS and such will be
49 changing without notice.
50
51 Installation
52 ------------
53
54 Install via pip.
55
56 .. code:: sh
57
58     pip install django-stronghold
59
60 Add stronghold to your INSTALLED\_APPS in your Django settings file
61
62 .. code:: python
63
64
65     INSTALLED_APPS = (
66         #...
67         'stronghold',
68     )
69
70 Then add the stronghold middleware to your MIDDLEWARE\_CLASSES in your
71 Django settings file
72
73 .. code:: python
74
75     MIDDLEWARE_CLASSES = (
76         #...
77         'stronghold.middleware.LoginRequiredMiddleware',
78     )
79
80 Usage
81 -----
82
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:
86
87 For function based views
88 ~~~~~~~~~~~~~~~~~~~~~~~~
89
90 .. code:: python
91
92     from stronghold.decorators import public
93
94
95     @public
96     def someview(request):
97         # do some work
98         #...
99
100 for class based views (decorator)
101 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102
103 .. code:: python
104
105     from django.utils.decorators import method_decorator
106     from stronghold.decorators import public
107
108
109     class SomeView(View):
110         def get(self, request, *args, **kwargs):
111             # some view logic
112             #...
113
114         @method_decorator(public)
115         def dispatch(self, *args, **kwargs):
116             return super(SomeView, self).dispatch(*args, **kwargs)
117
118 for class based views (mixin)
119 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
121 .. code:: python
122
123     from stronghold import StrongholdPublicMixin
124
125     class SomeView(StrongholdPublicMixin, View):
126         pass
127
128 Configuration (optional)
129 ------------------------
130
131 STRONGHOLD\_DEFAULTS
132 ~~~~~~~~~~~~~~~~~~~~
133
134 Use Strongholds defaults in addition to your own settings.
135
136
137
138 [FILE:109:distinfo]
139 9ffb2d5d61945b67061c60a39ec740a9670dda89d96b3c7ef890c1a1a08fd18a         7882 django-stronghold-0.3.0.tar.gz
140