AutoCreateApp - Django Project Automation
AutoCreateApp is a Python package that automates the process of creating Django projects with multiple apps and models based on user input. With this tool, you can quickly set up Django projects without manually creating apps, models, and migration files.
Installation
You can install AutoCreateApp via pip:
pip install autocreateapp
Usage
Once AutoCreateApp is installed, you can use the autocreateapp command to create your Django project interactively.
autocreateapp
Follow the prompts to provide the project name, the number of apps to create, app names, model names, and model fields. The package will automatically generate the necessary files and set up the Django project with your specified apps and models.
How It Works
AutoCreateApp uses Python's built-in os module to create and navigate directories, and it utilizes Django's command-line tools (django-admin and manage.py) to create projects, apps, and migration files.
The add_app_to_installed_apps function ensures that the newly created apps are added to the INSTALLED_APPS list in the Django project's settings.py file.
The package also supports interactive model creation, allowing you to specify model names and their respective fields, such as strings (CharField) or integers (IntegerField).
Example
Here's a simple example of how to use AutoCreateApp:
# Create a new Django project with two apps and models
autocreateapp
Enter the name of your Django project: myproject
How many apps do you want to create? 2
Enter the name of your app: app1
Enter the name of your app: app2
Enter the name of your first model in app1: MyModel
Enter model fields (comma-separated, e.g., name:str, age:int): name:str, age:int
Enter the name of your first model in app2: AnotherModel
Enter model fields (comma-separated, e.g., title:str, description:str): title:str, description:str
After the above steps, you'll have a new Django project called myproject, with two apps (app1 and app2), each containing one model (MyModel and AnotherModel) with the specified fields.
License
AutoCreateApp is distributed under the MIT License. See the LICENSE file for more information.
Contributions
Contributions are welcome! If you have any suggestions, bug reports, or improvements, please open an issue or submit a pull request.
Happy coding! 🚀
Metadata
Release files for autocreateapp 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autocreateapp-0.4.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autocreateapp-0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / autocreateapp-0.4.tar.gz
| Download URL | autocreateapp-0.4.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
365becc906260fe1e548677932b6f0e88f3bcc5323fffbb57c0cd518564150ac
|
|
BLAKE2b-256 checksum How to use checksums |
12c840861f7ce72194aa108cbb907656e2b394edd8e24671afbac55ce5d5f771
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / autocreateapp-0.4-py3-none-any.whl
| Download URL | autocreateapp-0.4-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e5a96a435755f53a307e14fa87aa639b9aad93313dbc7ed838bfa934a6a1003a
|
|
BLAKE2b-256 checksum How to use checksums |
8b7b99125e33b0a0fb2e41ef25f35a7c9a83a450150b7167d91845417b9ab654
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|