This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

fireflask

I’ve long wanted to use FirePython for debugging Flask web apps, but could never seem to get it working right.

After a long time away, I circled back to it, and with help from the Flask folks, got it working smoothly.

Indeed, it was so simple to do, knowing the right invocation and configuration, that I can only blame myself for not getting it earlier. My only consolation is that there is no real documentation (the usage link on FireLogger’s home page is a dead link).

So, having figured it out, I’m sharing in the hopes that others can now simply use this beautiful tool.

Basic Idea

The code is sufficiently simple I can put the core of it here:

from flask import Flask
from logging import DEBUG
from firepython.middleware import FirePythonWSGI, logging

app = Flask('appname')
app.wsgi_app = FirePythonWSGI(app.wsgi_app)
logging.getLogger().setLevel(DEBUG)

That’s it. Now you’re off to the races. When the app server is run, any logging messages you direct to the logging object end up in your FireBug / FireLogger console. More complete versions of this demo code can be found in trivial.py and demo_primitive.py in the repository.

FireFlask

To make things even simpler, the fireflask module requires just two lines of code (one to import fireflask, and one to put it into operation).

from flask import Flask
from fireflask import *

app = Flask('appname')
FireFlask(app)

@app.route('/')
def hello_world():

    logging.info('serving hello_world content')
    return 'Hello World!'

app.run()

Here we’ve completed the program with a function that provides content, and the startup code for the Flask web server. fireflask isn’t a huge lines-of-code savings, but it will save you a few steps and make the program cleaner.

Notes

  • This has been tested under Python 2.7. No promises are made for other versions of Python.
  • The author, Jonathan Eunice or @jeunice on Twitter welcomes your comments and suggestions.

Installation

To install or upgrade to the latest version of fireflask:

pip install -U fireflask

This will install the firepython module automatically. Or, if you want to use just the primitive approach:

pip install -U firepython

(You may need to prefix these with sudo to authorize installation.)

Use the standard Firefox tools to install FireBug and the FireLogger extension.

Use

To run the demonstration programs, run trivial.py, demo_primitive.py or demo.py.

Browse to 127.0.0.1:5000 in Firefox, with the FireBug extension turned on, and the Logger pane visible. This is the FireBug icon:

When FireBug is operational, it’s displayed in color, not grayed out. If you browse to the page before FireBug is turned on, you’ll need to reload the page to see the logged messages.

Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fireflask-0.2.0-py2.py3-none-any.whl (6.0 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Aug 17, 2015
fireflask-0.2.0.tar.gz (3.6 kB) Copy SHA256 Checksum SHA256 Source Aug 17, 2015
fireflask-0.2.0.zip (8.7 kB) Copy SHA256 Checksum SHA256 Source Aug 17, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting