python - Why Flask gives 404 for files in the same directory with my application -
let's have domain. under home directory of domain have text(.txt) file called note.txt. below
https://www.example.com/note.txt
when access url, browser display text string contained inside file. when run flask
under domain instead of traditional html,css,javascript,php
app, server return 404
error though file exists in fact @ same location. can see ftp client.
so why server returns 404
error when site hosts python app instead of more traditional html,css,javascript,php
app?
what missing here flask has its own url routing.
python code must exposed through
app.route
decoratorstatic files,
note.txt
can served through flask, often handled front end web server (nginx, apache) through configuration
the answer "why server returns 404 error" url routing should explicit (nothing happens unless tell happen) instead of implicit (everything on server exposed default). because php chose latter approach, wordpress, drupal, et. al. traditional php sites getting hacked when given people don't have full picture doing. might convenient in beginning, open invitation script kiddies raid server.
Comments
Post a Comment