Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not create django project which need sub folder structure. #343

Closed
vfyang opened this issue Jan 28, 2024 · 5 comments
Closed

can not create django project which need sub folder structure. #343

vfyang opened this issue Jan 28, 2024 · 5 comments

Comments

@vfyang
Copy link

vfyang commented Jan 28, 2024

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'

@Alphamasterliu
Copy link
Contributor

Alphamasterliu commented Feb 6, 2024

Hello! 😆
First off, thank you so much for taking the time to explore ChatDev. I wanted to share a bit about how --task "..." works in our system: It’s actually part of the Demand Analysis Phase in the ChatDev workflow, acting as a prompt for the subsequent Coding Phase. Based on what you've described, it sounds like your needs might fit better with some tweaks during the Documenting Phase towards the end of the process.

I also noticed you’re looking to create a website, which typically means working with HTML. If you're thinking about a specific folder structure, it might not align with traditional HTML presentations, and that's something we might need to think through together.

But, getting to the heart of your suggestion - the notion of defining file names, formats, and organizing folder structures is genuinely insightful for our product. We’re definitely taking note of this for potential enhancements. So, stay tuned for future updates, and again, thank you for your valuable feedback!

@Alphamasterliu
Copy link
Contributor

By the way, if you are interested in continuing to experiment, you can refer to part of the answer at #298. You can also join our Discord community to discuss in real time with other developers.

@vfyang
Copy link
Author

vfyang commented Feb 17, 2024 via email

@vfyang
Copy link
Author

vfyang commented Feb 17, 2024 via email

@vfyang
Copy link
Author

vfyang commented Feb 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants