Coder Social home page Coder Social logo

fauzaanu / assisted-django Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 11.18 MB

Generate an entire django app with models, forms, views, urls, signals, tests and templates using gpt3 or 4

Home Page: https://t.me/fauzaanu

License: MIT License

Python 100.00%
code-generation django openai

assisted-django's Introduction

Tip

Time is undefeated. No matter what you do, it will outlast you, outsmart you, and paralyze you—if you allow it to.

You can’t control it. But you can control its hold on you… by controlling your focus on the end result.

From Winning - The Unforgiving race to greatness

assisted-django's People

Contributors

fauzaanu avatar

Watchers

 avatar  avatar  avatar

assisted-django's Issues

Fix Diagram

diagram is no longer accurate:

  • tests
  • templates
  • signals

missing . . .

Better examples

  • Update examples with better code
  • make a collection of examples
  • randomize the example picked from the collection
  • different code could introduce randomness in the response when re-run again

Better Brief

rate the brief against some rules such as database design and relationships being clear or not and re-generate the brief if the details are not enough.

Bad briefs == comments left by gpt3 with instructions that are not commented despite the example response provided

Serializers

Create Serializes based on models

Feed Serializes while creating URLs, so API routes are also created additionally.

Appdir templates

templates currently are not namespaced with the appdir

  • add instruction to name them with appname

html templates cleanup

html templates needs to be clean from andhtml and the text in between

Regex to detect > text ``` perheps.

Adjust Project settings and URLs

Add an optional flag that updates the INSTALLED_APPS and URLs patterns to include the new apps pattern

Instead of modifying the existing stuff, we should add a += to the variable at the EOF

Better templates

  1. Creation of a base.html which comes in built already.

    1. Bootstrap4
    2. tailwindcss

While using tailwindcss simply use the cdn as developer can later handle the rest.

  1. Provide example responses for templates so that the explanation is minimal or doesn't come

admin.py becoming views.py

sometimes admin.py still generates a views.py.

Solutions:

  • Improve the prompt
  • use regex to detect HTML templates mentioned and run again?
  • running again is extra cost for the user, so display this as a message

signals

Generate signals for models.

Access to models.py file contents

switch to tailwindcss

tailwindcss code generators are pretty good already, we could see a lot better and diverse ui if we switch to TW from BS

base html template

inject a base html template with bootstrap headers. Mention that base.html exists into the template prompts.

Some calls to OpenAI could be async

Initially, since every file depends on other files, this was not possible. But we now have some files that depend on just the model's content.

In this case, when models content is ready, we should fire all requests depending on that.

This will speed up the whole process.

Attempt to Change to a command line tool with arguments

Its not convenient to use the script, copy locations and so on.

The command line script could do a lot.

  • Scan the Django app directories and let the user pick a directory rather than us copying and pasting
  • using flags manage if the brief additionally needs improvement
  • Perhaps someone doesn't need signals or another component
  • make it a package, so things become easier.

ability to update just one file

each step is dependent on the contents from some other steps.

if the models are already written we can give option to exclude that file or to include only models file based on the rest.

some constrains to making this happen:

some of the generations depend on two files being present, for example Models and Views need to be present generate somefiles. in this case should prompt user to make sure they are filled

Wagtail app generations

Wagtail has even less code to write in the general way things are set. Adding wagtail as a mode cant be that hard.. I think. 🤔

Need to include a wagtail example for models.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.