Coder Social home page Coder Social logo

iamjuniorpeter / heroku-python-script Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaelkryukov/heroku-python-script

0.0 1.0 0.0 52 KB

Example of how to host your script (bot ot something like that) on heroku.

License: GNU General Public License v3.0

Python 100.00%

heroku-python-script's Introduction

Template for Python Script hosted on Heroku

This is small example of running your own bots with Heroku. You can run ANY python script with ANY dependaries.

Getting Started

  1. Download this repository.

  2. Register on Heroku.

  3. Download and install Heroku CLI.

  4. Download and install git.

  5. Copy your script/ project to repository's folder.

  6. Replace "script.py" with path to your main executable file in "Procfile".

    worker: python script.py
    

    If you are getting errors, you can try replace worker with web.

  7. You may select your python version and runtime with "runtime.txt". Read how on official heroku page.

  8. If you are using non-standart modules, you must add them to requirements.txt

    To check which version of module you have on your computer, run pip freeze | grep MODULE_NAME in the terminal.

    You will get line MODULE_NAME==MODULE_VERSION. Add this line to "requirements.txt".

    You should remove any unused modules from "requirements.txt".

    Repeat this process for all the modules you are planning to use.

  9. Now open terminal(or do it other way, but i will explain how to do it in terminal on Ubuntu) and create git repository.

    git init
    

    Create heroku app.

    heroku create
    

    And push your code into heroku app.

    git add .
    git commit -m "initial commit"
    git push heroku master
    
  10. Run you worker with following command.

heroku ps:scale worker=1
  1. Now everything should be working. You can check your logs with.
heroku logs --tail
  1. You can open the URL where the script is deployed using the below command (if you are deploying site).
heroku open
  1. From now on you can use usual git commands(push, add, commit etc.) to update your app. Everytime you push heroku master your app gets redeployed.

Prerequisites

Authors

License

This project is licensed under GNU General Public License v3.0 - see the LICENCE.md file for details

Acknowledgments

heroku-python-script's People

Contributors

michaelkryukov avatar archanaprabhu avatar

Watchers

Junior Peter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.