Python Django Tutorial: Deploying Your Application (Option #2) - Deploy using Heroku
Why Stack Overflow recommends it
Stack Overflow users link it when answering how to host or deploy a Django project, and it is often the tutorial that askers say they followed.
Recommended by 7 people across 7 different months, 2019 to 2022.
What it is
A 53-minute Django tutorial by Corey Schafer that walks through deploying a Django app to Heroku. It covers installing the Git, Heroku CLI and Postgres tooling, configuring environment variables, and setting up the app to deploy, update and roll back changes.
What people said
Recommends TobKed · 2019-07 · Stack Overflow · on “How to hide EMAIL_HOST_PASSWORD in settings.py file?”
Two things about your question: You cannot deploy Django app on github pages because they serve only static files. Check e.g. Heroku, it's quite easy to deploy Django there. The most common practice to hide passwords and secret keys is to use environmental variables. Generally, you have to set a variable in bash e.g. export EMAIL_HOST_PASSWORD=my-own-password and then you can use os python module to retrieve it: import os EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD") Useful video tutorials: Python Django Tutorial: Deploying Your Application (Option #2) - Deploy using Heroku [this video] Python Quick Tip: Hiding Passwords and Secret Keys in Environment Variables (Mac & Linux) [LINK]
Recommends Shane Muirhead · 2019-08 · Stack Overflow · on “Is it possible to access Django application running on my local host to be accessible by another computer on other networks?”
You could use Heroku platform :) [LINK] It's free and easily can deploy Django projects with Gunicorn. Corey also has a good video on how to do the process. [this video] Localhost is only for local, if you want to share between other computers on the same network then bind your django server to a static IP address but for other networks I think this would require something such as Heroku.
Recommends Nabeel Parkar · 2019-11 · Stack Overflow · on “How to distribute Django web app to users?”
I suggest you look into Heroku. [LINK] They have a free plan too so you can test it without having to pay first. Their guide [LINK] with django after you set up an app [LINK] is good too. You will find everything in their documentation [LINK] but if you get stuck, I recommend this [this video] video by Corey Schafer [LINK] . Good luck Edit: Heroku also supports Docker [LINK] but I'm not too familiar with it. Might be useful to you
Recommends Ammar A Hasan · 2020-04 · Stack Overflow · on “Webside name for Django”
You can deploy your website to heroku website it is free hosting, but you need serve static file in another website like AWS S3 Watch this [this video] You can watch all the playlist in this link [LINK] It is good explaining Another solution is : You can deploy it to Python anywhere but I am not sure if it is free
Recommends Gokul nath · 2020-07 · Stack Overflow · on “Django database problems after pushing to github for heroku to build”
I believe heroku don't support sqlite database, but it supports Postgress DB . It does have some restriction on number of rows you can use (run heroku pg command after you set up the DB on heroku to get the details). I personally find this [this video] helpful to deploy my django app into heroku .
Recommends Leonardo Mantovani · 2020-09 · Stack Overflow · on “Heroku duplicate key value violates unique constraint (django)”
Today I deployed my django app on Heroku for the first time (following this [this video] tutorial). The problem is that when I want to modify or add something to the database, I get an Integrity Error which says: duplicate key value violates unique constraint "app_professore_pkey" Where Professore is the name of the Model I tried to modify. I’ve searched a bit online and I’ve seen that probably is because I developed the app on my PC using SQLite and now, on Heroku, it uses PostgreSQL, and those 2 databases works differently. Actually, I don’t have a lot of experience with databases (almost no experience) so I don’t know how to fix this... Maybe modifying something on the Professore model? Or typ
Recommends Uniquedesign · 2022-02 · Stack Overflow · on “How can I migrate my existent sqlite db to postgres on heroku?”
Make Sure you have the `requirements.txt` file along with `.gitignore`. For further details follow this tutorial on youtube [this video]
Cites Terminal Guy · 2019-02 · Stack Overflow · on “How do I put my Django SQLite database contents into a Heroku PostGreSQL database?”
I am totally new to hosting/deploying applications. After watching this video [this video] , he started a new database from scratch rather than converting his Django SQLite database. I have lots of data that I want on the deployed site so I'd like some advice as to how to do that with Django and Heroku. I have seen there are some SQLite -> PostGreSQL conversion questions on here but none seemed to show a step by step guide using Django and Heroku, only issues they're having. I just want to make sure I do it right.
Cites Rodrigo Reyes · 2022-01 · Stack Overflow · on “user table not created on django deployment but superuser created on heroku bash”
I'm trying to upload my first django app and I've been struggle with this issue for sometime, help is appreciated. I already set up my project to be on heroku, I followed this tutorial: [this video] in which django_heroku module is used to configure DB, here is the link to library [LINK] The app throws the error on login as if user tables didn't exist but I already create a super user using the heroku bash feature, after apply migrations using "heroku run python manage.py migrate". When I run "ls" command on heroku bash this is my directory: manage.py Procfile requirements.txt runtime.txt smoke staticfile "smoke" is my folder app, should I could see the db in this directory? if the db was not cre