Forums

Pages Past Root Stopped Working

Hey Guys,

I have a plain Python/Flask site that is fairly simple. I have the default wsgi.py setup. The site has been running great for many months, then - not-so-much. I reloaded the site from the web dashboard, and the main site came back up, but all the other routes (that were working perfectly) - all get a 404.

The only recent errors in the log is:

2024-08-18 19:12:19,540: OSError: write error

There are 6 other of the same errors for August. I have my routes and blueprints setup correctly:

# ROUTES
from app_project.visits.views import core
from app_project.admin.views import admin
from app_project.error_pages.handlers import error_pages
app.register_blueprint(core)
app.register_blueprint(admin)
app.register_blueprint(error_pages)

I also have my routes setup correctly:

@admin.route('/admin')
def admin_redirect():
    return redirect("/admin/monthly-report")

@admin.route('/admin/')
def admin_redirect():
    return redirect("/admin/monthly-report")

@admin.route('/admin/monthly-report')
def monthly_report():
    # Your SQLAlchemy query to aggregate data
    result = db.session.query(
        extract('year', Visit.date).label('year'),
        extract('month', Visit.date).label('month'),

    # ... rest of code .... #
    )

Like I said - it was working fine - now not-so-much. Any help would be greatly appreciated!

Bob

Hi Bob -- that sounds strange! But I just tried going to the /admin URL on your site just now and was redirected to /admin/monthly-report, and there was data there. Perhaps you managed to fix the problem in the meantime?

Hey! THANKS for checking it out.

This is what i see: enter image description here

That app does not exist on your account.

? Sorry - there was a family death, just getting back to this... the main app works - so it is there...

https://whc.clickware.com/admin/monthly-report

if you do: https://whc.clickware.com - then happy days. So the app is there....

Sorry to hear about your loss.

There must be something wrong with your routing. How do your other working routes look like?

Hi - thanks for your kind words!

There really are no other routings. It's the main site https://whc.clickware.com - it's for a non-profit here in Prescott, AZ - and then the /admin is supposed to (and DID) load https://whc.clickware.com/admin/monthly-report so that they can do the monthly reporting.

What else I can do to help debug this?

THANKS! Bob

That 404 is coming form flask, not from our system.

OK - I guess I'll just have to work it out.

The problem is that the subdomain - was my own that was forwarding to clickware.pythonanywhere.com. When I changed the path to the correct URL - all was good.

SORRY for all the confusion!

Thanks for letting us know