DjangoWiz: A simple and powerful toolkit to automate the generation of serializers, viewsets, URLs, and Docker configurations for your Django projects.
Project description
DjangoWiz
DjangoWiz is a simple and powerful toolkit to automate the generation of serializers, viewsets, URLs, and Docker configurations for your Django projects. This toolkit helps you quickly scaffold out necessary files based on your models, saving you time and effort.
Features
- Automatically generates serializers, viewsets, and URLs based on your Django models.
- Supports generation of Dockerfile and Docker Compose configurations for development and production environments.
- Skips non-serializable classes and abstract models.
- Includes customizable templates using Jinja2.
- Provides flexible commands to generate different components individually or all together.
Installation
-
Install via pip:
pip install DjangoWiz
-
Alternatively, clone the repository:
git clone https://github.com/yourusername/DjangoWiz.git cd DjangoWiz
-
Install dependencies: Ensure you have Python and Poetry installed, then run:
poetry install
Usage
Generate All Files
Generate serializers, viewsets, routes, URLs, Dockerfile, and Docker Compose configurations:
djangowiz generate-files <your_app> <your_project> <path/to/models.py> --overwrite
Generate Core Files Only
Generate serializers, viewsets, and routes without Docker-related files:
djangowiz generate_core_files <your_app> <your_project> <path/to/models.py> --overwrite
Generate Individual Components
Generate Serializers
djangowiz generate_serializers <your_app> <your_project> <path/to/models.py> --overwrite
Generate Viewsets
djangowiz generate_viewsets <your_app> <your_project> <path/to/models.py> --overwrite
Generate URLs
djangowiz generate_urls <your_app> <your_project> <path/to/models.py> --overwrite
Generate Routes
djangowiz generate_routes <your_app> <your_project> <path/to/models.py> --overwrite
Directory Structure
Ensure your project directory is structured as follows:
DjangoWiz/
├── DjangoWiz/
│ ├── __init__.py
│ ├── generate.py
│ ├── templates/
│ ├── docker-compose.dev.yml.j2
│ ├── docker-compose.prod.yml.j2
│ ├── Dockerfile.j2
│ ├── env.dev.j2
│ ├── env.prod.j2
│ ├── serializer.py.j2
│ ├── viewset.py.j2
│ ├── urls.py.j2
│ ├── routes.py.j2
├── pyproject.toml
├── README.md
├── LICENSE
Customizing Templates
The templates used for generating files are located in the DjangoWiz/templates
directory. You can customize these templates to fit your project's specific requirements. The templates use Jinja2 for rendering.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
Author
Ali Tavallaie - a.tavallaie@gmail.com
Happy coding!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for djangowiz-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 717499e9fdcc619566b800679fae21139cb89adf3120965ed222b31c18fb62bd |
|
MD5 | 3bd6e286e5cb9e820210a5e900a355bb |
|
BLAKE2b-256 | f0ac375ba22bb468da2c26f01d96a69c18f7538917fb6d1479b9590b198f3c2b |