https://github.com/xansaul/django-tools
Command-Line Interface to create APIs quickly in Django
https://github.com/xansaul/django-tools
cli django django-rest-framework rest-api rust
Last synced: about 2 months ago
JSON representation
Command-Line Interface to create APIs quickly in Django
- Host: GitHub
- URL: https://github.com/xansaul/django-tools
- Owner: xansaul
- License: mit
- Created: 2024-04-27T22:20:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T19:42:03.000Z (about 2 years ago)
- Last Synced: 2025-07-20T08:33:32.795Z (12 months ago)
- Topics: cli, django, django-rest-framework, rest-api, rust
- Language: Rust
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Tools CLI
Django Tools CLI is a command-line interface (CLI) tool written in Rust 🦀 to quickly create APIs in Django. It provides commands to generate different components of a Django project, such as ViewSet, ApiView, and new projects.
## Requirements
- Windows or Linux
- For Linux, `sh` (shell) environment is required.
- Python 3 or later
- Rust 🦀 (Optional: Required only if you want to compile or modify the project)
## Installation
1. **Download binaries**: You can download pre-built binaries for your operating system from the [releases section](https://github.com/xansaul/django-tools/releases) of the Django Tools CLI GitHub repository.
2. **Build from source (Alternative)**: If you prefer, you can build the project from the source code. Clone the repository and navigate to the project directory. Then, follow these steps:
- **Windows**:
- Take the generated `.exe` file, for example, `django-tools.exe`, and place it in a directory of your choice. For instance, you can place it in `C:\Program Files`.
- Copy the entire directory path where the `.exe` file is located.
- Add the copied directory path to the system's environment variables. To do this:
- Search for "Environment Variables" in the Windows search bar and open the system's environment variables settings.
- In the System Properties window, click on the "Environment Variables" button.
- Under "System variables", find the "Path" variable, select it, and click on "Edit".
- Click on "New" and paste the directory path where the `.exe` file is located.
- Click "OK" on all windows to save the changes.
- **Linux**:
- Take the generated binary file (executable), typically located at `target/release/django-tools` after building the project.
- Move or copy the binary file to `/usr/local/bin` directory using the following command:
```
sudo cp target/release/django-tools /usr/local/bin/
```
- You might need to use `sudo` to have the necessary permissions to copy the file.
## Usage
You can utilize Django Tools CLI with the following commands:
### Creating a new project:
To initiate a new Django project, use the following command:
```bash
django-tools Project -n backend
```
This command will create a new Django project named "backend".
### Creating a ViewSet app:
To generate a ViewSet app within your Django project, use the following command:
```bash
django-tools ViewSet -n ducks
```
This command will generate a ViewSets app named "ducks" within your Django project.
### Creating an ApiView app:
To generate an ApiView app within your Django project, use the following command:
```bash
django-tools ApiView -n dogs
```
This command will create an ApiView app named "dogs" within your Django project.
