Comments (8)
Hi @gloc-mike That is odd. I don't know why you're seeing that. I'd guess the web method looks like:
def index():
return "Hello world"
The one I have is:
def index():
return {"message": "Hello world"}
If that's not it, perhaps it's formatting in your browser? Do a view source also I guess to be sure. Let me know what you find.
from web-applications-with-fastapi-course.
Hi @mikeckennedy,
Thanks for the response. I tried both but neither altered the browser look.
I thought it might be browser specific so I tried Opera, Safari and re-downloaded Chrome but all produce the same result.
But I don't see that error in Safari nor in Chrome so probably Opera specific. There are no exceptions anywhere else in any of the browsers that I can find.
Any other thoughts?
from web-applications-with-fastapi-course.
Hi @mikeckennedy,
I pushed my program files to GitHub. I know it's simple but I might have some domestic blindness and have missed something really obvious.
https://github.com/gloc-mike/Faux-PyPI
from web-applications-with-fastapi-course.
Thanks. I ran your version in github. Here's what I get with it exactly as is which is return "hello world"
and the output is the same as you have:
But running this version:
@app.get('/')
def index():
return {
'message': "Hello World"
}
Gets me:
I think what you might be seeing is you must restart the web app, not just change and save the python file to see any difference.
from web-applications-with-fastapi-course.
Hi @mikeckennedy,
Yes, I alway restart the server after making changes. It doesn't make any difference which version of the return statement I use, I still do not get the "JSON Raw Data Headers" FastAPI buttons displayed in the browser.
I looked through the FastAPI issues but could not find anything related to this.
from web-applications-with-fastapi-course.
Oh, I misunderstood the part you're looking for. You have to use a browser with that display. The reason I have that is because I use Firefox. I wouldn't get that on brave/chrome/safari/etc.
from web-applications-with-fastapi-course.
Oh sorry @mikeckennedy ! My bad. I shouldn't have mixed the output screenshots like that.
We got there in the end! :) Thanks! Firefox all the way! Yay! :)
from web-applications-with-fastapi-course.
Glad you got it figured out. Yes, the mixed browser content threw me off. :)
from web-applications-with-fastapi-course.
Related Issues (9)
- [Feature request] Could you please add tests? HOT 3
- aiofiles not needed as a requirement HOT 3
- Last login
- Error in engine.py, using python3.9 (posixpath.py) when template_path is None HOT 9
- pysqlite3 doesn't support asyncio HOT 9
- Modifying .pt files and having Uvicorn reload HOT 5
- Testing HOT 1
- Using of deprecated method relation() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-applications-with-fastapi-course.