当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Defining models in a top level Django directory

问题描述:

I've noticed that in order for me to define models, I need to do something like:

python manage.py startapp app_name

Is there anyway to avoid this convention and be able to create a models.py directly in the top level site that django-admin.py has created for me? Sometimes I'm building a site that can be put together in literally 15 minutes thanks to Django. I don't see the need for complexity of having an additional app built and a modified settings.py just for a form model or something similar.

网友答案:

Not really. The django admin programs expect app/models.py file names.

分享给朋友:
您可能感兴趣的文章:
随机阅读: