Error with f-strings and URLs


I recently deployed my code that was written in version 1.12.2 not knowing that the current version is 1.20.0

Steps to reproduce

Code snippet:

    with l2:
        st.header("Create Account")
        pas = st.text_input("Password (Required)")
        em = st.text_input("Email (Optional)")
        if pas:
            if len(pas) >= 8:
                siup = st.button("Sign Up", key="signup")
                em = None if not em else em
                if siup:
                    with st.spinner("Creating account..."):
                        uname = requests.get("")
                        usa =
                        st.success("Acount created!")
                        with st.container():
                            st.write("__Your Login Details__")
                            st.write(f"`Username:` {usa.json()['username'][0]}")
                            if em != None:
                                st.write(f"`Email:` {usa.json()['email'][0]}")
                            st.write(f"`Password:` {usa.json()['password'][0]}")
                st.error("Password to short, please use at least 8 characters!")

Expected behavior:

A new account should be created

Actual behavior:

I got this error: After updating to the latest version I went back to testing on local and I got this error:

Debug info

  • Streamlit version: 1.20.0
  • Python version: 3.9.13
  • Using Conda
  • OS version: Mac
  • Browser version: Arc (Chromium based)

Requirements file



In the code of your repo, try changing




Otherwise, the f-string that you are building later (i.e. usa) ends up with two consecutive //, which is probably what triggers an 404 error response from that API.

usa ="{BASE_URL}/data/create/user?username={uname.json()['name']}&password={pas}&email={em}")

A sorry, that is the outdated code, I forgot to push the changes I had on my local machine, here is the latest code

Updated ยท SlumberDemon/SchoolPlace@33c2c2c ยท GitHub

Latest version shows no errors on my end.

Yes, it seems only the local version is struggling but the online version is fine, thanks for the help, I think this was a bit of a dumb mistake on my end somewhere!