-
Notifications
You must be signed in to change notification settings - Fork 90
Hosting Platforms: Labs
In this lab, we're going to investigate Render Head over there and sign up for an account - it's free!
Remember your web server from the other day? We're now going to host it on the internet so you can browse to it. If you want to make changes to your website, you'll use the following flow:
- Sync your local dev environment to your website's github repo
- Make your changes locally & commit them
- Push your changes to github
- Render sees that your github repo has changed & syncs the changes
- Render restarts your dyno
This means you'll be able to see changes you make to your website in just a few seconds!
Let's go back to your Web Application's project directory. To host your web app on Render, we'll need an extra file:
requirements.txt is used by pip to automatically install all the python modules you need on Heroku. Your app probably only uses flask:
gunicorn==21.2.0
Flask==2.5.5
- 📁 my_flask_app
- 📁 static
- 📁 css
- 📄 styles.css
- 📁 js
- 📄 script.js
- 📁 css
- 📁 templates
- 📄 base.html
- 📄 home.html
- 📄 about.html
- 📄 app.py
- 📄 config.py
- 📄 requirements.txt
- 📁 static
pip freeze > requirements.txt
Make sure to commit your new file, and any other changes you've made - and then push them to github with git push
- Login to your Render dashboard
- create a new app by clicking on the new button and select web service
- Give Render permission to access your github repos and select the one you want to deploy by clicking on the connect button
- Give it a unique name
- click on Create Web Service to deploy your application.
Hit the application link at the top left corner of the screen to browse to your website. Tell your family and friends!
