Generate an entire django app with models, forms, views, urls, signals, tests and templates using gpt3 or 4
Project description
Assisted Django
Given a proper project brief, and the location of the Django App, this script will automatically update the models.py
, views.py
, urls.py
, admin.py
, tests.py
, forms.py
, signals.py
files, and generate corresponding HTML
templates for your Django application.
This script does not do anything to the Project Directory, it only updates the content in a Django App Directory.
This script is very opinionated at how it does things. This is not a fully automated solution, but I think it could significantly reduce the time it takes to create a Django App.
Spend a good amount of time planning the project in the brief, and the script will basically write the models, views, urls, admin, tests and forms for you. (You will still likely need to make changes)
How this works in a diagram
Example Video
https://github.com/fauzaanu/assisted-django/assets/86226565/6c5d9b8a-68c8-4883-a65d-c08c41fbb913
Your workflow to use this properly
- Install Django:
pip install django
- Create a Django Project:
django-admin createproject Project
- Navigate to the Project Directory:
cd Project
- Create a New App:
python manage.py startapp appname
- Create a README.md or a textfile: This file should contain a brief description of the project and its purpose. Try to highlight the database design in this file, and features.
- Create a .env file: This file should contain the
OPENAI_API_KEY
- If the project is rather complex, overide the default model from gpt-3 to gpt-4. (Or write better briefs?)
Example of how to run this:
from AssistedDjango.DjangoApplication import DjangoApplication
def enhance_django_app():
app_name = "django_app_name_here" # replace with your actual Django app name
app_directory = "Basic/manual_checklist" # replace with your actual Django app directory
# basic is the Project Directory
# manual_checklist is the Django App Directory
# This script does not do anything to the Project Directory
with open("checklist", "r") as f: # replace with your actual project brief
purpose = f.read()
django_app = DjangoApplication(app_name, purpose, app_directory)
django_app.generate()
if __name__ == '__main__':
enhance_django_app()
This repo already has django in the requirements.txt file, so you can just clone this repo and test within the repo directory.
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 assisted_django-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5c3f646d72bb8b622207a0f022bd81a28794b1ec1b7a1ed35e99fffbf901fa3 |
|
MD5 | 3d1a2c5ce385026079b6494f01e40f8a |
|
BLAKE2b-256 | 1189147f50181e4b34dcd915067c59a4d212dccb17b9ae80b0342296cf8b4ccf |