# Streamlit-app

**URL:** <https://discuss.streamlit.io/t/streamlit-app/477>\
**Category:** Using Streamlit\
**Tags:** docker\
**Created:** [October 15, 2019, 7:19am UTC](https://discuss.streamlit.io/t/streamlit-app/477 "2019-10-15T07:19:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imneonizer](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/imneonizer/32/369_2.png) [@imneonizer](https://discuss.streamlit.io/u/imneonizer)\
**Post date:** [October 15, 2019, 7:19am UTC](https://discuss.streamlit.io/t/streamlit-app/477/1 "2019-10-15T07:19:22Z")

</div>

Try out this code, but first

```python
pip install streamlit
pip install imcrypt

```

Now here is the code:

```python
import streamlit as st
import imcrypt

st.title('Imcrypt')

st.text('A secure text encryption tool.')
text = st.text_input('Text:')
e_type = st.selectbox('Choose One:', ('Encryption', 'Decryption'))
password = st.text_input('password:')
submit = st.button('Submit')

if submit:
    #text or password should not be empty
    if not (password == '' or text==''):
        
        #if Encryption is choosen
        if e_type == 'Encryption':
            enc_text = imcrypt.encrypt(text, key=password)
            st.text_input('Your Encrypted Text:',f'{enc_text}')

        #if Decryption is choosen
        elif e_type == 'Decryption':
            try:
                enc_text = imcrypt.decrypt(text, key=password)
                st.text_input('Your Decrypted Text:',f'{enc_text}')
            except Exception:
                pass

```

To run: `streamlit run filename.py`

so this app works really fine, i just wanted to know how we can directly deploy it to heroku or any other platform.  
can we use docker compose to deploy it. i am new to docker so any help would be appreciated.

 ![Screenshot%20from%202019-10-15%2011-53-29](https://global.discourse-cdn.com/streamlit/original/1X/7138747fb906ada2789af6180896f235ca64f4bc.png)

---

<div class="post-metadata">

**Author:** ![asg017](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/asg017/32/2988_2.png) [@asg017](https://discuss.streamlit.io/u/asg017)\
**Post date:** [October 15, 2019, 6:30pm UTC](https://discuss.streamlit.io/t/streamlit-app/477/2 "2019-10-15T18:30:54Z")

</div>

This is a pretty cool!

You can use [glitch.com](http://glitch.com) for small streamlit apps like this - [here’s](https://glitch.com/~hello-streamlit) an example.

I tried putting your app in a glitch app [here](https://glitch.com/~detailed-harbor) (by replacing `app.py` with the code that you provided, and putting the `imcrypt` library inside `install` in `glitch.json`), but glitch only supports Python 3.5, and in imcrypt, it uses python [f strings](https://www.python.org/dev/peps/pep-0498/) in a [couple of places](https://github.com/imneonizer/imcrypt/blob/master/imcrypt/imcrypt.py#L16-L22) (which is only supported in Python 3.6 or later) - so importing it causes it to crash.

If you do want to use glitch, you can try to 1) remove `f""` usage in imcrypt (since it appears that you are the author), and 2) update the imcrypt package, and 3) restart the Glitch app so it reinstall the new version and (hopefully!) works.

You could use heroku/aws/gcloud/render as other hosting option as well - where you would have more freedom in choosing the python version. There’s a couple threads in this forum/on Github that talk about different deploying methods with streamlit and best practices.

---

<div class="post-metadata">

**Author:** ![imneonizer](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/imneonizer/32/369_2.png) [@imneonizer](https://discuss.streamlit.io/u/imneonizer)\
**Post date:** [October 16, 2019, 9:51am UTC](https://discuss.streamlit.io/t/streamlit-app/477/3 "2019-10-16T09:51:43Z")

</div>

woooo i checked it on glitch, it looks awesome. sure sure i 'll try to update the imcrypt package.

---

<div class="post-metadata">

**Author:** ![imneonizer](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/imneonizer/32/369_2.png) [@imneonizer](https://discuss.streamlit.io/u/imneonizer)\
**Post date:** [October 16, 2019, 4:16pm UTC](https://discuss.streamlit.io/t/streamlit-app/477/4 "2019-10-16T16:16:23Z")

</div>

i have updated imcrypt to support python 3.5 string formatting, try it out.

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [November 19, 2021, 5:22pm UTC](https://discuss.streamlit.io/t/streamlit-app/477/5 "2021-11-19T17:22:31Z")

</div>


