ChatDev icon indicating copy to clipboard operation
ChatDev copied to clipboard

can not create django project which need sub folder structure.

Open vfyang opened this issue 1 year ago • 5 comments

It seems the code complete for command: python run.py --task "Develop a Django-based website for managing checklists with an integrated user and task management system. Each task should include: Title, Description, Priority Level,Assignment, Ending Date. Utilize Bootstrap and Vue.js. blue color theme. make sure all the django folder structure are setup correctly, and the main entrance python file should be manage.py instead of main.py" --name "Task_django_sub" --model "GPT_4_32K"

The code completed, but not able to run.
By looking at result files, django project need to have structures:

  1. Make sure your folder structure looks something like this:
myproject/
    manage.py
    myproject/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py
    myapp/
        migrations/
            __init__.py
        static/
        templates/
        admin.py
        apps.py
        models.py
        tests.py
        views.py

bu all the result files are files are in same folder, not with sub-folder structure, ChatChainConfig.json PhaseConfig.json RoleConfig.json Task_django_sub.prompt Task_django_sub_DefaultOrganization_20240128233517.log base_generic.html custom.css main.py manual.md meta.txt models.py task_list.html urls.py views.py

while the code still using django code that requires subfolder in main.pyr: """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'checklist_project.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv) if name == 'main': main()

Also, the entry file is main.py insread of manage.py.

Error code when running... File "/Users/vincentyang/anaconda3/envs/chatdev/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 992, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'checklist_project'

vfyang avatar Jan 28 '24 16:01 vfyang