Hello all,
I would like to embed the great Bottle web framework into a small application (1st target is Windows OS). This app starts the bottle webserver thanks to the subprocess module.
import subprocess
p = subprocess.Popen('python websrv.py')
The bottle app is quite simple
@route("/")
def index():
return template('index')
ru...
I've been having difficulty getting anything more than a simple index / to return correctly using bottle.py in a CGI environment. When I try to return /hello I get a 404 response. However, if I request /index.py/hello
import bottle
from bottle import route
@route('/')
def index():
return 'Index'
@route('/hello')
def hello():
...
Bottle can use several webservers:
Build-in HTTP development server and support for paste, fapws3, flup, cherrypy or any other WSGI capable server.
I am using bottle for a desktop-app and I guess that the development server is enough in this case.
I would like to know if some of you have experience with one of the alternative serv...
I've noticed three main ways Python web frameworks deal request handing: decorators, controller classes with methods for individual requests, and request classes with methods for GET/POST.
I'm curious about the virtues of these three approaches. Are there major advantages or disadvantages to any of these approaches? To fix ideas, her...
When I run bottle development server, I notice some warning showing up.
Can any one figure it out what exactly is the problem?
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.6/dist-packages/bottle-0.8.1-p...
How can I send an email to admin when a 500 error occurs, in python.
The web framework I'm using is 'bottle'.
...
I am using the Bottle framework. I have set the @error decorator so I am able to display my customized error page, and i can also send email if any 500 error occurs, but I need the complete traceback to be sent in the email. Does anyone know how to have the framework include that in the e-mail?
...
I am sending a tuple as my variable to javascript. But i could not find a way. I am using bottle framework.
...
After fighting with different things here and there, I was finally able to get BottlePY running on Apache and run a MongoDB powered site. I am used to running Django apps, so I will be relating to that a bit in my question.
The Problem
Every time a page is loaded via BottlePY, the connection to the MongoDB database located on MongoHQ.c...
If some one come to my url suppose /get it should give back a xml/application format in response in bottle framework. How can i do this? i am using elementree as xml generator.
...
How do I go about returning json data from a bottle request handler. I see a dict2json method in the bottle src but I am not sure how to use it.
What is in the documentation:
@route('/spam')
def spam():
return {'status':'online', 'servertime':time.time()}
Gives me this when I bring up the page:
<html>
<head></head>
<bod...
I was hoping that putting 'sys.exit(1)' and catching it later like this will work.
xml_open()
try:
run(reloader=True, host='localhost', port=8080)
except SystemExit:
xml_save()
print "Exited ..."
Is there any other solution to exit these python micro-frameworks to exit from inside
the handlers ?
...
Hi,
I need to get data from JSON, transfered by ajax from client. Basically I used something like this:
@route('/ajax')
def serve_ajax():
return main.parse_request(json.dumps(dict(request.GET)))
Where main.parse_request is a function, that contains some logics to deal with variables in JSON (it is a main procedure of our game engi...