Git Product home page Git Product logo

Comments (7)

miguelgrinberg avatar miguelgrinberg commented on May 18, 2024

Do you have any reference to this? Werkzeug master still supports the redirects.

from microblog.

dastagg avatar dastagg commented on May 18, 2024

When I did the examples using the cli, it worked.
But when I went to actually put the code in the app:

I am using Pycharm and it didn't find the methods.
I am using Werkzeug V0.13.
I looked at Werkzeug Transition and that's where I read about the re-direct being removed.
Once I changed it, Pycharm recognized it and it worked.

from microblog.

miguelgrinberg avatar miguelgrinberg commented on May 18, 2024

Oh wow, that transition document was written 7 years ago, I wonder how much of that is still planned if nothing changed for so long. In any case, I will switch to the long import form, just in case. Thanks.

from microblog.

dastagg avatar dastagg commented on May 18, 2024

Maybe it's a bug in Pycharm?
Later today, I'll try it in another Editor like VSCode and see if the same issue surfaces.

from microblog.

miguelgrinberg avatar miguelgrinberg commented on May 18, 2024

Yes and no. Werkzeug uses a little bit of hackery to get all those imports available as top-level symbols. Pycharm probably does not find them because there aren't really any explicit import statements, the redirection is done using Python logic, not imports.

from microblog.

dastagg avatar dastagg commented on May 18, 2024

I just tried closing Pycharm, opening the code in VSCode with the Python Extension enabled and pylint installed.
If I remove the security, the app still runs correctly but pylint displays an E611 error that those two names cannot be found in werkzeug.

To Summarize:

The import of the two methods works as far as the app running correctly goes but in order make the "error" go away in both Pycharm and VSCode, you have to be more explicit and make it "werkzeug.security".

from microblog.

dastagg avatar dastagg commented on May 18, 2024

I'm going to close this issue as it's not really a problem with the application code.

from microblog.

Related Issues (20)

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.