Secondary Page does not load using Flask and Apache

52 Views Asked by At

I'm trying to wrap my head around flask development, and have created some basic use cases...however, i've hit this snag.

Running locally I am able to run a flask script that renders an input screen for capturing some data, and upon selecting Submit that data is fetched and processed through a function that outputs collected JSON on a new path called /process.

However, when I create a wsgi file, and update my wsgi.conf for apache on the server where this is hosted, only my initial index screen loads, and upon selecting submit the next page now returns the error 'The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.'

here's route for the process page:

@app.route('/process', methods=['GET','POST'])
def process_inputs():
    user = request.form['user']
    password = request.form['password']
    accountNumber = request.form['account_number']
    companyCode = request.form['company_code']
    docCode = request.form['doc_code']
    env = request.form['environment']
    user_login = f'{user}.admin%{accountNumber}'


    data = audit_transaction(user_login,password,companyCode,docCode,env)
    return render_template('results.html', data=data)

I've added two aliases to the wsgi config path, that resulted in reloading the index upon selecting submit.

conf snippet:

WSGIScriptAlias /audit_transaction C:/scripts_mains/audit_trace_doccode_track/wsgi_script/wsgi_script.wsgi <Directory C:/scripts_mains/audit_trace_doccode_track> Require all granted

0

There are 0 best solutions below