Moving django apps into subfolder and url.py error

后端 未结 4 976
梦谈多话
梦谈多话 2021-02-13 13:33

I have a question about putting django apps into \"apps\" subdirectory. I have the app called “faktura” in a project_root. I didn’t like the fact it lies there and I want to sto

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-13 14:31

    @Radu Gheorghiu's answer; It is not necessary to edit settings.py, and the insert path line can be condensed to 1 line of code.

    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "apps"))
    

    I sourced this answer from http://obroll.com/nested-application-inside-apps-sub-folder-in-django-1-3/

提交回复
热议问题