• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Python, Virtual env, Pushing App to Heroku and additional files on github ?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I wanted to ask you for your help since I am a little bit confused with what I did :P

I pushed my app to Heroku following tutorial, I did some notes, everything is working, I solved some problems and I am happy

But there are things that I don't fully understand. That is, I get the concept, but I cannot grasp it fully.

1. Virtual environment, I understand what it is, I get that we create it to not break anything in our "language files".

In this tutorial I created venv and then copied into venv my working app, I modified it for heroku and then pushed it will all the venv files (I used git add . ) and I understand that I pushed all my venv files into heroku. My question is, was that neccesary ? Heroku wouldn't work if I didn't create venv ?

2. I want to push my app also to git hub. I have separate folder "before heroku" and without venv (since I didn't use it when I was writing that app). And my plan was that I will copy necessary files (without venv files) and paste it into my original folder and then push it to github to make everything clean and nice.

Can I do it ? Or maybe I am missing point or something ?

Thanks and Cheers
 
Ranch Hand
Posts: 44
1
Python VI Editor Postgres Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike,

First, since I have not worked with Heroku, I do not know what it needs to work or not work.  Congratulations for getting the application to work in that environment.

1. Virtual environment, I understand what it is, I get that we create it to not break anything in our "language files".



In Python, the general practice for non-trivial projects is to create the virtual environment first, then start building the application.  That way any libraries needed for the application are installed in the virtual environment and won't interfere with any other project.  A source control tool -- such as git -- is often invoked at the beginning as well.

2. I want to push my app also to git hub.



Github accepts whatever is pushed from the local git repository.  (If there are exceptions, I am not aware of them.)  Using git in the local repository is a great tool to help going from messy to nice.  When the project is ready for production (generally in the master branch), push it up to Github.

Both the "before Heroku" folder and the "with Heroku" folder can be pushed to Github.  If there are files and folders that should not go to Github, add a file called ".gitignore" and add those items to it.  (Details and format of the .gitignore file are on Github.)

Although doing this is fairly straightforward, many of the higher-end Python IDE's can make all this relatively painless.

HTH,
Travis
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic