Git Product home page Git Product logo

wagtail-user-workspace's Introduction

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

  1. Install "wagtail-user-workspace" using pip

    $ pip install wagtail-user-workspace
    
  2. Add "wagtail_user_workspace" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...,
        "wagtail_user_workspace",
    ]
    
  3. 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 WorkspacePageBase also has to subclass wagtail.models.Page. Any other model that subclasses wagtail.models.Page can do as well.
    • Subclasses of WorkspacePageBase has to have exactly one page model defined in subpage_types. This also has to be a subclass of wagtail.models.Page.
  4. Configure workspace page model:

    USER_WORKSPACE_PAGE_MODEL = "your_app.UserWorkspacesRootPage"
    
  5. Make and apply database migrations with new changes:

    $ python manage.py makemigrations
    $ python manage.py migrate
    
  6. Now start your web, navigate to the Wagtail admin interface and create root page for user workspaces:

  7. 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 CustomWebPage alows 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

wagtail-user-workspace's People

Contributors

kunickyd avatar fzadrazil avatar

Stargazers

 avatar sawady1203 avatar

Watchers

 avatar

wagtail-user-workspace's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.