I created a Flask app, in my local computer everything works fine, I can insert data from the form on the HTML page and then pass the data to the program to elaborate it.
I wanted to move this application on an Ubuntu server, I set up all the stuff like nginx, python, flask, uswgi using this guide. The web server works, I can access the web pages and insert all of my data, but when the program passes the data to another page is not sorted correctly, maybe the third field is in the second position and so on.
I don't understand why this is not happening on my local machine.
here an example:
ImmutableMultiDict
([('group-0[1][macchine]', 'M02'), ('group-0[1][tempo_previsto_setup]', '17'), ('group-0[0][tempo_previsto_setup]', '13'),
('group-0[0][macchine]', 'M01'), ('group-0[0][tempo_previsto_lavorazione]'
('group-0[2][macchine]', 'M03'), ('group-0[2][tempo_previsto_lavorazione]', '22'), ('group-0[0][tipo_lavorazione]', '')
this are just few fields but the list is way longer, as you can see the M01
is in the second position, but in the web page is in the first field.
basically each group-0[1][macchine]
should have his group-0[1][tempo_previsto_setup]'
, 'group-0[0][tempo_previsto_lavorazione]'
but as you can see the M02
has two 'group-0[0][tempo_previsto_lavorazione]
one with the [1]
(that is correct) and one with [0]
that should be owned by the M01
this is causing me a lot of problems because the program was written to get the data sorted correctly
What can be wrong with nginx?
I'm getting the ImmutableMultiDict
like so:
@app.route('/ordini/conferma', methods=['GET', 'POST'])
def conferma_ordine():
global data
if request.method == 'POST':
data = request.form
print(data)
Calcolo_tempistiche.ottenimento_variabili(data)
array_ordine = Calcolo_tempistiche.array_ordine
return render_template('ordine_eseguito.html', **locals())
data = []