You can wrap any hyperlink via markdown, e.g. have a look at this code where several hyperlinks were added:
import streamlit as st
st.markdown(
"###### Made in [![this is an image link](https://i.imgur.com/iIOA6kU.png)](https://www.streamlit.io/) , with :heart: by [@DataChaz](https://www.charlywargnier.com/)   |   [![Follow](https://img.shields.io/twitter/follow/datachaz?style=social)](https://www.twitter.com/datachaz)   |   [![this is an image link](https://i.imgur.com/thJhzOO.png)](https://www.buymeacoffee.com/cwar05)"
)
Almost, but not quite! I need to execute some logic based on the fact that the hyperlink was clicked. In Flask this is accomplished by creating a route to receive the confirmation click.
Something like this:
# app/auth/routes.py
from app.auth.email import send_congrats_email
@bp.route('/register', methods=['GET', 'POST'])
def register():
if current_user.is_authenticated:
return redirect(url_for('main.index'))
form = RegistrationForm()
if form.validate_on_submit():
user = User(username=form.username.data, email=form.email.data)
user.set_password(form.password.data)
db.session.add(user)
db.session.commit()
send_congrats_email(user)
flash('Check your email for our congrats message')
return redirect(url_for('auth.login'))
return render_template('auth/register.html', title='Register',
form=form)
Maybe all I need to do here is create a target container that holds a form. Will try it.
In case this saves someone else some time, this seems to work. I send an email including the URI http://localhost:8501/#validate
with st.container():
st.subheader('Validate', anchor='validate')
with st.form(key='form_header'):
submit = st.form_submit_button('Validating my email address')
if submit:
# do database action
st.write('Your email has been validated!')
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.