Django - include app urls

前端 未结 5 1693
余生分开走
余生分开走 2021-02-20 01:48

I have the following structure (Django 1.4):

containing_dir/
    myproject/
        myapp1/
        myapp2/
        myapp3/

myproject, myapp1,

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 02:26

    You must have a

    __init__.py
    

    file inside your "myproject" directory. When you say:

    (r'^myapp1/', include('myproject.myapp1.urls'))
    

    you are saying "myproject" (as well as myapp1) is a python packege.

提交回复
热议问题