plain.admin 0.22.1__py3-none-any.whl → 0.23.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plain/admin/README.md CHANGED
@@ -15,7 +15,47 @@ in addition to models.
15
15
  ## Installation
16
16
 
17
17
  - install plain.admin and plain.htmx, add plain.admin.admin and plain.htmx to installed packages
18
- - add url
18
+
19
+ Add the `AdminRouter` to your `urls.py`.
20
+
21
+ ```python
22
+ # app/urls.py
23
+ from plain.admin.urls import AdminRouter
24
+ from plain.urls import Router, include, path
25
+
26
+ from . import views
27
+
28
+
29
+ class AppRouter(Router):
30
+ namespace = ""
31
+ urls = [
32
+ include("admin/", AdminRouter),
33
+ path("login/", views.LoginView, name="login"),
34
+ path("logout/", LogoutView, name="logout"),
35
+ # Your other urls here...
36
+ ]
37
+
38
+ ```
39
+
40
+ Optionally, add the admin toolbar to your base template.
41
+
42
+ ```html
43
+ <!-- app/templates/base.html -->
44
+ <!DOCTYPE html>
45
+ <html lang="en">
46
+ <head>
47
+ <meta charset="UTF-8">
48
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
49
+ <title>{{ html_title|default("My App") }}</title>
50
+ {% tailwind_css %}
51
+ </head>
52
+ <body>
53
+ {% block content required %}{% endblock %}
54
+
55
+ {% toolbar %}
56
+ </body>
57
+ </html>
58
+ ```
19
59
 
20
60
  ## Models in the admin
21
61
 
plain/admin/config.py CHANGED
@@ -6,7 +6,7 @@ from plain.packages import PackageConfig, packages_registry, register_config
6
6
 
7
7
  @register_config
8
8
  class Config(PackageConfig):
9
- label = "plainadmin"
9
+ package_label = "plainadmin"
10
10
 
11
11
  def ready(self):
12
12
  def _import_if_exists(module_name):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.admin
3
- Version: 0.22.1
3
+ Version: 0.23.0
4
4
  Summary: Admin dashboard and tools for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -30,7 +30,47 @@ in addition to models.
30
30
  ## Installation
31
31
 
32
32
  - install plain.admin and plain.htmx, add plain.admin.admin and plain.htmx to installed packages
33
- - add url
33
+
34
+ Add the `AdminRouter` to your `urls.py`.
35
+
36
+ ```python
37
+ # app/urls.py
38
+ from plain.admin.urls import AdminRouter
39
+ from plain.urls import Router, include, path
40
+
41
+ from . import views
42
+
43
+
44
+ class AppRouter(Router):
45
+ namespace = ""
46
+ urls = [
47
+ include("admin/", AdminRouter),
48
+ path("login/", views.LoginView, name="login"),
49
+ path("logout/", LogoutView, name="logout"),
50
+ # Your other urls here...
51
+ ]
52
+
53
+ ```
54
+
55
+ Optionally, add the admin toolbar to your base template.
56
+
57
+ ```html
58
+ <!-- app/templates/base.html -->
59
+ <!DOCTYPE html>
60
+ <html lang="en">
61
+ <head>
62
+ <meta charset="UTF-8">
63
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
64
+ <title>{{ html_title|default("My App") }}</title>
65
+ {% tailwind_css %}
66
+ </head>
67
+ <body>
68
+ {% block content required %}{% endblock %}
69
+
70
+ {% toolbar %}
71
+ </body>
72
+ </html>
73
+ ```
34
74
 
35
75
  ## Models in the admin
36
76
 
@@ -1,6 +1,6 @@
1
- plain/admin/README.md,sha256=GB0gTgSeMDt6jbQ9oH58xJNBJMP3iSPiVdF6KyX7vjQ,6390
1
+ plain/admin/README.md,sha256=tdzHNyl6-dllbkEniCg0iw9PkcqkqvdiPiKuGs8ogEQ,7225
2
2
  plain/admin/__init__.py,sha256=bPv9iftT8aLqBH6dDy-HTVXW66dQUhfIiEZ-LIUMC0Y,78
3
- plain/admin/config.py,sha256=FpuOFmMin5WM1jxxM8-cFLCzgcaWHU6_UaD3k0euLhc,668
3
+ plain/admin/config.py,sha256=TDYmJe4UYmKw4bz0x5s9PkDa-X4V-9JoJlka162-J7M,676
4
4
  plain/admin/dates.py,sha256=EEhcQhHt3-k6kE9yvPdH5X6EecmUQ259xywbDBec3Dg,10253
5
5
  plain/admin/default_settings.py,sha256=j7RdgGqksCmCgPO7zCcFiVV9f8yW-EULvqDcFOhQap8,127
6
6
  plain/admin/middleware.py,sha256=k3yP1o3CzvLiZZSoxqq-DvAZlp4sICRauaT-kD3FJKM,398
@@ -76,7 +76,7 @@ plain/admin/views/objects.py,sha256=Wcw7_k4BDz4h49e4BGtq6g-3jo5-T0fJU9CfMcvMQK4,
76
76
  plain/admin/views/registry.py,sha256=Lxib4YSQCMHb_zACnLKymJakV8jCZPWYll7J8-aV9Xw,3712
77
77
  plain/admin/views/types.py,sha256=ONMMdUoapgMoUVYgSIe-4YCdfvaVMQ4jgPWYiMo0pDk,178
78
78
  plain/admin/views/viewsets.py,sha256=dqMlQ6kLn9iqd9BwBWAZT1S271wH1FdfM5HXbOgBMEw,1655
79
- plain_admin-0.22.1.dist-info/METADATA,sha256=OAsH8LlM_w0hE43s9cssSh4MoJvoUGPHU8GK-izJDjU,6827
80
- plain_admin-0.22.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
81
- plain_admin-0.22.1.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
82
- plain_admin-0.22.1.dist-info/RECORD,,
79
+ plain_admin-0.23.0.dist-info/METADATA,sha256=X-l_n3uxqdrg_kFn8ycJdfXUkMST-GZl7HBLqMRhs8k,7662
80
+ plain_admin-0.23.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
81
+ plain_admin-0.23.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
82
+ plain_admin-0.23.0.dist-info/RECORD,,