flask_vote_app
flask_vote_app copied to clipboard
Conor McGregor vs. Floyd Mayweather Flask App
Your First Python Web App: Conor McGregor vs. Floyd Mayweather Flask Voting App + Heroku
Here are your instructions
-
download the latest version of python from https://www.python.org/downloads/ and then install it. Also, make sure to check the ADD TO PATH box when going through the installation wizard.
-
Create an account on Heroku.com
-
MAC USERS ONLY: Install
homebrewif you don't have it already withsudo /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
MAC USERS ONLY: Open up your terminal with cmd + space then type in
terminaland then Install the heroku CLI client withbrew install herokuand press enter in the terminal -
WINDOWS USERS ONLY: To install Heroku CLI Client on windows just go to
https://devcenter.heroku.com/articles/heroku-cli#windowsand click the64-bitor32-bitlink to download and install -
WINDOWS USERS ONLY: Open your command line by hitting the windows key and typing in
cmdorpowershell. -
Type in
gitin your command line either on mac or windows and see if you get an error. If you do get an error, go online and type ininstall git. Then getgiteither for windows or mac by clicking one of the search results that pop up. -
At this point, Git and Heroku should be working!
-
Now in your terminal or command prompt, enter the command
git clone https://github.com/CleverProgrammer/flask_vote_app -
Now navigate to the project folder using
cd flask_vote_app -
Enter the command:
heroku loginand provide your heroku login details. Note: When you type in password the cursor in the command line doesn't move. Don't freak out lol just type in your password for Heroku anyway. -
Now after you are logged in, use
heroku createto create a new heroku application for you. -
push the code to heroku using
git push heroku master -
Now make your own database where the votes will be stored with
heroku addons:create heroku-postgresql -
Now launch the web app online:
heroku ps:scale web=1 -
Here is a little tricky and advanced part but don't worry so much about understanding it yet... Then in your terminal, you’ll need to run migrations for your db schema, to do this simply type
heroku run bashon your terminal -
Once the terminal loads enter the command
python init_db.py -
Now press
ctrl + dto exit out of the heroku bash thing. -
BOOOOOOM! Your site is now on Heroku. Type in
heroku opento go check it out online woohoo!!