Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@greut
Created November 15, 2009 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greut/235338 to your computer and use it in GitHub Desktop.
Save greut/235338 to your computer and use it in GitHub Desktop.
[app:main]
use = egg:app
[server:main]
use = egg:Spawning
host = 127.0.0.1
port = 8000
num_processes = 1
threadpool_workers = 1
def application(environ, start_response):
start_response("200 OK", [("Content-Type", "text/html")])
return ["<h1>Hello World!</h1>",
"<p>this is a test.</p>"]
def make_app(global_conf, **app_conf):
return application
from __future__ import with_statement
from fabric.api import env, run, put, local, cd
env.hosts = ['localhost']
env.path = '~/www/app'
def build_egg():
local('python setup.py bdist_egg')
def cleanup():
local('rm -rf build')
local('rm -rf dist')
def start():
with cd(env.path):
run('PYTHONPATH=app.egg paster serve app.ini --daemon --pid-file=app.pid')
def stop():
with cd(env.path):
run('paster serve --stop-daemon --pid-file=app.pid')
def deploy():
build_egg()
put('app.ini', env.path)
put('dist/*.egg', env.path+"/app.egg")
cleanup()
from setuptools import setup, find_packages
setup(name='app',
version='0.1',
description='example application',
long_description='',
keywords='',
author='Yoan Blanc',
author_email='yoan@dosimple.ch',
url='http://yoan.dosimple.ch/blog/',
license='All rights reserved',
packages=find_packages(),
zip_safe=False,
install_requires=[],
entry_points={'paste.app_factory': ['main=app:make_app']},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment