Giter VIP home page Giter VIP logo

Comments (8)

mikeckennedy avatar mikeckennedy commented on May 17, 2024

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.

gloc-mike avatar gloc-mike commented on May 17, 2024

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.

In Opera, I found this error:
Screen Shot 2021-03-11 at 09 52 12

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.

gloc-mike avatar gloc-mike commented on May 17, 2024

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.

mikeckennedy avatar mikeckennedy commented on May 17, 2024

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:

Screen Shot 2021-03-10 at 9 03 44 PM

But running this version:

@app.get('/')
def index():
    return {
        'message': "Hello World"
    }

Gets me:

Screen Shot 2021-03-10 at 9 04 01 PM

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.

gloc-mike avatar gloc-mike commented on May 17, 2024

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.

mikeckennedy avatar mikeckennedy commented on May 17, 2024

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.

gloc-mike avatar gloc-mike commented on May 17, 2024

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.

mikeckennedy avatar mikeckennedy commented on May 17, 2024

Glad you got it figured out. Yes, the mixed browser content threw me off. :)

from web-applications-with-fastapi-course.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.