from mmmpaste import app

app.run(debug = True)

import os

from mmmpaste import app

PORT = int(os.environ['PORT']) if 'PORT' in os.environ else 5000

app.run(debug = True, port = PORT)

Allow the port to overridden by and environment variable.