Created
November 15, 2009 17:25
-
-
Save greut/235338 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[app:main] | |
use = egg:app | |
[server:main] | |
use = egg:Spawning | |
host = 127.0.0.1 | |
port = 8000 | |
num_processes = 1 | |
threadpool_workers = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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