I want to detect if the request came from the localhost:5000
or foo.herokuapp.com
host and what path was requested. How do I get this information about a Flask request?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
another example:
request:
then:
you should try:
It suppose to work always, even on localhost (just did it).
You can examine the url through several
Request
fields:You can easily extract the host part with the appropriate splits.