Where is my Django installation?

前端 未结 10 2004
小蘑菇
小蘑菇 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:06

    in the CLI you can do this:

    >>> import django
    >>> django
    <module 'django' from '/usr/local/lib/python2.6/dist-packages/django/__init__.pyc'>
    
    0 讨论(0)
  • 2020-12-12 16:06

    Worth mentioning that if you are using a virtual env all the packages will be in your project's root venv folder under "lib" ...

    0 讨论(0)
  • 2020-12-12 16:07

    Try this on an terminal.

    $ python -v
    import django # directory /home/user/.virtualenvs/myenv/local/lib/python2.7/site-packages/django
    # some other imports.
    
    0 讨论(0)
  • 2020-12-12 16:13
    $ python
    >>> import django
    >>> django.__file__
    '/usr/local/lib/python2.7/site-packages/django/__init__.pyc'
    
    0 讨论(0)
提交回复
热议问题