How do I create sub-applications in Django?

后端 未结 5 900
后悔当初
后悔当初 2020-12-08 02:17

I\'m a Django newbie, but fairly experienced at programming. I have a set of related applications that I\'d like to group into a sub-application but can not figure out how t

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 02:24

    According to Django documentation,

    If the optional destination is provided, Django will use that existing directory rather than creating a new one. You can use ‘.’ to denote the current working directory.

    For example:

    django-admin startapp myapp /Users/jezdez/Code/myapp

    So, you can do it by this method:

    1. Create sub_app1 directory in app directory
    2. python manage.py startapp sub_app1 app/sub_app1

提交回复
热议问题