How to keep all my django applications in specific folder

前端 未结 7 909
逝去的感伤
逝去的感伤 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:58

    You can do this very easily, but you need to change the settings.py to look like this:

    INSTALLED_APPS = (
        'apps.app1',
        'apps.app2',
        # ...
    )
    

    And your urls.py to look like this:

    urlpatterns = patterns('', 
        (r'^app1/',include('apps.app1')),    
        (r'^app2/',include('apps.app2')),    
    )
    

    .. and modify any imports to point to the app location

提交回复
热议问题