Addition of Heroku custom buildpack has no effect - python

I am trying to make graphviz usable on Heroku, Python by adding repo from here https://github.com/mfenniak/heroku-buildpack-python-graphviz
heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-python.git
But when I push:
git push heroku master
Fetching repository, done.
Everything up-to-date
It looks like I did nothing at all. Am I doing it wrong?

This is failing because you haven't yet pushed new code -- if you add a new buildpack, you must push NEW code to your Heroku app in order for the new buildpack to be triggered.
To 'get around' this, just add a readme to your project, or change some whitespace -- then make a commit and push to Heroku.

Related

Heroku cannot detect the buildpack to use for this application automatically. error when trying to deploy/push files to heroku - any fixes?

I have a Python trading bot which I want to run in cloud with the help of Heroku. The Python code works just fine, but when I try to push the files after add and commit, I am getting error which says heroku cannot detect the buildpack and heroku pre-receive hook declined
I tried to fix it, but nothing seems to work. But then I tried to deploy not by pushing it from my computer, but by uploading it to GitHub and connecting my GitHub account to Heroku account.
Connecting both accounts went well, but I get this error when I tried to deploy the files:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
! No default language could be detected for this app.
HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
See https://devcenter.heroku.com/articles/buildpacks
! Push failed
The error seems pretty straight forward and directs us to visit a website. I did try some of the stuff mentioned in the website, but maybe I am doing it wrong.
Till now what I understand is Heroku is not able to detect the language I am using which is Python. How can I fix this?
I think there is a pretty simple solution if you have the access to the Heroku account used to deploy this app.
Direct to the app page and go under the Settings tab, you should be able to find a Buildpacks section where you can add your buildpack if not detected automatically during deployment.
Click Add Buildpack and choose Python as your custom buildpack. Problem should be solved.
P.S. If you don't have requirements.txt in your folder, consider adding all the packages along with their versions used for your Python Flask app to this file. For example:
Flask==2.0.2
Flask-Admin==1.5.8
Flask-Bcrypt==0.7.1
Flask-DebugToolbar==0.11.0
Flask-SQLAlchemy==2.5.1
Flask-WTF==1.0.0

Django Heroku how to go back to development server to make more changes

So I just deployed my Django app to Heroku, and everything is working fine. The current version of the app isn't perfect, so I want to edit it, but my current process is:
1. **make changes in files
2. git status (just to make sure changes are seen)
3. git add -A
4. git commit -m "message"
5. git push heroku master
How can I get back the whole python manage.py runserver development part so I can be more thorough with my changes, and only commit when I know the changes meet my expectations?
Since I'm new to Python/HTML/CSS, I'm always coding then testing to see what my code does, and it would involve a lot of git commit / git push currently. Any help is appreciated!
deploying to Heroku should not stop you from using python manage.py runserver. Just make sure that you have loaded up your virtual environment (if you are using one) and it should just work.

Updating heroku django deployed site with new commits to github repo

Say I have deployed a django website on heroku through a github repository. (For deployment I simply clicked on the deploy button here - https://github.com/AmmsA/theresumator#theresumator---using-django-resumator.) I now update the repository with new commits.
Q: How can I make changes in the deployed website from the repository without losing the data already present on the repository.
When you are pushing the fresh commits git push heroku master or via git hook git push origin master -- these nothing to do with heroku database.
But this will run this command when build python manage.py migrate so if you are changed something in the migrations definetly db schema get alter not the values stored in there.
Just set your remote project:
heroku git:remote -a
And then, push your project on Heroku:
git push heroku main
I've written an article on it. You can see that. https://medium.com/#sreebash/how-to-update-previous-deployed-project-on-heroku-c778d555cd8a

Deploying with python 3 on Heroku

I'm trying to deploy to heroku and using python 3. However the heroku build pack defaults to python 2.7.
The build pack read me mentions that a runtime.txt file can be added to change the default runtime.
I'm not clear on the instructions but I've added a runtime.txt file to the root of my project folder with
python-3.4.3
in it. After this if I do:
heroku create
then:
git push heroku master
This doesn't work and still commences the build python 2.7.
Note I do get a custom build pack detected notification.
The information you gave is vague, but if you're following the steps exactly as you say, then you're forgetting to git add and git commit before pushing to heroku.

Openshift: How to and the Drawbacks of a Hot Deployment

I work with Openshift and in specific with Python. I have done many projects in there and I think the most irretating thing is that when you deploy your application, the server is down and you cannot even show a custom message.
I was socked after months when I searched in Google that there is an option to Hot Deploy an application. To git push it without the server get down. I am not a computer scientist, so I cannot understand if this technique has any drawbacks on my application.
Also, until now, when I wanted to update my application, I was doing:
git add .
git commit -a -m 'mycommit'
git push
I read on the manual that I have to enable the Hot Deployment with creating a file on the directory:
C:\app_directory> copy NUL > .openshift\markers\hot_deploy
But after that, how will I (hot) deploy the changes in my server?
Thank you
Once you have added the hot_deploy marker to your git repository, you need to follow the same git add, git commit, git push procedure, the only difference will be that your site will not shut down while it is being deployed. The new code will be deployed and everything should work as expected.
You need to add the marker file to your Git to make the change through to the the server.
git add .openshift/markers/hot_deploy
git commit -m "Changing application to hot deploy"
After this your subsequent commits (using the git add/commit/push combination) will not restart your server.
Alternatively you can use the following rhc commands to enable and disable auto-deployment.
rhc app-configure <app> auto-deploy
rhc app-configure <app> no-auto-deploy

Categories