in Education by
I'm trying to implement Deploy to Heroku functionality for my Python application: https://github.com/jet-admin/jet-bridge/tree/heroku It woks OK if just use requirements.txt to install dependencies, but it require me to modify my requirements.txt to include some extra packages that i normally don't need (psycopg2, mysqlclient). Is it possible not to include all requirements in requirements.txt, but install it with some extra command? I've tried adding postdeploy script which will perform pip install command, but after deploy succed my application says that psycopg2 is not installed (thought i installed it in postdeploy command). JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The Heroku Python buildpack has a hook where you can execute extra commands after the initial slug compilation. To use it, you can add a bin/post_compile file, putting inside the shell commands for installing the extra packages. You can even make it depend on an environment variable, like: # assuming you have files mysql-requirements.txt and postgres-requirements.txt if [ "$JET_BRIDGE_DB" == "mysql" ]; then echo "Installing Python dependencies for MySQL support" pip install -r mysql-requirements.txt else echo "Assuming Postgres database, installing Python dependencies" pip install -r postgres-requirements.txt fi Read more: Buildpacks: https://devcenter.heroku.com/articles/buildpacks Heroku Python Buildpack: https://github.com/heroku/heroku-buildpack-python Slug compilation: https://devcenter.heroku.com/articles/slug-compiler

Related questions

0 votes
    I'm new to Python and I want to install some packages with pip. But pip install unroll gives me: Command " ... How to solve this? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I am trying to create a simple node.js app on heroku. Here is app.js: console.log("Starting App" ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I tried to follow this tutorial. This is what I did in the console: pip3 install --user --upgrade awscli after ... 's the problem here? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I tried this: pip3 install --user --upgrade awscli pip3 --version I'm getting: pip 9.0.1 from /downloads/ ... not found. Please help. Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    Here is the problem I have a requirements.txt that looks like: BeautifulSoup==3.2.0 Django==1.3 Fabric==1.2.0 ... . So what went wrong? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I read that pip is a replacement for easy_install, Can anyone tell me, How can I install pip using ... another better option? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    How to upgrade all python packages in one go using pip? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    When I run pip3 install -r requirements.txt on the project I get this error message: pip._vendor.pkg_resources. ... on my machine. Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    What does pip stand for python? a) Pip Installs Python b) Pip Installs Packages c) Preferred Installer Program d) All of the mentioned...
asked Dec 31, 2022 in Technology by JackTerrance
0 votes
    UPDATED Can't connect to a postgres database. The dependency of postgres is added via maven. Maven ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    Heroku only has 100MB of file storage, right? I'm making a low-level rails app and I really like ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I am using Eclipse with Pydev and googleAppengine. I have python 2.7 installed. I am trying to run ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Using pip, is it possible to figure out which version of a package is currently installed? I know about pip ... am currently using. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I want to install MySQL_python adapter (v1.2.2) using a new virtual env I created with a - -no-site-packages ... How can I do it? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
...