Where is my Django installation?

前端 未结 10 2038
小蘑菇
小蘑菇 2020-12-12 15:13

I use Django but I need to find the default templates and applications.

I don\'t know where it\'s installed.

How can I find that?

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 16:02

    As the comments on @olafure's answer https://stackoverflow.com/a/12974642/4515198 rightly say, the sys.path assignment is not required.

    The following will be enough:

    python -c "import django; print(django.__path__)"
    

    Here the -c option is used to tell python that a "program is being passed in as string" (source: command $ python --help on bash)

提交回复
热议问题