Flutter signup/login application with Django backend #2
django tutorial django-rest-framework login heroku

April 19, 2020, 12:44 a.m.

Flutter signup/login application with Django backend #2


Next steps

This post is in continuation of the other post that written on the same topic. If you have not read that, please go ahead and give it a read so that you can follow along with this one. Flutter signup/login application with Django backend #1.

Host your application

Since this series of posts will be a detailed step by step procedure that can be replicated to get the exact same application running, I thought it would be a good idea to include this step in the process. When it comes to hosting Django application you have two options:

1. Host it on a VPS (you need to configure gunicorn and Nginx for it refer: this tutorial).
2. Host it on Heroku (or python anywhere etc. etc).

Well, to be honest, the second method is relatively simple and we are going to do just that as our aim here is to just see how stuff works.

Hosting your application on Heroku

Changes required

Heroku provides a very easy method for hosting Django applications, the first step is to modify a few settings and add a few files in order to prepare our application for hosting.

We will be deploying using gunicorn so let us install that, run:

pip install gunicorn

We will be using django-heroku package to configure our setting.py file automatically. Thus, install that too:

pip install django-heroku

The first file we need to include is requirements.txt so that Heroku can recognize your application as a python application. Thus, activate your virtual environment and run:

pip freeze > requirements.txt

from HOME/

Create a Procfile

nano Procfile

and add :

web: gunicorn HOME.wsgi --log-file -

For the admin portal to run properly, we need static files' support, for that, we need to configure STATIC_ROOT property in our settings.py file, we also need to include django-heroku settings in the file. Thus, modify your HOME/HOME/settings.py and add the following:

import django_heroku # add in the beginning

... # denotes rest of the code in between

# add these lines at end
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')


Pushing our code to deploy it

We need to create an account on heroku and install heroku-cli. These instructions suffice for Ubuntu / Windows / Mac. For manjaro linux users, you could use:

yay -S heroku-cli

It is the perfect time to log in to your heroku cli, run

heroku login

Next, we need to create an app, run

heroku create <app_name>

Now copy all your files from the HOME/ directory to this app_name/ directory we created just now.

Now is the time to run these magic commands (we are deploying using git make sure git bash is installed refer: here)

git add .
git commit -m "deploying to heroku"
git push heroku master

Now we need to migrate our changes on the heroku server as well. Thus run:

heroku run python manage.py migrate

Also, create a superuser with the same credentials as your local application (for consistency).

heroku run python manage.py createsuperuser

You should now be able to call your APIs with the URL you got here. Verify the functionality using POSTMAN before proceeding. Also, refer to the previous post for details about the endpoints, etc.

Next Post: Flutter signup/login application with Django backend #3

Previous Post: Flutter signup/login application with Django backend #1

Share this article:


  • DeeynStei
    Sept. 15, 2022, 4:12 a.m.

    gay boy chat rooms live gay chat <a href="https://free-gay-sex-chat.com/">m4m chat phone free rochester ny gay </a>

  • GennieStei
    Sept. 16, 2022, 12:30 p.m.

    gay video cam chat <a href=https://chatcongays.com>chat muscle gay</a> mature gay chat app

  • MarrisStei
    Sept. 20, 2022, 11:16 a.m.

    essay writers review <a href=https://au-bestessays.org>medical school essay service</a> i need help writing an essay

  • DorolisaStei
    Sept. 21, 2022, 6:33 a.m.

    online essay help chat <a href=https://bestcampusessays.com>essay writing services for cheap</a> essays on the movie the help

  • MartyStei
    Sept. 22, 2022, 4:50 a.m.

    help me write a narrative essay <a href=https://besteasyessays.org>essay writing services usa</a> essay writers service

  • MerolaStei
    Sept. 23, 2022, 12:41 a.m.

    help with college essays <a href=https://bestessayreviews.net>custom essay toronto</a> i need help writing a narrative essay

  • AshlenStei
    Sept. 23, 2022, 8:32 p.m.

    the help essay <a href=https://bestessaysden.com>help essay</a> help in writing essays

  • CharitaStei
    Sept. 25, 2022, 10:12 a.m.

    admission essay services <a href=https://bestsessays.org>cheap essay writers</a> english literature essay help

  • NaniceStei
    Sept. 26, 2022, 5:11 a.m.

    who can write my essay <a href=https://buyacademicessay.com>i need help to write an essay</a> service essays

  • ChelsaeStei
    Sept. 27, 2022, 12:48 a.m.

    custom law essay <a href=https://buy-eessay-online.com>custom essays review</a> essay on helping others

  • PennyStei
    Sept. 27, 2022, 7:58 p.m.

    online essay editing service <a href=https://buytopessays.com>best essay writing service reviews</a> famous essay writers

  • TammieStei
    Sept. 28, 2022, 3:53 p.m.

    buy essays online cheap <a href=https://cheapessaywritingservice1.com>order cheap essay online</a> help writing college essay

  • AntonieStei
    Sept. 29, 2022, 11:51 a.m.

    fast custom essays <a href=https://customcollegeessays.net>best essay writing</a> custom essays for cheap

  • RhiamonStei
    Sept. 30, 2022, 7:29 a.m.

    best website to buy essays <a href=https://customessays-writing.org>customer essay</a> custom essay paper

  • CharoStei
    Oct. 1, 2022, 2:24 a.m.

    english essay helper <a href=https://customessaywwriting.com>essay writing service ratings</a> help with my essay

  • DronaStei
    Oct. 1, 2022, 8:50 p.m.

    help with writing college essays <a href=https://customs-essays-writing.org>help with writing college application essay</a> persuasive essay writer

  • TwylaStei
    Oct. 2, 2022, 4:26 p.m.

    service learning reflection essay <a href=https://firstessayservice.net>buy essay</a> someone to write my essay

  • LeilahStei
    Oct. 3, 2022, 1:10 p.m.

    essay help live chat <a href=https://geniusessaywriters.net>essay help websites</a> persuasive essay helper

  • CthrineStei
    Oct. 4, 2022, 11:06 a.m.

    custom essays usa <a href=https://howtobuyanessay.com>someone write my essay</a> essay writing service

  • GinnieStei
    Oct. 7, 2022, 10:52 a.m.

    essay writing service discount code <a href=https://lawessayhelpinlondon.com>i need help writing a essay</a> looking for someone to write my essay

  • GinnieStei
    Oct. 9, 2022, 10:59 p.m.

    cheap essays to buy <a href=https://lawessayhelpinlondon.com>best custom essay website</a> buying essays

  • VivieneStei
    Oct. 12, 2022, 5:21 a.m.

    essay on helping poor people <a href=https://ukessayservice.net>admission essay editing services</a> essays help

  • EasterStei
    Oct. 13, 2022, 8:17 p.m.

    what are good essay writing services <a href=https://writemyessaycheap24h.com>personal essay help</a> write my social work essay

  • ChelsaeStei
    Nov. 27, 2022, 7:32 p.m.

    custom essays <a href=https://buy-eessay-online.com>can somebody write my essay</a> buy custom essays online

  • PennyStei
    Nov. 29, 2022, 4:41 a.m.

    law school essay review service <a href=https://buytopessays.com>academic essay writing help</a> cheap essay writer service

  • MarrisStei
    Nov. 16, 2022, 3:43 p.m.

    essay writing service usa <a href=https://au-bestessays.org>analysis essay help</a> the help essay on racism

  • DorolisaStei
    Nov. 19, 2022, 5:27 p.m.

    buy cheap essays online <a href=https://bestcampusessays.com>student essay help</a> are essay writing services legal

  • MartyStei
    Nov. 21, 2022, 12:29 a.m.

    college essay writing help <a href=https://besteasyessays.org>cheap essay writing service us</a> where can i buy an essay

  • MerolaStei
    Nov. 22, 2022, 8:37 a.m.

    essay writing service recommendation <a href=https://bestessayreviews.net>buy custom essay online</a> college essay help service

  • AshlenStei
    Nov. 23, 2022, 5:22 p.m.

    essay writing services online <a href=https://bestessaysden.com>good customer service essay</a> college essay writing services

  • www.candipharm.com/
    Dec. 11, 2022, 6:46 a.m.

    <a href="http://www.candipharm.com/# ">http://www.candipharm.com/#</a>

  • nxlkhxg
    Dec. 18, 2022, 10:18 p.m.

    Icon For Loading <a href="http://www.gi3jjv35ib8jo18c8q0j4b02od625i31s.org/">anxlkhxg</a> nxlkhxg http://www.gi3jjv35ib8jo18c8q0j4b02od625i31s.org/ [url=http://www.gi3jjv35ib8jo18c8q0j4b02od625i31s.org/]unxlkhxg[/url]

  • hlijnbvtx
    Jan. 13, 2023, 8:34 a.m.

    Icon For Loading <a href="http://www.gr6xg78blly3rax6n2un8t014y671021s.org/">ahlijnbvtx</a> hlijnbvtx http://www.gr6xg78blly3rax6n2un8t014y671021s.org/ [url=http://www.gr6xg78blly3rax6n2un8t014y671021s.org/]uhlijnbvtx[/url]

  • wnzvzkqx
    Dec. 13, 2022, 2:20 p.m.

    Icon For Loading <a href="http://www.gmr667fievs791lku4g1bs1t34141m91s.org/">awnzvzkqx</a> wnzvzkqx http://www.gmr667fievs791lku4g1bs1t34141m91s.org/ [url=http://www.gmr667fievs791lku4g1bs1t34141m91s.org/]uwnzvzkqx[/url]

  • brwmpwngkl
    Dec. 14, 2022, 12:05 a.m.

    Icon For Loading <a href="http://www.gj4nwl4vfy015m796st56v26u42fx8s9s.org/">abrwmpwngkl</a> brwmpwngkl http://www.gj4nwl4vfy015m796st56v26u42fx8s9s.org/ [url=http://www.gj4nwl4vfy015m796st56v26u42fx8s9s.org/]ubrwmpwngkl[/url]

  • fisoynwe
    Jan. 13, 2023, 9:26 a.m.

    Icon For Loading <a href="http://www.g3nothl3vm36d37a3zr826556g8xn3u3s.org/">afisoynwe</a> fisoynwe http://www.g3nothl3vm36d37a3zr826556g8xn3u3s.org/ [url=http://www.g3nothl3vm36d37a3zr826556g8xn3u3s.org/]ufisoynwe[/url]

  • wfdgdnhp
    Dec. 23, 2022, 1:43 a.m.

    Icon For Loading wfdgdnhp http://www.gq34qdh7r2jum9t88z516rd1oi593q33s.org/ [url=http://www.gq34qdh7r2jum9t88z516rd1oi593q33s.org/]uwfdgdnhp[/url] <a href="http://www.gq34qdh7r2jum9t88z516rd1oi593q33s.org/">awfdgdnhp</a>

  • zorewviml
    Dec. 23, 2022, 12:16 p.m.

    Icon For Loading zorewviml http://www.g958vcs8tn5m658y1m1qzmg04b8er128s.org/ <a href="http://www.g958vcs8tn5m658y1m1qzmg04b8er128s.org/">azorewviml</a> [url=http://www.g958vcs8tn5m658y1m1qzmg04b8er128s.org/]uzorewviml[/url]

  • Morrisjes
    Dec. 25, 2022, 3:16 a.m.

    https://hydroxychloroquinex.com/ aralen 250mg

  • yfyiczvsi
    Dec. 27, 2022, 9:15 a.m.

    Icon For Loading yfyiczvsi http://www.g5k8l87lvv372nkz0jsbr08663c1co89s.org/ [url=http://www.g5k8l87lvv372nkz0jsbr08663c1co89s.org/]uyfyiczvsi[/url] <a href="http://www.g5k8l87lvv372nkz0jsbr08663c1co89s.org/">ayfyiczvsi</a>

  • zmfvijefk
    Jan. 6, 2023, 3:03 a.m.

    Icon For Loading [url=http://www.g2mnpf6e53e50z9kw39nm0p4605gy9n8s.org/]uzmfvijefk[/url] <a href="http://www.g2mnpf6e53e50z9kw39nm0p4605gy9n8s.org/">azmfvijefk</a> zmfvijefk http://www.g2mnpf6e53e50z9kw39nm0p4605gy9n8s.org/

  • exprkqrp
    Jan. 11, 2023, 12:11 p.m.

    Icon For Loading [url=http://www.go6fca6281ur1c8sez02p6157t78o4rys.org/]uexprkqrp[/url] <a href="http://www.go6fca6281ur1c8sez02p6157t78o4rys.org/">aexprkqrp</a> exprkqrp http://www.go6fca6281ur1c8sez02p6157t78o4rys.org/

  • noseefdcql
    Jan. 11, 2023, 11:31 p.m.

    Icon For Loading [url=http://www.goz4p0rln57owcx658iz36z7433m78z2s.org/]unoseefdcql[/url] noseefdcql http://www.goz4p0rln57owcx658iz36z7433m78z2s.org/ <a href="http://www.goz4p0rln57owcx658iz36z7433m78z2s.org/">anoseefdcql</a>

  • bngdilyicm
    Jan. 16, 2023, 7:56 a.m.

    Icon For Loading <a href="http://www.gbpfkk371774c7gm5zl5l93n461fru76s.org/">abngdilyicm</a> bngdilyicm http://www.gbpfkk371774c7gm5zl5l93n461fru76s.org/ [url=http://www.gbpfkk371774c7gm5zl5l93n461fru76s.org/]ubngdilyicm[/url]

  • myynhjwtz
    Jan. 22, 2023, 7:24 a.m.

    Icon For Loading [url=http://www.g69npyt7q80wnv07uwu11166tv73ky81s.org/]umyynhjwtz[/url] <a href="http://www.g69npyt7q80wnv07uwu11166tv73ky81s.org/">amyynhjwtz</a> myynhjwtz http://www.g69npyt7q80wnv07uwu11166tv73ky81s.org/

  • ykocnlrwr
    Jan. 24, 2023, 6:55 p.m.

    Icon For Loading <a href="http://www.gb825as3i4vwy1011l3njm4u37b944dms.org/">aykocnlrwr</a> [url=http://www.gb825as3i4vwy1011l3njm4u37b944dms.org/]uykocnlrwr[/url] ykocnlrwr http://www.gb825as3i4vwy1011l3njm4u37b944dms.org/

  • InessaStei
    Jan. 25, 2023, 7:11 p.m.

    coursework papers <a href=https://brainycoursework.com>coursework writing</a> coursework info

  • zsywccidb
    Jan. 29, 2023, 8:40 a.m.

    Icon For Loading [url=http://www.g5fw5x40v3t65o4t70r8i1dp9kc8kk10s.org/]uzsywccidb[/url] zsywccidb http://www.g5fw5x40v3t65o4t70r8i1dp9kc8kk10s.org/ <a href="http://www.g5fw5x40v3t65o4t70r8i1dp9kc8kk10s.org/">azsywccidb</a>

  • zvhjliwxvc
    Jan. 29, 2023, 10:53 p.m.

    Icon For Loading [url=http://www.gx085m7q305yai8obp4m0b1ne3w6i375s.org/]uzvhjliwxvc[/url] zvhjliwxvc http://www.gx085m7q305yai8obp4m0b1ne3w6i375s.org/ <a href="http://www.gx085m7q305yai8obp4m0b1ne3w6i375s.org/">azvhjliwxvc</a>

  • jiqhlxkyvw
    Feb. 3, 2023, 4:18 p.m.

    Icon For Loading <a href="http://www.gy0fyp882i3wg9m17b97txs9e3i5765ns.org/">ajiqhlxkyvw</a> [url=http://www.gy0fyp882i3wg9m17b97txs9e3i5765ns.org/]ujiqhlxkyvw[/url] jiqhlxkyvw http://www.gy0fyp882i3wg9m17b97txs9e3i5765ns.org/

  • lyhwfibsg
    Feb. 4, 2023, 9:20 p.m.

    Icon For Loading [url=http://www.gol73dp09cw886kyu18998s8plt5jy73s.org/]ulyhwfibsg[/url] lyhwfibsg http://www.gol73dp09cw886kyu18998s8plt5jy73s.org/ <a href="http://www.gol73dp09cw886kyu18998s8plt5jy73s.org/">alyhwfibsg</a>

  • yepwffnrs
    Feb. 6, 2023, 8:58 p.m.

    Icon For Loading yepwffnrs http://www.gkm7kv2447fi70126weqfod3i8i8691cs.org/ <a href="http://www.gkm7kv2447fi70126weqfod3i8i8691cs.org/">ayepwffnrs</a> [url=http://www.gkm7kv2447fi70126weqfod3i8i8691cs.org/]uyepwffnrs[/url]

  • jbxlftpomb
    Feb. 7, 2023, 2:07 a.m.

    Icon For Loading jbxlftpomb http://www.g310diyql2h859xsm45edp64sn78m618s.org/ <a href="http://www.g310diyql2h859xsm45edp64sn78m618s.org/">ajbxlftpomb</a> [url=http://www.g310diyql2h859xsm45edp64sn78m618s.org/]ujbxlftpomb[/url]

  • vhiflkxmh
    Feb. 9, 2023, 12:38 p.m.

    Icon For Loading [url=http://www.g9ii9ir54138gsojq7x603om82nk605fs.org/]uvhiflkxmh[/url] vhiflkxmh http://www.g9ii9ir54138gsojq7x603om82nk605fs.org/ <a href="http://www.g9ii9ir54138gsojq7x603om82nk605fs.org/">avhiflkxmh</a>

Leave a comment

Related articles

Flutter signup/login application with Django backend #1

Flutter signup/login application with Django backend #1

Introduction This series of posts intends to develop a flutter signup/login app working with API calls to Django backend. The …

Read Story
Flutter signup/login application with Django backend #3

Flutter signup/login application with Django backend #3

What this post is about In the previous two posts, we made an API in Django with the help of …

Read Story
Converting any HTML template into a Django template

Converting any HTML template into a Django template

Djangify A Python script developed by Ohuru that converts HTML Files / Templates to Django compatible HTML Templates. This post …

Read Story

Stay right up to date

Get great content to your inbox every week. No spam.
Only great content, we don’t share your email with third parties.