How can I install packages on my heroku app?

后端 未结 2 863
生来不讨喜
生来不讨喜 2021-01-16 21:49

I have an app that makes use of shortuuid (https://pypi.python.org/pypi/shortuuid/0.1) that is working fine locally when I run it with runapp.py:

import os

         


        
相关标签:
2条回答
  • 2021-01-16 22:07

    I usually create a requirements.txt file that contains the packages:

    Flask==0.9
    Jinja2==2.6
    Werkzeug==0.8.3
    distribute==0.6.27
    wsgiref==0.1.2
    
    Flask-Cache==0.10.0
    
    gunicorn==0.17.2
    

    You can create that file with pip:

    $ pip freeze > requirements.txt
    
    0 讨论(0)
  • 2021-01-16 22:16

    Place a requirements.txt in the root directory of your git repo, with your required dependencies (specified in pip/easy-install format).

    Example taken from the Heroku website:

    Flask==0.8
    Jinja2==2.6
    Werkzeug==0.8.3
    certifi==0.0.8
    chardet==1.0.1
    distribute==0.6.24
    gunicorn==0.14.2
    requests==0.11.1
    
    0 讨论(0)
提交回复
热议问题