django shared library/classes

后端 未结 4 1371
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-08 08:21

Am new to django and was looking for advice where to place my shared library. Am planning on creating classes that I want to use across all my apps within the project. Where wou

4条回答
  •  甜味超标
    2021-02-08 08:55

    If the shared library is going to be used in others projects as well you can make a installer using distutils. But if it's only for the apps in the project you can take AntonioP's answer.

    Remember that the root of your project (folder that contains manage.py) is always in your PYTHON_PATH when you run your django project, so you can create a folder deps or dependencies or extra or anything you like it that contains your shared libraries.

提交回复
热议问题