Deploying Flask via Git & Web Dashboard
-
1. Push your code to GitHub:
git init git add . git commit -m "Initial commit" git remote add origin https://github.com/yourusername/your-repo.git git push -u origin master -
2. Create a
requirements.txtfile:pip freeze > requirements.txt -
3. Create a
Procfile(for Heroku/Render):web: gunicorn app:app -
4. Log in to Render/Heroku Web Dashboard:
- Create a new "Web Service" or "App"
- Connect your GitHub repository
- Set the build and start commands (Render:
pip install -r requirements.txt, start:gunicorn app:app) - Deploy!
- 5. View your live Flask app at the provided URL.
No comments:
Post a Comment