Flask-Workshop/05-input-primes.py

12 lines
357 B
Python

from sympy import isprime
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/primes')
@app.route('/primes/<max_number>')
def primes(max_number=10):
numbers = range(1,int(max_number)+1)
return render_template('colorful-primes.html', title='Primes', numbers=numbers, isprime=isprime)
if __name__ == '__main__':
app.run()