A sample user login system with Flask and deployed on Heroku
Install pip
, virtualenv
, virtualenvwrapper
, foreman
, heroku client
, libevent
(for gevent
web server.)
$ sudo easy_install pip
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper
$ sudo gem install foreman heroku
$ brew install libevent
- Clone the repo
git clone git@github.com:alyssaq/flask-user-login.git
- Install requirements
pip install -r requirements.txt
You can run the Flask application locally with python:
$ python app.py
Or, use foreman:
$ foreman start
You can also specify what port you'd prefer to use.
$ foreman start -p 5555
Create an account at Herokuand add your SSH key to Heroku.
Now, login, create your application and push to Heroku:
$ heroku login
$ heroku create app_name -s cedar
$ git push heroku master
$ heroku scale web=1
Verify that the application is up and running:
$ heroku ps
View the application in our web browser:
$ heroku open
If your account is verified -- and your credit card is on file -- you can also easily add a custom domain to your application.
$ heroku addons:add custom_domains
$ heroku domains:add www.mydomainname.com
You can add a naked domain name, too.
$ heroku domains:add mydomainname.com
Lastly, add the following A records to your DNS management tool.
75.101.163.44
75.101.145.87
174.129.212.2