Skip to content

GaboGomezT/image-compressor

 
 

Repository files navigation

License

Welcome

Hello. Want to get started with Flask quickly? Good. You came to the right place. This Flask application framework is pre-configured with Flask-SQLAlchemy, Flask-WTF, Fabric, Coverage, and the Bootstrap frontend (among others). This will get your Flask app up and running on Heroku or PythonAnywhere quickly. Use this starter, boilerplate for all you new Flask projects. Cheers!

Preview the skeleton app here - http://www.flaskboilerplate.com/

Screenshots

Pages

Forms

Quick Start

  1. Clone the repo
$ git clone https://github.com/realpython/flask-boilerplate.git
$ cd flask-boilerplate
  1. Initialize and activate a virtualenv:
$ virtualenv --no-site-packages env
$ source env/bin/activate
  1. Install the dependencies:
$ pip install -r requirements.txt
  1. Run the development server:
$ python app.py
  1. Navigate to http://localhost:5000

Deploying to PythonAnywhere

  1. Install Git and Python - if you don't already have them, of course.

If you plan on working exclusively within PythonAnywhere, which you can, because it provides a cloud solution for hosting and developing your application, you can skip step one entirely. :)

  1. Sign up for PythonAnywhere, if you haven't already
  2. Once logged in, you should be on the Consoles tab.
  3. Clone this repo:
$ git clone git://github.com/realpython/flask-boilerplate.git
$ cd flask-boilerplate
  1. Create and activate a virtualenv:
$ virtualenv venv --no-site-packages
$ source venv/bin/activate
  1. Install requirements:
$ pip install -r requirements.txt
  1. Next, back on PythonAnywhere, click Web tab.
  2. Click the "Add a new web app" link on the left; by default this will create an app at your-username.pythonanywhere.com, though if you've signed up for a paid "Web Developer" account you can also specify your own domain name here. Once you've decided on the location of the app, click the "Next" button.
  3. On the next page, click the "Flask" option, and on the next page just keep the default settings and click "Next" again. Once the web app has been created (it'll take 20 seconds or so), you'll see a link near the top of the page, under the "Reload web app" button, saying "It is configured via a WSGI file stored at..." and a filename. Click this, and you get to a page with a text editor.
  4. Put the following lines of code at the start of the WSGI file (changing "your-username" appropriately)
activate_this = '/home/your-username/flask-boilerplate/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
  1. Then update the following lines of code:

from

project_home = u'/home/your-username/mysite'

to

project_home = u'/home/your-username/flask-boilerplate'

from

from flask_app import app as application

to

from app import app as application
  1. Save the file.
  2. Go to the website http://your-username.pythonanywhere.com/ (or your own domain if you specified a different one earlier), and you should see something like this - http://www.flaskboilerplate.com/.

Now you're ready to start developing!

Learn More

  1. Getting Started with Python on Heroku
  2. PythonAnywhere - Help
  3. Flask Documentation
  4. Flask Extensions
  5. Real Python :)

About

Web App for Compressing Image using Flask and Numpy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 82.2%
  • JavaScript 10.4%
  • Python 7.4%