Inforian
Inforian

Reputation: 1736

Package Your Python Django Application into a Reusable Component

I am trying to Package my Django application and for that I am following django official docs and I have successfully packaged my app But I have one problem with requirements of my app .

Since my app is using other packages too like requests etc. Now if any one install my package in their project , the package will be installed but its requirements not so surely it gives import error . Now I don't know that how to tell my package that installed its dependences too , I am sure I have to define these requirements somewhere but I don't know where ? OR I will follow the other path that place my requirement file in my package and tell users (from read me file) to install all dependencies from that file.

Also I have one more question , I am installing packages using this command python setup.py install , is there any other command from which I can install this package like easy_install or pip (My package is not in pypi can I still use pip if yes then how ?)

Upvotes: 0

Views: 91

Answers (1)

fasouto
fasouto

Reputation: 4511

In the setup.py file you can list your requirements under install_requires, see an example:

    install_requires=[
        'Pillow>=2.0',
        'django-appconf>=0.6',
    ],

About your second question, yes, you can install a package not published in PyPI using pip, check this guide

Upvotes: 3

Related Questions