Categories: how to Technology

How To Deploy Django App on Heroku



Hey geeks and really interesting people out there, today we are doing a little resume on how you can deploy django app on heroku.

Yeah, even if you don’t know anything about it, here you can learn how to do it, so keep reading to become a deployer master.

Is kinda obvious, but first, you need to have a Heroku account, is you already have it skip this step, however if you don’t, you can create a Heroku account in like one minute or even less, you can choose the plan that is more suitable for the functionalities you need to have, this platform counts with 4 plans: Free that will cost you $0, and then the ones you need to pay to have, that are hobby, standard, and performance. This time we are working on the free plan.

I need to highlight something really important here, at the moment you create your account,  you choose the “primary development language”, please be sure you select Python. After you finish all the steps you will receive a confirmation email.

Having your account next is installing the CLI for Heroku, this is the main tool you need to interact properly with Heroku, to do this you need first open the console, enter your user-name and password, of the account you already have or just create.



Then start creating a Heroku app, and next you need to connect to PostgreSQL, is kind of easy for those who already have experience on the field.

After you start creating your app, you can start configuring the Django apps for your Heroku system, you can try at first writing a really easy Django application, however, if you are a lot more experienced you can try to do one a little bit more complicated.

You need to have the requirements.txt file, this file contains a list of all you need for app packages, you need to create this file in the root folder. After you have this configured, you need to have the profile, this describes all the commands you will need to execute the app. And last in this step but not least; you need to have the runtime.txt, which is the file that specifies the Python version.

Then we need to separate the Django settings, this is necessary for the app you are creating is this start to grow. After you have it, you need to set up static files. First, you need to modify settings.py ? wsgi.py; that will assure you a correct display of files. After this step, it came the data configuration and the local launch.

If you complete all these steps correctly, you will just need to go and deploy Django to Heroku, run migrations and that’s it! For those who want to take a look at the code here, you have all the information available. It seems really complicated; however, once you achieve it you will feel so satisfied!

Payel Dutta

Happy soul, fond of travelling and loves to read tech columns.

Recent Posts

Facebook is the least-trusted major tech company- study

Facebook Is the Least Trusted Major Tech Company Among Americans For Protecting Personal Data, Suggests Polls Facebook, the social networking…

9 hours ago

10 Best Free Sports Streaming Sites

A majority of people still rely on either cable or satellite-based television services for watching live sports or for streaming. Surprisingly there…

9 hours ago

How to create your own WhatsApp stickers on Android smartphones

Create your own custom stickers for WhatsApp, here’s how WhatsApp, the Facebook-owned instant messaging platform, had last week rolled out a new feature…

1 day ago

Apple Announces Repair Program For Faulty iPhone X and 13-Inch MacBook Pro Units

Apple offers free repairs to fix quality problems in some faulty iPhone X units and 13-inch MacBook Pro models Apple…

1 day ago

WhatsApp iOS beta open for public; How to download it now

WhatsApp officially launches an iOS public beta, here is how you can download and register WhatsApp Beta programme that was…

2 days ago

Greek ISPs Ordered To Block The Pirate Bay, 1337x, YTS And Other Domains

Court Orders Greek ISPs To Block 38 Domains, Including The Pirate Bay, YTS and 1337x Greek ISPs (Internet Service Providers)…

2 days ago