Giter VIP home page Giter VIP logo

webdevproject1's Introduction

Flask App (User app)

What is this?

This application includes a User model that is compatible with Flask Login. We've also included a migration script which depends on Flask Migrate

This is a
Flask app that can be deployed to Heroku.

It is based on flask_heroku

It follows the structure from the Flask megatutorial

Prerequisites

It is assumed that you've installed the heroku toolbelt

Instructions

Clone the repo.

git clone [email protected]:info3180/demo_user_app.git
cd flask_app

To clear the git history, remove the .git/ folder

rm -rf .git/

For your convenience, the project ships with a virtualenv script which means you can quickly create a virtual environment using the following commands

python virtualenv.py --no-site-packages venv
source venv/bin/activate

Installing Packages

pip

Then, let's get the requirements installed in your isolated test environment.

$ pip install -r requirements.txt

Running Your Application

Activate your virtualenv

source venv/bin/activate

Now, you can run the application locally.

python run.py

Deploying

If you haven't signed up for Heroku, go ahead and do that. You should then be able to add your SSH key to Heroku, and also heroku login from the commandline.

Now, to upload your application, you'll first need to do the following -- and obviously change app_name to the name of your application:

heroku create app_name -s cedar

And, then you can push your application up to Heroku.

git push heroku master
heroku scale web=1

Finally, we can make sure the application is up and running.

heroku ps

Now, we can view the application in our web browser.

heroku open

And, to deactivate virtualenv (once you've finished coding), you simply run the following command:

deactivate

Next Steps

After you've got your application up and running, there a couple next steps you should consider following.

  1. Create a new README.md file.
  2. Add your Google Analytics ID to the base.html template.
  3. Adjust the author and description <meta> tags in the base.html template.
  4. Change the humans.txt and favicon.ico files in the static directory.
  5. Change the apple-touch icons in the static directory.

Reactivating the Virtual Environment

If you haven't worked with virtualenv before, you'll need to reactivate the environment everytime you close or reload your terminal.

$ source venv/bin/activate

If you don't reactivate the environment, then you'll probably receive a screen full of errors when trying to run the application locally.

Adding Requirements

In the course of creating your application, you may find yourself installing various Python modules with pip -- in which case you'll need to update the requirements.txt file. One way that this can be done is with pip freeze.

$ pip freeze > requirements.txt

Custom Domains

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

webdevproject1's People

Contributors

maschad avatar pigeonflight avatar

Watchers

James Cloos avatar  avatar  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.