How to keep all my django applications in specific folder

前端 未结 7 896
逝去的感伤
逝去的感伤 2020-12-12 16:59

I have a Django project, let\'s say \"project1\". Typical folder structure for applications is:

/project1/
         /app1/
         /app2/
         ...
             


        
7条回答
  •  失恋的感觉
    2020-12-12 17:39

    Just add __init__.py (4 underscores in total) in your apps folder. Now you can just do

    urlpatterns = [
            path('polls/',include('apps.polls.urls')),
            path('admin/', admin.site.urls)
    ]
    

提交回复
热议问题