This release is a pre-release and may not be stable for production use.
Wagtail User Workspace
This app creates personal workspace page for every user on registration.
Users are able to publish new child pages under their workspace page. This includes minimal needed permissions to do so. Namely access to Wagtail admin and add, edit and publish permissions to their own workspace page.
Structure and type of these pages is highly customisable.
Quick start
-
Install "wagtail-user-workspace" using pip
$ pip install wagtail-user-workspace -
Add "wagtail_user_workspace" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ..., "wagtail_user_workspace", ] -
Define model for root page that will contain all of the user workspace pages:
from wagtail.models import Page from wagtail_user_workspace.models import WorkspacePageBase # This page will be used as a root for each users workspace class CustomWebPage(Page): ... # This page serves as a root page for all the workspace pages # Type of these pages is determined by page model defined in subpage_types class UserWorkspacesRootPage(WorkspacePageBase, Page): ... subpage_types = [ 'your_app.CustomWebPage', ] ...Valid workspaces root page rules:
- Page models that subclass
WorkspacePageBasealso has to subclasswagtail.models.Page. Any other model that subclasseswagtail.models.Pagecan do as well. - Subclasses of
WorkspacePageBasehas to have exactly one page model defined insubpage_types. This also has to be a subclass ofwagtail.models.Page.
- Page models that subclass
-
Configure workspace page model:
USER_WORKSPACE_PAGE_MODEL = "your_app.UserWorkspacesRootPage" -
Make and apply database migrations with new changes:
$ python manage.py makemigrations $ python manage.py migrate -
Now start your web, navigate to the Wagtail admin interface and create root page for user workspaces:
-
After some user signs in, new workspace page will be generated for him. User has a full controll over this page. He can edit, publish, and even delete it. If defenition of
CustomWebPagealows it, he can even add subpages.
Development
To develop this app locally you can just clone this repo. Then run local server by running
$ python manage.py runserver
or when using VSCode just hit F5 or another Run key. VSCode will use settings from launch.json
Then you can start developing this app!
Testing
You can run tests like that:
$ python manage.py test
Metadata
Release files for wagtail-user-workspace 0.1.0.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wagtail-user-workspace-0.1.0.dev0.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wagtail_user_workspace-0.1.0.dev0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / wagtail-user-workspace-0.1.0.dev0.tar.gz
| Download URL | wagtail-user-workspace-0.1.0.dev0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bf1ec6d09bef31f2d3e53cc7f99d5c773fd4ded6da605329f747c681c188e12
|
|
BLAKE2b-256 checksum How to use checksums |
b6f752448d9267e0b0c15ebd2b82edc94c60b53b302c20ea6a8eb95221220b2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / wagtail_user_workspace-0.1.0.dev0-py3-none-any.whl
| Download URL | wagtail_user_workspace-0.1.0.dev0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
605e72f0999ce208ed46ff6f4a63202675989fe835b88a32bdcdc176553cd35b
|
|
BLAKE2b-256 checksum How to use checksums |
9628ea62b3a088139dbd9a3427f7f96acff88509e6b0b1e8726816e023b3fcee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|