Skip to main content

Modularize your masonite project

Project description

Masonite Modules

Masonite Package GitHub Workflow Status (branch) PyPI Python Version GitHub release (latest by date including pre-releases) License Code style: black

Introduction

Modularize your masonite project.

Installation

pip install masonite-modules

Configuration

Add ModuleProvider to your project in config/providers.py:

# config/providers.py
# ...
from masonite_modules import ModuleProvider

# ...
PROVIDERS = [
    # ...
    # Third Party Providers
    ModuleProvider,
    # ...
]

Publish the package resources by doing:

python craft package:publish modules

The default modules location will be modules in the root directory of your project. But if you want your own custom name then, update the module name in config/modules.py to your desired module path name.

NAME=modules

Installation

Once you finish publishing package, you need to install the modules by doing:

$ python craft module:install

Finally, you will see the modules directory created in your project root.

Usage

To create the module, simply run:

$ python craft module:create <module_name>

# Example
$ python craft module:create blog

The above command will create a new module called blogs in the modules directory. It will also create all the necessary files and directories inside blogs so you can start working on your module.

Finally, visit /<module_name> i.e. /blogs then you will see a welcome message.

Enjoy!

License

masonite_modules is open-sourced software licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

masonite-modules-0.0.5.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

masonite_modules-0.0.5-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page