https://github.com/py-package/masonite-modules
Modularize your masonite project.
https://github.com/py-package/masonite-modules
Last synced: 2 months ago
JSON representation
Modularize your masonite project.
- Host: GitHub
- URL: https://github.com/py-package/masonite-modules
- Owner: py-package
- License: mit
- Created: 2022-06-16T21:23:40.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T07:39:25.000Z (over 1 year ago)
- Last Synced: 2025-04-23T14:14:43.812Z (2 months ago)
- Language: Python
- Size: 125 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Masonite Modules
![]()
## Introduction
Modularize your masonite project.
## Installation
```bash
pip install masonite-modules
```## Configuration
Add ModuleProvider to your project in `config/providers.py`:
```python
# config/providers.py
# ...
from masonite_modules import ModuleProvider# ...
PROVIDERS = [
# ...
# Third Party Providers
ModuleProvider,
# ...
]
```Publish the package resources by doing:
```bash
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.
```python
NAME=modules
```## Installation
Once you finish publishing package, you need to install the modules by doing:
```bash
$ python craft module:install
```Finally, you will see the modules directory created in your project root.
## Usage
To create the module, simply run:
```bash
$ python craft module:create# 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 `/` i.e. `/blogs` then you will see a welcome message.
> Enjoy!
## License
masonite_modules is open-sourced software licensed under the [MIT license](LICENSE).