Deploy a Django App to Heroku

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • Getting Django project working on Heroku along with a Postgres database.
    WORK WITH ME👇🏼
    ✅ Implement features and fix bugs in your app: Live, one-on-one screenshare
    prettyprinted....
    💻 Code written in video
    prettyprinted....
    Django Database Essentials course: prettyprinted....

Комментарии • 195

  • @prettyprinted
    @prettyprinted  4 года назад +5

    Want to learn Django so you can build your own web apps? Join my Understanding Django course: courses.prettyprinted.com/p/understanding-django

  • @LiveCustoms
    @LiveCustoms 4 года назад +35

    Finally a Heroku hosting video that is straightforward and actually explains step by step from beginning how to get an app running. Thumbs Up!

    • @rangarajann1781
      @rangarajann1781 4 года назад +1

      It is way best when compared with other videos.but if you follow the same steps explained here you will face an error.you'll find only on deployment.
      The error is,
      Heroku will not store image files even though you use whitenoise (it will help to store only static files) the Heroku will delete all media files from its repository for security purpose (I'm not sure this was the reason).it will work fine for the first time.But it will delete the images.

    • @darren_baldwin
      @darren_baldwin 3 года назад +2

      When I start and run Heroku local I get an error saying "Not found: /Statics/etc/etc" How do I fix this?

    • @iamspeare
      @iamspeare 3 года назад

      @@sreenivasramakrishnan3328 Are you using Wndows? gunicorn doesn't run on Windows, try waitress

  • @IrregularInterest
    @IrregularInterest 3 года назад +3

    This is by far the most user-friendly guide I've seen yet for hosting Django on Heroku. Thanks for the great content!

  • @erectlocution
    @erectlocution 4 года назад +30

    Anthony you've got a really great way of cutting straight to the point and making things clear. Thanks for your years of work.

  • @ZayyanMasud
    @ZayyanMasud 4 года назад +1

    You are a gem in this dark dark world. Straight to the point without beating around the bush. Every thought of reading books? You voice is soothing too.

  • @ricardocambundo2527
    @ricardocambundo2527 3 года назад

    I spent 5 days trying to deploy with heroku with books and other vids. Had a lot of problems especially with the database configuration. As soon as a saw this vid in list than 5 minutes, I deployed with no problems. Thanks for the videos man, really loved it.

  • @tizyanoonie8483
    @tizyanoonie8483 3 года назад

    Wow!
    I came here to see how to deploy my Django project to Heroku and actually got much more - now my app is running on PostgreSQL and will not lose its db files thanks to you!

  • @abdullabektaev4318
    @abdullabektaev4318 3 года назад +1

    Thanks man, you helped me with an issue that I was stuck with for about 2 days.

  • @n02Monster
    @n02Monster 3 года назад

    Thank you so much it saved a lot of my time to find all this in one video, instead to finding fault and searching around for answers.

  • @rem.kudusov
    @rem.kudusov 3 года назад

    Dude, that's the way! Thank you for your great explanation of all issue about loading django website on heroku!

  • @rendoxal
    @rendoxal 3 года назад

    Excellent walk-thru of how to bring Django and Heroku together. I have past experience with Django, but very new to Heroku. This really bridged that gap for me! Great work!

    • @kudakwashedzorani7576
      @kudakwashedzorani7576 3 года назад

      @@sreenivasramakrishnan3328 Hello, did you get help? I am stuck too?

  • @fransubaru
    @fransubaru 3 года назад

    Thank you very much for this info!! I was struggling with heroku :( , and now everything is working.

  • @deep.extrospection
    @deep.extrospection 4 года назад

    Short and effective video. Thanks, I just deployed my first heroku app without any problem.

  • @okanyldrmop
    @okanyldrmop 4 года назад +3

    It's a great tutorial, 10/10.
    For people who gets some errors like "fcntl", it is because of gunicorn, you can try to publish on linux or linux subsystem.

    • @rangarajann1781
      @rangarajann1781 4 года назад

      Yes!!!guinicorn is not for windows.But most of the servers(including heroku) run on linux.if anyone runs gunicorn from windows they will get this error.

    • @kireetipydisetty4902
      @kireetipydisetty4902 4 года назад

      @@rangarajann1781 is there a solution for this?

    • @rangarajann1781
      @rangarajann1781 4 года назад

      Linux is the only solution for this.

    • @aissazergoun812
      @aissazergoun812 4 года назад

      then how is using it on windows ?

    • @rangarajann1781
      @rangarajann1781 4 года назад

      @@aissazergoun812 he is using Windows subsystem for linux.(WSL)
      i.e.,he is running Linux terminal on his. Windows machine using WSL.

  • @darianewmann796
    @darianewmann796 4 года назад +17

    hi i'm working thorugh your tutorial and I'm having an error of "ModuleNotFoundError: No module named 'fcntl'' just wondering if you have ever seen this or how I can fix this

    • @erectlocution
      @erectlocution 4 года назад +3

      It looks like, per this Stack Overflow answer [1] and the Python documentation [2], the `fcntl` library provides an interface to the `fcntl` utility found only on Unix/Linux systems.
      [1] stackoverflow.com/questions/45228395/error-no-module-named-fcntl
      [2] docs.python.org/3/library/fcntl.html?highlight=fcntl#module-fcntl

    • @Bateaos
      @Bateaos 4 года назад +6

      Just in case that you haven't found an answer, `fcntl` library is for unix systems, not for windows, there is a way though to install it in windows using www.cygwin.com/ and using its terminal to install python.
      reference: ruclips.net/video/UONBTxjUGDQ/видео.html -> check on the comments

    • @JustinEpperly
      @JustinEpperly 3 года назад

      Are you using Windows? You probably are, according to two good answers on this thread from @Daniel Black and @Bateaos.
      Just to be clear, this is the kind of error you get if you're using Windows. @Bateaos suggestion of cygwin is the right suggestion.

    • @Shivam_Manswalia
      @Shivam_Manswalia 3 года назад +1

      @@JustinEpperly bro look at video guy is also using windows.

    • @55.yashgoyal40
      @55.yashgoyal40 2 года назад

      I got the same error. Acc to stack overflow, unicorn does not support windows, there's a module called waitress (an alternative for unicorn)
      Try that

  • @ЭрикАракельян
    @ЭрикАракельян 3 года назад +4

    This tutorial is nice. Thank u! But... When we deploy, we have to choose debag=false. There is another work with static/media files. U don't show it in this video(

  • @samirthapa792
    @samirthapa792 3 года назад

    Your videos really help me to deploy app to Heroku which I wasn't able to do. Thanks for your effort.

  • @taiwoodetola5987
    @taiwoodetola5987 3 года назад

    wow. I must say this video is just perfect. It explains everything. Thanks a lot PrettyPrinted

  • @patralekhabhattacharjee4225
    @patralekhabhattacharjee4225 3 года назад

    One if the best videos on deployment !!!!!Thanks so much.

  • @infinitx1330
    @infinitx1330 3 года назад

    The most easy and best explanation for this topic, you explain each part step by step along with the reason why we need it, thanks a lot

  • @avisekssarma5592
    @avisekssarma5592 4 года назад +1

    Thank you. That was spot on , so perfect for serving static files too.

  • @cgthejesh
    @cgthejesh 3 года назад

    Finally simple and straight forward video

  • @WillieGaldamez
    @WillieGaldamez 4 года назад

    love your content man. clear. understandable. knowledgeable. great communications skills

    • @WillieGaldamez
      @WillieGaldamez 3 года назад

      @@sreenivasramakrishnan3328 hi! i believe this error is because gunicorn is not compatible with microsoft windows. you might want to use a windows server like waitress.
      or you can skip testing the app with gunicorn on your windows machine and go straight to deploying your app to a gunicorn server on heroku.
      i hope this helps.

  • @fattijenishbek
    @fattijenishbek 2 года назад

    I really like your videos) Thanks a lot.!! This was my problem for 10 days ....(

  • @sebastiancastillo3560
    @sebastiancastillo3560 4 года назад

    Thank you Anthony for the big help !! This is perfect for these moments.

  • @gianfrancosalomone7608
    @gianfrancosalomone7608 3 года назад

    I loved this series!
    Side note: I had to pip install django-on-heroku to be able to upload to heroku. Other than that, everything was on point!

  • @choozihengwayne7976
    @choozihengwayne7976 3 года назад +2

    How to use Gui corn on windows I keep getting the fcntl error

  • @reginaldpradel9809
    @reginaldpradel9809 3 года назад +2

    So...I installed gunicorn
    "Requirement already satisfied: gunicorn in /Users/reginaldpradel/Library/Python/3.8/lib/python/site-packages (20.1.0)"
    but then get this when i check "gunicorn --version": -bash: gunicorn: command not found
    Help :'(

  • @sanjiblamichhane
    @sanjiblamichhane 2 года назад +1

    ModuleNotFoundError: No module named 'fcntl' On windows. Apparently 'fcntl' is not available for windows. Do you have any suggestion for its alternative?

  • @victorshaviya1921
    @victorshaviya1921 2 года назад

    This was so helpful. Thanks.

  • @nirmankesari9703
    @nirmankesari9703 4 года назад

    Awesome work mate, it answers a lot of my questions. Thanks a lot!

  • @Izzat-bj1le
    @Izzat-bj1le 4 года назад +4

    It's gunicorn is not working on windows what should I do??? ModuleNotFoundError: No module named 'fcntl'

    • @andrey__shintar
      @andrey__shintar 3 года назад

      Did you solve it?

    • @Izzat-bj1le
      @Izzat-bj1le 3 года назад

      @@andrey__shintar no

    • @Izzat-bj1le
      @Izzat-bj1le 3 года назад

      @@sreenivasramakrishnan3328 after installing linux it worked

  • @hroman_codes
    @hroman_codes 2 года назад

    Should the DB credentials in the SETTINGS file be stored in a .env file and then referenced in the SETTINGS file? I know this is an example project but just thinking about my own project and security.

  • @IsraelGuido
    @IsraelGuido 4 года назад

    Thanks Anthony, you shortener much time for me, this video is amazing

  • @porsheaellis6320
    @porsheaellis6320 4 года назад

    This video really help me out. Thank You!

  • @erichganz4605
    @erichganz4605 3 года назад

    THIS HELPED ME SO MUCH!

  • @Andrewiththeaudi
    @Andrewiththeaudi 4 года назад

    Respect on how you navigate around django, thanks for the good content. Would you do a similar video with an asgi-server+channels? Bonus: with celery

  • @alexlindgren1
    @alexlindgren1 3 года назад

    Very good explanation, thanks!

  • @lugh5188
    @lugh5188 3 года назад

    Thank you so much, really understandable and straight forward content

  • @yessirskiii007
    @yessirskiii007 2 года назад

    So if I write my CSS straight inside my .html file and not in a separate .css file, I don't need to worry about the possible static file related errors?

  • @shalomalexander7811
    @shalomalexander7811 4 года назад +1

    So basically, We don't require PostgreSQL locally in our machine?? You have directly connected to Heroku PostgreSQL???

    • @rangarajann1781
      @rangarajann1781 4 года назад

      Yes we don't need to have postgres database on our machine.heroku creates one for us.

  • @kevindongmo7046
    @kevindongmo7046 3 года назад

    Wowwwww subscribed and liked. If i could like 10000 times i would have done that. Thanks alot

  • @jitendrasinghjeena9166
    @jitendrasinghjeena9166 4 года назад

    Excellent tutorial. I created a portfoilo app and I successfully migrated all my tables like skills, projects in the Postgres. But I was unable to transfer the content of the tables. Can you suggest me some ways I can do this.

  • @chopraraghav2180
    @chopraraghav2180 4 года назад

    Thank you for this flawless tutorial.

  • @cesarf.7587
    @cesarf.7587 4 года назад +1

    Thanks you so much, i've been looking for a solution since last week, you're a lifesaver!!! But now i have this issue my static files are not working and i did everything as you did, what could be wrong?

    • @rangarajann1781
      @rangarajann1781 4 года назад

      did you mean images files or css and js files??

  • @mutemijr4329
    @mutemijr4329 3 года назад +1

    Thanks Anthony..... Thumbs Up

  • @zed8970
    @zed8970 3 года назад

    Thanks for this great video. It helped a lot.

  • @ankushsarkar1746
    @ankushsarkar1746 4 года назад +1

    Pls make a vid on how to serve a vue app using flask. I m learning vue rn and after reading so many articles about stuff that i m not looking for , my head is melting.

    • @prettyprinted
      @prettyprinted  4 года назад +3

      I want to cover Vue sometime this year. Look out for the videos!

  • @JitTechLearning
    @JitTechLearning 4 года назад +1

    Well Explained. One of the best and detailed tutorials. From +254, Thank you so much, sir.

  • @abduksam
    @abduksam 3 года назад +1

    yo my boi helped me man

    • @abduksam
      @abduksam 3 года назад +1

      @@sreenivasramakrishnan3328 you have to specify the packages in requirements.txt and also which python version you want to use on runtime.txt and if you are using Django 3.1 or above you might get errors because the support of Django 3.1 is not available right now

  • @patriciav.p.9034
    @patriciav.p.9034 3 года назад

    Perfect! This is what I needed. Thanks!

  • @ulanbuzhbanov1463
    @ulanbuzhbanov1463 2 года назад

    Hi!
    Did you faced with problem
    from gunicorn import util
    import fcntl

    ModuleNotFoundError: No module named 'fcntl'

  • @sahiltrivedi69
    @sahiltrivedi69 4 года назад +1

    Thanks bro you really helped me out I was in a difficult spot God Bless

    • @sahiltrivedi69
      @sahiltrivedi69 3 года назад

      @@sreenivasramakrishnan3328 did you create a procfile? I haven't run gunicorn but procfile is a must

    • @farhoodva
      @farhoodva 3 года назад

      @@sreenivasramakrishnan3328 that's because gunicorn is linux only, no one was in hurry to mention that, and comments are just a** kissing, there is a walkaound but just install and use 'waitress' on windows

  • @denosorus
    @denosorus 2 года назад

    Very noice explanation❤

  • @Chiny_w_Pigulce
    @Chiny_w_Pigulce 3 года назад +1

    According to whitenoise documentation, it should be added just below security middleware, not at the bottom.

  • @magiccode3396
    @magiccode3396 3 года назад

    really useful tutorial bro keep it up THANKS

  • @devprakash5320
    @devprakash5320 3 года назад

    best explanation ever . Thanks a ton man

  • @13.nguyenviethiep42
    @13.nguyenviethiep42 3 года назад

    Thanks. This video is useful

  • @101kawsar
    @101kawsar 2 года назад

    Thank you very much man 🥺

  • @johntygomes6519
    @johntygomes6519 3 года назад

    Thanks Alot My Friend ..God Bless You

  • @agustinmariapardo9832
    @agustinmariapardo9832 3 года назад

    Hi, What modules do you have in requirements?

  • @CodeViral
    @CodeViral 3 года назад +1

    sir While running gunicorn i am gettin this error :
    "ModuleNotFoundError: No module named 'fcntl' "
    help please

    • @SpiderMan-wk4gk
      @SpiderMan-wk4gk 3 года назад +1

      same me and i dont have find proplem that, and i wating another guide

    • @CodeViral
      @CodeViral 3 года назад +1

      @@SpiderMan-wk4gk i got the solution ..
      Instead of gunicorn i used waitress ..
      We are getting this problem because gunicorn is not supported on windows ..
      And waitress is supported on both windows amd linux ..
      You can install waitress by :-
      pip install waitress
      And to start development server with that use :-
      waitress-serve --port=8000 django_project_name.wsgi:application
      It will start live production server on port 8000 ...
      Hope works for you ..
      Best of luck

  • @pbanikk
    @pbanikk 3 года назад

    Thanks alot for the video!

  • @julizamt
    @julizamt 3 года назад

    Hi! Nice tutorial. Everything went fine, except for the data I had in my development database didn´t migrate. I can add new data, so the db is working, but its empty. I did everything in the video, step by step. I´m using django 3.1, maybe that´s the problem?

    • @satyamdubey4529
      @satyamdubey4529 3 года назад

      After you deploy your app on Django the previous database is deleted, in order to make new database run this command
      heroku run python manage.py migrate

  • @classicguy7813
    @classicguy7813 4 года назад +2

    Great, thanks. When I write gunicorn RUclipsr.wsgi, it gives an error: "import fcntl
    ModuleNotFoundError: No module named 'fcntl'"

    • @RedElectrik
      @RedElectrik 4 года назад +3

      gunicorn doesn't work on windows. I'm currently looking for a solution myself but have not yet found one

    • @prathameshmali3888
      @prathameshmali3888 4 года назад +1

      @@RedElectrik Thanks man I switched to my laptop it has linux installed. We can use djangoheroku for windows. this is the tutorial I found for that which works with windows but he didn't added postgresql
      ruclips.net/video/MoX36izzEWY/видео.html&ab_channel=buildwithpython

  • @olha_
    @olha_ 4 года назад

    Awesome tutorial. Thank you so much!

  • @prateeksarangi9187
    @prateeksarangi9187 3 года назад

    Thanks Anthony

  • @danielflorez3762
    @danielflorez3762 4 года назад +1

    If i have windows i can't use gunicorn because the module 'fcntl' doesn't exist in windows. So i can't follow this tutorial?

    • @Tuliparama
      @Tuliparama 4 года назад

      you can use an alternative that works on Windows - Waitress

  • @anthonydattolo6297
    @anthonydattolo6297 3 года назад

    what about using environment vars with heroku config vars? can you make a video on this. django-heroku is not maintained and does not work with django3.1

  • @osmanhamashool6396
    @osmanhamashool6396 4 года назад +3

    I get this error how to solve it?
    No module named 'fcntl'

    • @veotic2728
      @veotic2728 3 года назад +1

      window users cant use it..

  • @SwIsH189
    @SwIsH189 3 года назад

    No module named 'fcntl'. Would be nice if you would have mentioned this doesn't work with Windows.

  • @BearVodkaAndValenki
    @BearVodkaAndValenki 3 года назад

    Very helpful. Thanks a lot)

  • @adityar6511
    @adityar6511 4 года назад

    i'm using pycharm ide,linux/dabian os, my Procfile doesn't automatically sign to heroku extension . what should I do

  • @rahulranjan9589
    @rahulranjan9589 4 года назад

    Thanks sir. It really helped

  • @danielspring1574
    @danielspring1574 4 года назад

    Good tutorial. Thanks for your work

    • @prettyprinted
      @prettyprinted  4 года назад +1

      You are welcome! Thanks for watching.

  • @jasondportfolio6752
    @jasondportfolio6752 4 года назад

    How to did you collect the static files ? using gunicorn and heroku local "static was not found'.

  • @Jacob_c810
    @Jacob_c810 2 года назад

    banger video 11/10

  • @rajsrikantha7914
    @rajsrikantha7914 3 года назад

    . Hi I have a problem. I get the error H14 message . for this command heroku ps:scale web=1 worker=2
    Scaling dynos... !
    ! Couldn't find that process type (web).
    Could you please help me to solve the problem.

  • @owendyer3192
    @owendyer3192 3 года назад

    How did you get Gunicorn to work on windows

  • @joelvasquez8478
    @joelvasquez8478 4 года назад

    What the difference between using postgress and mysql?

  • @enfimumahistoria9854
    @enfimumahistoria9854 4 года назад +1

    Hello. When I change my debug to False and send to Heroku I received the error "Not Found". What's happened?

    • @rangarajann1781
      @rangarajann1781 4 года назад

      I'm having the Same problem!!!

    • @enfimumahistoria9854
      @enfimumahistoria9854 4 года назад

      @@rangarajann1781 you already tried add the key DEBUG = False into Heroku env keys? This worked for me

  • @lisali6205
    @lisali6205 3 года назад

    Thank you so much !

  • @orlandog1979
    @orlandog1979 3 года назад

    I can upload all migrations to Heroku postgresql db...I need help. And at the same time receive a 500 error. I can't load my templates. :(.. This is frustrating

  • @patrickkurii
    @patrickkurii 3 года назад +1

    why my static cant load to my website ?

  • @lyndonhodges2503
    @lyndonhodges2503 3 года назад

    what if my wsgi is in my app inside multiple directories from the root what to fill in the Procfile?

  • @michelled1557
    @michelled1557 4 года назад

    this was so so informative, helpful and easy to follow! thank you so much for this tutorial!

  • @harshparashar1837
    @harshparashar1837 4 года назад

    soooo much helpful love you 3000 buddy

  • @simonm17
    @simonm17 4 года назад +3

    It looks like gunicorn is still incompatible with windows

  • @kunalgautam8312
    @kunalgautam8312 2 года назад

    can you help me please im getting error. I am unable to deploy on heroku

  • @wanyoikedanny472
    @wanyoikedanny472 2 года назад

    and i got this error in windows.....ModuleNotFoundError: No module named 'fcntl'

  • @deepak5911
    @deepak5911 3 года назад

    Hey thanks for detail version for deploying, i have a error while, i run heroku local command
    errror occurs: "Exited with exit code null"

    • @deepak5911
      @deepak5911 3 года назад

      i solved it just kill the process .

  • @rogeliomarmol8841
    @rogeliomarmol8841 4 года назад

    Thanks so much bro!

  • @stevengutierrez9931
    @stevengutierrez9931 3 года назад

    is it bad practice to add '*' to allowed_hosts?

  • @riskzerobeatz
    @riskzerobeatz 4 года назад

    Great. Thank you!

  • @davi1488
    @davi1488 4 года назад

    thank you very much buddy

  • @saliksheraz6236
    @saliksheraz6236 3 года назад

    Thanks alot bro

  • @hkrobotics-dev
    @hkrobotics-dev 3 года назад

    thank you :)

  • @navjotaadgenix431
    @navjotaadgenix431 3 года назад

    if i do this than i need to type manage.py? or its offical deploy in web? plesae help

  • @usmanimtiaz1519
    @usmanimtiaz1519 4 года назад

    Thank u so much bro :)

  • @SpiderMan-wk4gk
    @SpiderMan-wk4gk 3 года назад

    Hello everyone
    "ModuleNotFoundError: No module named 'fcntl' "
    help please