1) How do i enable flask so that errors are shown in the browser for m, so
i dont have to tail -f error_log all the time?
When i was using the flask development server i had this
app.run( host='superhost.gr', port=5000, debug=True )
Now i have commented this out becuas eitsw being run by mod_wsgi and its
sending everythign to the error_log text file.
2) Regarding this code which not behalfing as it should
@app.route( '/<page>' )
@app.route( '/' )
def index( page=None ):
# read environment
page = request.args.get('page', 'index.html')
When i try via browser:
'http://superhost.gr/' page variable equals to 'index.html'
'http://superhost.gr/something' page variable still equals to 'index.html'
How is this possbile under mod_wsgi ?
Στις Δευ, 10 Σεπ 2018 στις 5:05 π.μ., ο/η Graham Dumpleton <
[email protected]> έγραψε:
>
>
> On 10 Sep 2018, at 11:52 am, Νίκος Βέργος <[email protected]>
> wrote:
>
> Graham i know you helped me a lot but my script cannot work if i don;t het
> this oe sorted out and i'am trying for hours allready.
>
> Please do help.
>
>
> I have 3 wsgi scripts listening on 3 locations. What i'm trying to run an
> wsgi script from within another wsgi script with the following statement.
>
>
> page = 'clientele'
> pdata = requests.get( 'http://superhost.gr/' + page )
> pdata = pdata.text + counter
>
> Have you tried to add print() statements into your code, when it is
> running and what variables are at each point? If you use print(), what you
> print will appear in the Apache error log so you can see it. As per example
> in requests docs at:
>
> http://docs.python-requests.org/en/master/
>
> you don't even appear to check the response status code. Check such
> things, print out the values and see what it is getting.
>
> page = the location of another wsgi app.
>
> The error i'am getting when for i.e i try to load
> http://superhost.gr/clientele
>
>
> mod_wsgi (pid=7152): Exception occurred processing WSGI script
> '/home/nikos/public_html/app.py'
> OSError: Apache/mod_wsgi failed to write response data: Broken pipe.
>
> This specific message from mod_wsgi indicates that the HTTP client making
> the request dropped the connection before the server could write the
> response.
>
> So possibly an error is occurring in app.py if that is what is calling it.
>
> Have you enabled Flask debug so that errors are shown in the browser for
> you. If you don't, Flask will just return a 500 error and may not actually
> log anything about the error. You may need to set up Flask logging so that
> it logs details of exceptions to the error log.
>
> http://flask.pocoo.org/docs/1.0/logging/#logging
>
> The other script by itself executes normally but NOT from within my app.py
> script.
>
> Any ideas on how to execute a wsgi app (b) from within a wsgi app(a) and
> store the response as html data?
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "modwsgi" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/modwsgi/lZDr6zKcyUg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.