Code Monkey home page Code Monkey logo

Comments (3)

N2ITN avatar N2ITN commented on September 6, 2024

I agree! I'm open to pull requests if anyone knows flask and wants to fix it.

from are-you-fake-news.

lucasduffey avatar lucasduffey commented on September 6, 2024

relevant: https://github.com/N2ITN/newscraper/blob/be968db3246e43959c01a6e6b048d92fecaaa61e/web/app.py#L54

Not sure if it's as simple as changing to if request.method in ['POST', 'GET']:

will have to check in free time

from are-you-fake-news.

N2ITN avatar N2ITN commented on September 6, 2024

I don't have a chance to try it at this moment, but while we're brainstorming:
It might just be a matter of defining a new function for the main function def hello() to call using a dynamically generated app route, instead of returning the template in its own scope:

Something like:

@app.route(f"/results_{name_clean}", methods=['GET', 'POST'])
def user_results(val,pol,fact):
    return render template('index.html', value=val, pol=pol, fact=fact)

(where name_clean is the top level domain of the url with no punctuation)

from are-you-fake-news.

Related Issues (3)

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.