Python Forum
How to POST html data to be handled by a route endpoint
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to POST html data to be handled by a route endpoint
Error accessing a route endpoint with same name in 2 processes
Therere 2 different scripts each running on its own process: is what is running on

and is what is running on

Here is what it contains.
from bottle import Bottle, route, run, debug

application = Bottle()
app = application

@app.route('/mailform', method=['POST'])
def mailform():
	return 'Hello from mailform'

def index():
	return '''\
	<form method="post" action="{}">
	<input value="Mail" type="submit" />
	</form>'''.format( app.get_url( '/mailform' ) )
I somehow beleive that the following apache conf directives somehow create problem.
WSGIDaemonProcess test user=nikos group=nikos home=/home/nikos/wsgi
WSGIScriptAlias /test /home/nikos/wsgi/ process-group=test application-group=%{GLOBAL}

WSGIDaemonProcess www user=nikos group=nikos home=/home/nikos/wsgi
WSGIScriptAliasMatch / /home/nikos/wsgi/ process-group=www application-group=%{GLOBAL}
The only way i can run this is the aforementioned.

IF instead i try to access the endpoint like the following:

def index():
	return '''\
	<form method="post" action="/mailform">
	<input value="Mail" type="submit" />
i receive:

Sorry, the requested URL '' caused an error:

Quote:Internal Server Error
TypeError("argument of type 'NoneType' is not iterable",)
Traceback (most recent call last):
File "/home/nikos/wsgi/", line 996, in _handle
out =**args)
File "/home/nikos/wsgi/", line 2007, in wrapper
rv = callback(*a, **ka)
File "/home/nikos/wsgi/", line 189, in mailform
if provider in FROM:
TypeError: argument of type 'NoneType' is not iterable
I somehow beleive that the following apache conf directives somehow create problem.

You will see if you create a route endpoint called '/mailform' within '/' which is an alias of '' and you also have '/mailform' in '' when the latter tries to post data to '/mailform' instead of sending them to '' it sends them to '/' which is ''
Can someone exaplin please?

Possibly Related Threads…
Thread Author Replies Views Last Post
  Any way to remove HTML tags from scraped data? (I want text only) SeBz2020uk 1 141 Nov-02-2020, 08:12 PM
Last Post: Larz60+
  POST request with form data issue web scraping hoff1022 1 608 Aug-14-2020, 10:25 AM
Last Post: kashcode
  concatenate a request to the endpoint of OSM-API?! apollo 0 211 Aug-13-2020, 02:45 PM
Last Post: apollo
  html data cell attribute issue delahug 5 466 May-31-2020, 09:18 AM
Last Post: delahug
  Extracting html data using attributes WiPi 14 1,004 May-04-2020, 02:04 PM
Last Post: snippsat
  extrat data from a button html windows11 1 408 Mar-24-2020, 03:39 PM
Last Post: Larz60+
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 440 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  Parse data from downloaded html nikos48 7 720 Jan-26-2020, 03:35 PM
Last Post: nikos48
  requests post/get to HTML form mrdominikku 1 591 Nov-03-2019, 07:12 PM
Last Post: Larz60+
  Sending data post to wsgiref JohnnyCoffee 0 440 Oct-24-2019, 09:04 PM
Last Post: JohnnyCoffee

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020