Deploy a Django App to Heroku

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ต.ค. 2024

ความคิดเห็น • 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!

  • @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.

    • @khairulgazali3402
      @khairulgazali3402 3 ปีที่แล้ว

      @@sreenivasramakrishnan3328 same problem to me

  • @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!

  • @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.

  • @samirthapa792
    @samirthapa792 3 ปีที่แล้ว

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

  • @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?

  • @ЭрикАракельян
    @ЭрикАракельян 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(

  • @deep.extrospection
    @deep.extrospection 4 ปีที่แล้ว

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

  • @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!

  • @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: th-cam.com/video/UONBTxjUGDQ/w-d-xo.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

  • @fransubaru
    @fransubaru 3 ปีที่แล้ว

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

  • @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

  • @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!

  • @cgthejesh
    @cgthejesh 3 ปีที่แล้ว

    Finally simple and straight forward video

  • @patralekhabhattacharjee4225
    @patralekhabhattacharjee4225 3 ปีที่แล้ว

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

  • @avisekssarma5592
    @avisekssarma5592 4 ปีที่แล้ว +1

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

  • @sebastiancastillo3560
    @sebastiancastillo3560 4 ปีที่แล้ว

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

  • @taiwoodetola5987
    @taiwoodetola5987 3 ปีที่แล้ว

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

  • @choozihengwayne7976
    @choozihengwayne7976 3 ปีที่แล้ว +2

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

  • @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.

  • @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?

  • @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.

  • @nirmankesari9703
    @nirmankesari9703 4 ปีที่แล้ว

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

  • @IsraelGuido
    @IsraelGuido 4 ปีที่แล้ว

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

  • @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!

  • @fattijenishbek
    @fattijenishbek 2 ปีที่แล้ว

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

  • @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

  • @chopraraghav2180
    @chopraraghav2180 4 ปีที่แล้ว

    Thank you for this flawless tutorial.

  • @alexlindgren1
    @alexlindgren1 3 ปีที่แล้ว

    Very good explanation, thanks!

  • @porsheaellis6320
    @porsheaellis6320 4 ปีที่แล้ว

    This video really help me out. Thank You!

  • @Chiny_w_Pigulce
    @Chiny_w_Pigulce 3 ปีที่แล้ว +1

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

  • @lugh5188
    @lugh5188 3 ปีที่แล้ว

    Thank you so much, really understandable and straight forward content

  • @victorshaviya1921
    @victorshaviya1921 2 ปีที่แล้ว

    This was so helpful. Thanks.

  • @patriciav.p.9034
    @patriciav.p.9034 3 ปีที่แล้ว

    Perfect! This is what I needed. Thanks!

  • @mutemijr4329
    @mutemijr4329 3 ปีที่แล้ว +1

    Thanks Anthony..... Thumbs Up

  • @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

  • @erichganz4605
    @erichganz4605 3 ปีที่แล้ว

    THIS HELPED ME SO MUCH!

  • @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?

  • @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??

  • @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.

  • @ulanbuzhbanov1463
    @ulanbuzhbanov1463 2 ปีที่แล้ว

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

    ModuleNotFoundError: No module named 'fcntl'

  • @zed8970
    @zed8970 3 ปีที่แล้ว

    Thanks for this great video. It helped a lot.

  • @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

  • @prateeksarangi9187
    @prateeksarangi9187 3 ปีที่แล้ว

    Thanks Anthony

  • @olha_
    @olha_ 4 ปีที่แล้ว

    Awesome tutorial. Thank you so much!

  • @JitTechLearning
    @JitTechLearning 4 ปีที่แล้ว +1

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

  • @johntygomes6519
    @johntygomes6519 3 ปีที่แล้ว

    Thanks Alot My Friend ..God Bless You

  • @pbanikk
    @pbanikk 3 ปีที่แล้ว

    Thanks alot for the video!

  • @magiccode3396
    @magiccode3396 4 ปีที่แล้ว

    really useful tutorial bro keep it up THANKS

  • @devprakash5320
    @devprakash5320 3 ปีที่แล้ว

    best explanation ever . Thanks a ton man

  • @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

  • @classicguy7813
    @classicguy7813 4 ปีที่แล้ว +2

    Great, thanks. When I write gunicorn TH-camr.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
      th-cam.com/video/MoX36izzEWY/w-d-xo.html&ab_channel=buildwithpython

  • @101kawsar
    @101kawsar 2 ปีที่แล้ว

    Thank you very much man 🥺

  • @adityar6511
    @adityar6511 4 ปีที่แล้ว

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

  • @agustinmariapardo9832
    @agustinmariapardo9832 3 ปีที่แล้ว

    Hi, What modules do you have in requirements?

  • @13.nguyenviethiep42
    @13.nguyenviethiep42 3 ปีที่แล้ว

    Thanks. This video is useful

  • @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..

  • @rajsrikantha7914
    @rajsrikantha7914 4 ปีที่แล้ว

    . 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.

  • @SwIsH189
    @SwIsH189 3 ปีที่แล้ว

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

  • @danielspring1574
    @danielspring1574 4 ปีที่แล้ว

    Good tutorial. Thanks for your work

    • @prettyprinted
      @prettyprinted  4 ปีที่แล้ว +1

      You are welcome! Thanks for watching.

  • @denosorus
    @denosorus 2 ปีที่แล้ว

    Very noice explanation❤

  • @BearVodkaAndValenki
    @BearVodkaAndValenki 4 ปีที่แล้ว

    Very helpful. Thanks a lot)

  • @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

  • @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

  • @patrickkurii
    @patrickkurii 4 ปีที่แล้ว +1

    why my static cant load to my website ?

  • @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

  • @rahulranjan9589
    @rahulranjan9589 4 ปีที่แล้ว

    Thanks sir. It really helped

  • @Jacob_c810
    @Jacob_c810 2 ปีที่แล้ว

    banger video 11/10

  • @julizamt
    @julizamt 4 ปีที่แล้ว

    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 4 ปีที่แล้ว

      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

  • @lisali6205
    @lisali6205 3 ปีที่แล้ว

    Thank you so much !

  • @jasondportfolio6752
    @jasondportfolio6752 4 ปีที่แล้ว

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

  • @riskzerobeatz
    @riskzerobeatz 4 ปีที่แล้ว

    Great. Thank you!

  • @michelled1557
    @michelled1557 4 ปีที่แล้ว

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

  • @wanyoikedanny472
    @wanyoikedanny472 2 ปีที่แล้ว

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

  • @owendyer3192
    @owendyer3192 3 ปีที่แล้ว

    How did you get Gunicorn to work on windows

  • @harshparashar1837
    @harshparashar1837 4 ปีที่แล้ว

    soooo much helpful love you 3000 buddy

  • @kunalgautam8312
    @kunalgautam8312 2 ปีที่แล้ว

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

  • @joelvasquez8478
    @joelvasquez8478 4 ปีที่แล้ว

    What the difference between using postgress and mysql?

  • @lyndonhodges2503
    @lyndonhodges2503 3 ปีที่แล้ว

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

  • @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

  • @rogeliomarmol8841
    @rogeliomarmol8841 4 ปีที่แล้ว

    Thanks so much bro!

  • @ぺんぎん太郎-p5i
    @ぺんぎん太郎-p5i 4 ปีที่แล้ว

    Thank you!!

  • @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 .

  • @navjotaadgenix431
    @navjotaadgenix431 3 ปีที่แล้ว

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

  • @SpiderMan-wk4gk
    @SpiderMan-wk4gk 3 ปีที่แล้ว

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

  • @Carvalheirafc
    @Carvalheirafc 3 ปีที่แล้ว

    Thanks Sir

  • @davi1488
    @davi1488 4 ปีที่แล้ว

    thank you very much buddy

  • @stevengutierrez9931
    @stevengutierrez9931 3 ปีที่แล้ว

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

  • @saliksheraz6236
    @saliksheraz6236 3 ปีที่แล้ว

    Thanks alot bro

  • @nandalala7915
    @nandalala7915 3 ปีที่แล้ว

    Any facing error in psycopg2 version changed.

  • @tpzd1063
    @tpzd1063 2 ปีที่แล้ว

    I get [remote rejected] master -> master (pre-receive hook declined)