Error accessing a route endpoint with same name in 2 processes
Therere 2 different scripts each running on its own process:
www.py is what is running on http://superhost.gr
and test.py is what is running on http://superhost.gr/test
Here is what it contains.
I somehow beleive that the following apache conf directives somehow create problem.
The only way i can run this is the aforementioned.
IF instead i try to access the endpoint like the following:
i receive:
Sorry, the requested URL 'http://superhost.gr/mailform' caused an error:
You will see if you create a route endpoint called '/mailform' within '/' which is an alias of 'www.py' and you also have '/mailform' in 'superhost.gr/test' when the latter tries to post data to '/mailform' instead of sending them to 'superhost.gr/test/' it sends them to '/' which is 'superhost.gr'
Therere 2 different scripts each running on its own process:
www.py is what is running on http://superhost.gr
and test.py is what is running on http://superhost.gr/test
Here is what it contains.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from bottle import Bottle, route, run, debug application = Bottle() app = application debug( True ) @app .route( '/mailform' , method = [ 'POST' ]) def mailform(): return 'Hello from mailform' @app .route( '/' ) def index(): return '''\ <form method="post" action="{}"> <input value="Mail" type="submit" /> </form>''' . format ( app.get_url( ' / mailform' ) ) |
1 2 3 4 5 |
WSGIDaemonProcess test user = nikos group = nikos home = / home / nikos / wsgi WSGIScriptAlias / test / home / nikos / wsgi / test.py process - group = test application - group = % {GLOBAL} WSGIDaemonProcess www user = nikos group = nikos home = / home / nikos / wsgi WSGIScriptAliasMatch / / home / nikos / wsgi / www.py process - group = www application - group = % {GLOBAL} |
IF instead i try to access the endpoint like the following:
1 2 3 4 5 6 |
@app .route( '/' ) def index(): return '''\ <form method="post" action="/mailform"> <input value="Mail" type="submit" /> </form>''' |
Sorry, the requested URL 'http://superhost.gr/mailform' caused an error:
Quote:Internal Server ErrorI somehow beleive that the following apache conf directives somehow create problem.
Exception:
TypeError("argument of type 'NoneType' is not iterable",)
Traceback:
Traceback (most recent call last):
File "/home/nikos/wsgi/bottle.py", line 996, in _handle
out = route.call(**args)
File "/home/nikos/wsgi/bottle.py", line 2007, in wrapper
rv = callback(*a, **ka)
File "/home/nikos/wsgi/www.py", line 189, in mailform
if provider in FROM:
TypeError: argument of type 'NoneType' is not iterable
You will see if you create a route endpoint called '/mailform' within '/' which is an alias of 'www.py' and you also have '/mailform' in 'superhost.gr/test' when the latter tries to post data to '/mailform' instead of sending them to 'superhost.gr/test/' it sends them to '/' which is 'superhost.gr'