Andriy Kornatskyy avatar Andriy Kornatskyy committed a5f62d0

Added hello world for pysi.

Comments (0)

Files changed (4)

01-welcome/Makefile

-.SILENT: clean env pypy django flask pyramid web.py bottle wheezy.web tornado web2py bobo cherrypy wsgi circuits turbogears
-.PHONY: clean env pypy django flask pyramid web.py bottle wheezy.web tornado web2py bobo cherrypy wsgi circuits turbogears
+.SILENT: clean env pypy django flask pyramid web.py bottle wheezy.web tornado web2py bobo cherrypy wsgi circuits turbogearsi pysi
+.PHONY: clean env pypy django flask pyramid web.py bottle wheezy.web tornado web2py bobo cherrypy wsgi circuits turbogears pysi
 
 VERSION=2.7
 PYPI=http://pypi.python.org/simple
 			"uwsgi>=1.2.6" "gunicorn>=0.14.6" "django>=1.4.1" "flask>=0.9" \
 			"pyramid>=1.4a2" "web.py>=0.37" "bottle>=0.10.11" \
 			"wheezy.web>=0.1.304" "tornado>=2.4" "bobo>=1.0.0" \
-			"cherrypy>=3.2.2" "circuits>=1.6" ; \
+			"cherrypy>=3.2.2" "pysi>=0.13.0" "circuits>=1.6"; \
 	else \
 		cd $(ENV)/bin && ./easy_install-$(VERSION) -i $(PYPI) \
 				"distribute>=0.6.28" \
 		"gunicorn>=0.14.6" "flask>=0.9" \
 		"pyramid>=1.4a2" "web.py>=0.37" "bottle>=0.10.11" \
 		"wheezy.web>=0.1.304" "tornado>=2.4" "bobo>=1.0.0" \
-		"cherrypy>=3.2.2" "circuits>=1.6"
+		"cherrypy>=3.2.2" "pysi>=0.13.0" "circuits>=1.6"
 
 
 clean:
 else
 	$(ENV)/bin/gunicorn_paster -b 0.0.0.0:8080 -w 4 `pwd`/turbogears/helloworld/development.ini
 endif
+
+pysi:
+ifeq ($(SERVER),uwsgi)
+	$(ENV)/bin/uwsgi --ini pysi/uwsgi.ini
+else
+	export PYTHONPATH=$$PYTHONPATH:pysi ; \
+	$(ENV)/bin/gunicorn -b 0.0.0.0:8080 -w 4 app:main
+endif

01-welcome/benchmark.py

 }
 
 frameworks = ['bottle', 'pyramid', 'wheezy.web', 'wsgi']
-frameworks += ['circuits', 'django', 'flask']
+frameworks += ['circuits', 'django', 'flask', 'pysi']
 frameworks += ['bobo', 'cherrypy', 'tornado']
 frameworks += ['turbogears', 'web.py', 'web2py']
 frameworks = sorted(frameworks)

01-welcome/pysi/app.py

+import pysi
+
+
+@pysi.view('/welcome')
+def welcome(rq):
+    return 'Hello World!'
+
+main = pysi.App()

01-welcome/pysi/uwsgi.ini

+
+[uwsgi]
+chdir = pysi
+virtualenv = ../env
+pythonpath = .
+wsgi = app:main
+procname-prefix = MyPysi-
+
+http-socket = 0.0.0.0:8080
+listen = 1024
+uid = www-data
+gid = www-data
+harakiri = 10
+optimize = 2
+master = True
+processes = 4
+disable-logging = True
+#logto = /dev/null
+no-default-app = False
+auto-procname = True
+limit-as = 90
+buffer-size = 2048
+post-buffering = 1024
+limit-post = 1024
+thread-stacksize = 64
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.