-
-
Save yarogniew/08e09415df7a7d31f4dc9fb9f6b4a1ed to your computer and use it in GitHub Desktop.
prosta strona zbudowana w oparciu o flask do projektu-flask-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.youtube.com/watch?v=Js1oQoyLeig | |
from flask import Flask, render_template | |
app = Flask(__name__) | |
print (__name__) | |
# @app.route('/') | |
# def main(): | |
# return 'Witaj Świecie!' | |
@app.route('/') | |
def home(): | |
return render_template('index.html', zmienna='https://arduino.net.pl') | |
@app.route('/innastrona') | |
def innastrona(): | |
return 'Witaj na nowej stronie!' | |
@app.route('/klient/<numer>') | |
def klient(numer): | |
print(f'Przekazano numer klienta: {numer}') | |
return f'Przekazano numer klienta: {numer}' | |
@app.route('/dodaj/<numer1>+<numer2>') | |
def dodaj(numer1,numer2): | |
wynik = int(numer1) + int(numer2) | |
return f'Wynik: {wynik}' | |
if __name__ == '__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment