Build & Deploy A Python Web App | Flask, Postgres & Heroku

Hosting on Heroku – Build & Deploy A Python Web App | Flask, Postgres & Heroku


Build & Deploy A Python Web App | Flask, Postgres & Heroku

Hosting on Heroku

In this project we will build a feedback form with Python Flask, Postgresql and mailtrap.io. We will also deploy it to Heroku

Code:

Deployment Gist:

Sponsor: DevMountain Bootcamp

💖 Become a Patron: Show support & get perks!

Udemy Courses:

Follow Traversy Media:

you search:

Hosting on Heroku

Build & Deploy A Python Web App | Flask, Postgres & Heroku

44 thoughts on “Hosting on Heroku – Build & Deploy A Python Web App | Flask, Postgres & Heroku

  1. Just a note..The customer field should not be unique as it is a name. I had initially planned on using an email field which would probably be a better idea, but it's fine for the tutorial. Hope you guys like. If your not a fan of Python, I apologize, just trying to be a bit diverse. If there are other languages and frameworks you are interested in, let me know. Other than JS, that is a given 馃檪

  2. If you update your css file and your page doesn't show the changes,
    here is the solution:

    Flask sets cache control headers on static resources, and your browser will cache those files up to 12 hours.

    Your options are:

    1. Use an incognito browser window (private browsing mode in other browsers) to force your browser to ignore the cache for a specific session. Each time you open a new incognito tab or window, the cache should be invalidated for that session.

    2. Set the SEND_FILE_MAX_AGE_DEFAULT configuration directive to a shorter value; it is set to 43200 but you can set it to 0 if you really want to.

    3. Add a cache buster query parameter to your static URLs; if your static URLs end with ?<somerandomvalue> your browser will reload the resource if that random value ever changes. You could do this by hand each time or you can use this Flask snippet to override the url_for() function to add such a value for you based on the file modification time.

  3. when i want interface create a table in postgreasql through pgadmin 4, i got this error……
    pls give me some solution to resolved this issue….

    Traceback (most recent call last):

    File "d:Web Developmentapp.py", line 12, in <module>

    app.config['SQLALCHEMY_DATABASE_URI'] = psycopg2.connect(database="web_app", user="postgres", password="12345", host="localhost", port=5433)

    File "C:UsersParag GodboleAppDataLocalProgramsPythonPython39libsite-packagespsycopg2__init__.py", line 127, in connect

    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)

    psycopg2.OperationalError: could not connect to server: Connection refused (0x0000274D/10061)

    Is the server running on host "localhost" (::1) and accepting

    TCP/IP connections on port 5433?

    could not connect to server: Connection refused (0x0000274D/10061)

    Is the server running on host "localhost" (127.0.0.1) and accepting

    TCP/IP connections on port 5433?

  4. Hello Sir, i need help in deployment part. I have stored all options in app.json file and when i am deploying it on heroku instead of options it is not showing anything but on local host it is working fine. Can you please help me.
    Thanks in advance

  5. Can you please make a video on this concept recently i learned java, But in javascript it is difficult for me to understand that suppose we have let a = "Brad".length; then console .log(a) result will be 4 ; so, how we are accessing the dot length thing or maybe like let a = "Brad".toUpperCase(); how this function we are calling because " Brad " it is not a reference variable because in java we use the reference variable them put dot to call any thing inside the object of that class in javascript where is this coming from ???? Please make a video that will be all for me ane it will others also to build concept .

  6. @traversy media is it possible to do this similar thing with psycopg2 instead of sqlalchemy. I am actually confused about how to establish a connection using URI in psycopg2. And how to create tables in Heroku DB using psycopg2 also.

  7. Finishing on codeacademy soon. This is the first web app dev I鈥檇 like to commit to. Personal take on it with similar usability in mind.
    Any possibility of mild supervision towards achieving my modification? If I get past login integration…

  8. hey brad , i followed up the code till setting up and connecting database but i am stuck at this error

    (psycopg2.OperationalError) could not connect to server: Connection refused (0x0000274D/10061)

    Is the server running on host "localhost" (::1) and accepting

    TCP/IP connections on port 5432?

    can anyone please help me out?

  9. 10:52 "You donot need a frontend framework for everything" Give this guy a cookie 馃檪
    Huge fan of your channel, this is my first python flask postgresql stack project. I knew about python flask, but was alien to postgresql with python. You made my day, thank you <3

  10. Nice tutorial. I am getting this "… import psycopg2
    ModuleNotFoundError: No module named 'psycopg2'" after db.create_all() step. Please let me know on how to solve it because I could not find any solution any where.

  11. i've been trying to put up my flask app for a year now with no luck. this, surprisingly, also hasn't helped. heroku command not working, python interpreter got fucked trying to switch to python 3, and now i can't use python… great

Leave a Reply

Your email address will not be published. Required fields are marked *