Deploy Django App To Railway | Alternative To Heroku | 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

ความคิดเห็น • 107

  • @the_proton_guy
    @the_proton_guy  2 ปีที่แล้ว +7

    HOW TO SOLVE STATIC FILES NOT SHOWING:
    Step 1:run pip install whitenoise
    step 2: run pip freeze > requirements.txt
    step 3: In middleware in your settings.py file, add this line below the first middle:
    "whitenoise.middleware.WhiteNoiseMiddleware",
    step 4: Configure static files. make sure you have something like this:
    STATIC_URL = '/static/'
    STATIC_ROOT = BASE_DIR / "staticfiles"
    STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
    ]
    step 5: Add this line to your settings.py file:
    STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
    step 6: run python manage.py collectstatic
    step 7: push to github and try to redeploy
    That should solve the issue

    • @polynomen
      @polynomen ปีที่แล้ว

      it throws error 500 in production

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Can you check the logs? To see of there's any error

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

      @@the_proton_guy I fix the 500 error by putting this object as in the white noise docs instead that storage:
      STORAGES = {
      "staticfiles": {
      "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
      },
      }
      anyway it doesn't show static files but only the components without styles. To activate styling you have to use the debug to True, but it s not recommended to use debug in production !

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

    Really appreciate your effort,thanks very much 🙏

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

    What is your 'Start Command from Deploy' in settings on railway?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      gunicorn ProjectName.wsgi --log-file -

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

    Hello,I have this problem
    Nixpacks build failed
    Error: Error reading requirements.txt
    Caused by:
    stream did not contain valid UTF-8

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

      I have the same problem

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

      Can you kindly shed more light on this error

    • @kishanKumar-co7wb
      @kishanKumar-co7wb 2 ปีที่แล้ว

      @@the_proton_guy Getting error can you help me??
      Nixpacks build failed
      Nixpacks was unable to generate a build plan for this app.

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

    This was really helpful, thanks.

  • @ransfordaddai9599
    @ransfordaddai9599 หลายเดือนก่อน

    bro please im getting this error, ive tried several times but still:
    You reached the start of the range → Nov 11, 2024 8:06 PM
    install │ python -m venv --copies /opt/venv && . /opt/venv/bin/activate ║

    ║──────────────────────────────────────────────────────────────────────────────║
    ║ start │
    Error: No start command could be found
    i have the requirements.txt, and this is also my procfile :web: gunicorn 'flaskblog:create_app()'
    please ive tried several times and it's not working, please i would really appreciate your help

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

    Hello , how do I add superuser to my django app on heroku

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      For this, you will need to go to your app on heroku. Next, you'll need to click the button labelled more on the top right of your screen. Next select run console. After that, a window should pop up where you can run commands. So just run python manage.py createsuperuser and all should work

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

      I never deployed the project to heroku . I only deployed it railways. Does it mean I have to again deploy it to heroku for it to create superuser

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      No, what you need to do is add a database to your project on railway. Luckily, they have a PostgresSQL database you can use as an add-on to your project. this link below will take you to an article that will teach you how to do this:
      dev.to/mr_destructive/django-postgresql-deployment-on-railway-app-d54
      After that, you will be able to run createsuperuser and have the user saved in the PostgresSQL database

  • @zombabytv
    @zombabytv ปีที่แล้ว

    Is your app correctly listening to $PORT.
    How to solve this? I even added PORT with the value of 4000 or 8000 it still won't work.

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

    Thanks for the tutorial! it really clear and helpful

  • @quangvunguyen2604
    @quangvunguyen2604 2 ปีที่แล้ว +1

    does it support python 3.11 and 3.11.1, and how to upload it without error docker build failed,nixpacks build failed

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

      Yes I think it does. Let me look jnto the error and see what fix I find

  • @pythoncave
    @pythoncave 2 ปีที่แล้ว +1

    how to save user upload files in railway?

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

      You would need a database for that

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

    How to solve the CSRF issues? I cannot now access to the admin page.
    Error: Forbiden(403) CSRF verification failed. Request aborted.

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

      You need to checkout csrf trusted origins. Cjeck this stack overflow question stackoverflow.com/questions/38841109/csrf-validation-does-not-work-on-django-using-https

  • @snralpha3194
    @snralpha3194 ปีที่แล้ว

    Hello am getting not found after a successful build. How do I solve it

  • @bharathrajiva6318
    @bharathrajiva6318 ปีที่แล้ว

    how to i access the python installed for the application i dont see any terminal option in the site and i did install railway by scoop and using shell but i cant acess the python installed for the application pls help

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Umm, are you trying to access your app on Railway through your terminal?

    • @baitman548
      @baitman548 ปีที่แล้ว

      Yep I would like to have direct access to the installed packages in the env

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Hi, sorry for replying late. You can access the cli through railway cli. Visit the link below to learn more about it:
      docs.railway.app/develop/cli

  • @kartik6214
    @kartik6214 2 ปีที่แล้ว +1

    Error: No start command could be found
    it's showing me this error

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

      Can you give me more details ? Like maybe copy and past the errors so I can see

  • @huzaifafaheem6382
    @huzaifafaheem6382 ปีที่แล้ว

    Could someone help me clarify a question? I've successfully deployed my Django App on Railway using SQLite. Now, let's say a user makes a post request that updates the database. Will these changes be reflected in my GitHub repository? In other words, if I make a new push to my GitHub repo and Railway re-deploys, will it recognize that the existing database file is already up to date and avoid replacing it with the outdated one from GitHub?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      No, the data will not be saved on github. If railway redeploys, it will overwrite the existing database with the old one from github. If you wish to remove this issue, connect to an external database. You can create and connect to a postgresql database on Railway

    • @huzaifafaheem6382
      @huzaifafaheem6382 ปีที่แล้ว

      @@the_proton_guy I see, Thank you very much! Can I somehow download that database on railway that was assigned to me so that I can manually push it to github?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Hmm, I am not so sure about that, but for future purposes, if you want to export your database for backup purposes, look into ghe django import export library

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

    thanks for your video, I have troubles with databases, deploy fails at Collecting mysqlclient==2.1.1 and then at Collecting psycopg for postgress database, would you help to understand how to fix that dependencies

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

      Hi, okay. Why do you have mysqlclient and a Postgresql database?
      A fix for the psycopg2 is:
      Instead of using psycopg2, replace it with psycopg2-binary.
      So pip install psycopg2-binary.
      After that, run pip freeze > requirements.txt to save the new library to the file
      Then, go to the requirements.txt file and locate where psycopg2 is and remove it.
      Push to github and your railway app should automatically start deployment

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

      @@the_proton_guy thanks, I tested first with mysql but didn't work, for posgress I tested with psycopg2-binary but the error continues I was checking in some post and they says that is a problem of the SO disfribution, maybe I will try with aws maybe that can help me to deploy, heroku is not more free

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

      Did you remove psycopg2 from the requirements.txt file?

  • @devilmeliodas9091
    @devilmeliodas9091 ปีที่แล้ว

    thank you for the tuto i only have one question what about the media file how to configure and server them via railway ty

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

      Hello, you will need to find a place to store your media files, like an s3 bucket or cdn like cloudinary, as it is best practice

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

      @@the_proton_guy thannk you

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Happy to help 🥳

    • @devilmeliodas9091
      @devilmeliodas9091 ปีที่แล้ว

      @@the_proton_guy im just learning so do you have any free suggestions ?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      @devilmeliodas9091 yes. I would highly recommend cloudinary, although you can also look into Amazon s3 buckets

  • @tscodertester
    @tscodertester ปีที่แล้ว

    Hello sir, the build works but I am getting an error ModuleNotFoundError: No module named 'tdl' when I deploy. kindly advise, thanks

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Hey, in your procfile, replace tdl with your django project name and redeploy

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

    @THE PROTON GUY I'm stuck at one error :
    Nixpacks build failed
    Error: stream did not contain valid UTF-8
    please reply me asap

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

      Can I see your repository

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

      @@the_proton_guy Hey, I solved that error by saving the requirement.txt file and shifting it into UTF-8 from UTF-16. but now I'm stuck on modules. when installing the modules, an error comes that "Could not find a version that satisfies the requirement pywin32==304" Docker build failed

    • @shakeelriaz5191
      @shakeelriaz5191 2 ปีที่แล้ว +1

      @@the_proton_guy Is there any way to deploy Django App on Railway Manually??

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

      "Pywin32==304". Isn't it suposed to be something like pywin32==3.0.4
      Check your requirements.txt and if pywin32 is there, make a change to 3.0.4 and try again to see if that fixes the error

  • @akrambengueddoudj2513
    @akrambengueddoudj2513 ปีที่แล้ว

    what can i do if i have postgreSQL database with my project

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Is your postgresql online?

    • @akrambengueddoudj2513
      @akrambengueddoudj2513 ปีที่แล้ว

      @@the_proton_guy no, it's local.

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      You can create a postgress database on Railway as a project and connect to it from your django project. That way, your Web app and database are in the same place

    • @akrambengueddoudj2513
      @akrambengueddoudj2513 ปีที่แล้ว

      @@the_proton_guy thank you

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      You are welcome

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

    Hello please I'm having an error "Error Docker build"
    please help me fix that
    thank you

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

      Hey, can you check the deploy logs to see what the error is?

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

    How can I change the Branch ? by default its using the master branch, I want to change it.

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      Hii, this can be done from the settings tab of your project in railway

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

      Thanks!

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      You are welcome!

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

    Hello, how do you do?
    I am getting the following error when deploying my Django project:
    Dockerfile:21
    -------------------
    19 | RUN printf '
    PATH=/opt/venv/bin:$PATH' >> /root/.profile
    20 | COPY . /app/.
    21 | >>> RUN --mount=type=cache,id=s/12ad632d-3245-4503-b551-fa89e82b6a0e-/root/cache/pip,target=/root/.cache/pip python -m venv /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt
    22 |
    23 |
    -------------------
    ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1
    Error: Docker build failed
    Please help

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

      Hey. Can you check the logs to see if any library from the requirements file could not install properly

    • @techwithdenzel
      @techwithdenzel ปีที่แล้ว

      @@the_proton_guy thank you so much for responding.
      Which logs, the deploy?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Yes, the deploy logs

    • @techwithdenzel
      @techwithdenzel ปีที่แล้ว

      ​@@the_proton_guy Here's the full log:

      #11 11.83 creating build/lib.linux-x86_64-cpython-311/cairo
      #11 11.83 copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-311/cairo
      #11 11.83 copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-311/cairo
      #11 11.83 copying cairo/py.typed -> build/lib.linux-x86_64-cpython-311/cairo
      #11 11.83 running build_ext
      #11 11.83 Package cairo was not found in the pkg-config search path.
      #11 11.83 Perhaps you should add the directory containing `cairo.pc'
      #11 11.83 to the PKG_CONFIG_PATH environment variable
      #11 11.83 No package 'cairo' found
      #11 11.83 Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
      #11 11.83 [end of output]
      #11 11.83
      #11 11.83 note: This error originates from a subprocess, and is likely not a problem with pip.
      #11 11.83 ERROR: Failed building wheel for pycairo
      #11 11.83 Failed to build pycairo
      #11 11.83 ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
      #11 11.85
      #11 11.85 [notice] A new release of pip available: 22.3.1 -> 23.1.2
      #11 11.85 [notice] To update, run: pip install --upgrade pip

      #11 ERROR: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1
      -----
      > [stage-0 7/8] RUN --mount=type=cache,id=s/12ad632d-3245-4503-b551-fa89e82b6a0e-/root/cache/pip,target=/root/.cache/pip python -m venv /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt:
      #11 11.83 Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
      #11 11.83 [end of output]
      #11 11.83
      #11 11.83 note: This error originates from a subprocess, and is likely not a problem with pip.
      #11 11.83 ERROR: Failed building wheel for pycairo
      #11 11.83 Failed to build pycairo
      #11 11.83 ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
      #11 11.85
      #11 11.85 [notice] A new release of pip available: 22.3.1 -> 23.1.2
      #11 11.85 [notice] To update, run: pip install --upgrade pip
      -----

      Dockerfile:21
      -------------------
      19 | RUN printf '
      PATH=/opt/venv/bin:$PATH' >> /root/.profile
      20 | COPY . /app/.
      21 | >>> RUN --mount=type=cache,id=s/12ad632d-3245-4503-b551-fa89e82b6a0e-/root/cache/pip,target=/root/.cache/pip python -m venv /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt
      22 |
      23 |
      -------------------
      ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1

      Error: Docker build failed

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      hi, i am sorry. just seeing this. The error seems to be pointing to a library or package called cairo

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

    Great video. But it does not describe what to do with environment variables.Where did you place your secret key? Railway? Github?

    • @polynomen
      @polynomen ปีที่แล้ว

      I put them into railway and it goes

  • @hiaguinhospencer8778
    @hiaguinhospencer8778 ปีที่แล้ว

    how to solve this error:
    Is your app listening correctly on $PORT?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Ummmm, did you configure allowed hosts well

    • @hiaguinhospencer8778
      @hiaguinhospencer8778 ปีที่แล้ว

      @@the_proton_guy where do I configure, in VS CODE or in Railway?

    • @the_proton_guy
      @the_proton_guy  ปีที่แล้ว

      Vs code, in your settings.py

  • @felixboachieyiadom4457
    @felixboachieyiadom4457 2 ปีที่แล้ว +1

    Best video

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

    Which database you used? The database is giving me a lot of issue

  • @f-s_interpreter
    @f-s_interpreter 2 ปีที่แล้ว

    after deploy I got server error 500

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      Um, okay. Can you check the deploy logs to see what the error is?

    • @f-s_interpreter
      @f-s_interpreter 2 ปีที่แล้ว +1

      @@the_proton_guy Are u genius? I saw a guy asked you before , u told him just check, ant it is worked. Now I made liitle change(exactle removed psycop2 and used binary one) and it works. THANK YOUUUUUUUUUUUUUU

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      You are welcomeeee😹😹a sub to the channel will be helpfulllll🥺🥺

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

    Its the same thing as heroku or is it better than heroku?

    • @the_proton_guy
      @the_proton_guy  2 ปีที่แล้ว +1

      I wouldn't say better, but it's good

  • @rishigupta9680
    @rishigupta9680 ปีที่แล้ว

    Hey, I am getting this error can you help me
    Building wheels for collected packages: twisted-iocpsupport
    #11 22.64 Building wheel for twisted-iocpsupport (pyproject.toml): started

    #11 23.27 Building wheel for twisted-iocpsupport (pyproject.toml): finished with status 'error'

    #11 23.28 error: subprocess-exited-with-error
    #11 23.28
    #11 23.28 × Building wheel for twisted-iocpsupport (pyproject.toml) did not run successfully.
    #11 23.28 │ exit code: 1
    #11 23.28 ╰─> [13 lines of output]
    #11 23.28 running bdist_wheel
    #11 23.28 running build
    #11 23.28 running build_ext
    #11 23.28 building 'twisted_iocpsupport.iocpsupport' extension
    #11 23.28 creating build
    #11 23.28 creating build/temp.linux-x86_64-cpython-310
    #11 23.28 creating build/temp.linux-x86_64-cpython-310/twisted_iocpsupport
    #11 23.28 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/nix/store/vamwsqfpvgfwnc7ksa8k4aa52my5r1bq-libxcrypt-4.4.33/include -fPIC -Itwisted_iocpsupport -I/opt/venv/include -I/nix/store/al6g1zbk8li6p8mcyp0h60d08jaahf8c-python3-3.10.9/include/python3.10 -c twisted_iocpsupport/iocpsupport.c -o build/temp.linux-x86_64-cpython-310/twisted_iocpsupport/iocpsupport.o
    #11 23.28 twisted_iocpsupport/iocpsupport.c:767:10: fatal error: io.h: No such file or directory
    #11 23.28 767 | #include "io.h"
    #11 23.28 | ^~~~~~

  • @ahomathias8322
    @ahomathias8322 ปีที่แล้ว

    Thanks❤

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

    Hey, Firts of all great video!
    I have an error that I can not fix because I didnt find any information about it, I'll paste it here:
    ==============
    Using Nixpacks
    ==============
    Nixpacks build failed
    Error: stream did not contain valid UTF-8
    Maybe You can help me with that!

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

    Hello, I'm from Brazil. Thanks for the video. In deploy I have the following error message: do you know what it could be?
    usage: gunicorn [OPTIONS] [APP_MODULE]
    gunicorn: error: argument --error-logfile/--log-file: expected one argument

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

      Hiii, are you sure you configure your Procfile properly

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

    Hello how are you? thanks a lot for your video. I have multiples troubles while deploy to railway. The first is that I have tailwind installed on my django app and it dont load when I deploy on railway and the other problem is that I have this on my deploy logs: [2022-09-21 08:05:02 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:291)
    [2022-09-21 08:05:02 +0000] [291] [INFO] Worker exiting (pid: 291)
    [2022-09-21 08:05:02 +0000] [292] [INFO] Booting worker with pid: 292
    /opt/venv/lib/python3.10/site-packages/environ/environ.py:648: UserWarning: Error reading /app/.env - if you're not configuring your environment separately, check this.
    warnings.warn(

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

      Hiiii, are you sure you configured your static files properly, and did you use a virtual environment?

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

      @@the_proton_guy images are loaded but not the css, I have : Not Found: /static/css/dist/styles.css in my deploy logs.
      how can i check on railway cli if i use virtual env? because on local all is working properly with my virtucal env

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

      That's unusual, I don't think the railway has a cli you can interact with. Let me search for an answer and I'll get back. to you

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

      @@the_proton_guy ok thanks a lot

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

      Ok so i found a solution.
      Step 1: pip install white noise
      step 2: pip freeze > requirements.txt
      step 3: In middleware in your settings.py file, add this line below the first middle:
      "whitenoise.middleware.WhiteNoiseMiddleware",
      step 4: Configure static files. make sure you have something like this:
      STATIC_URL = '/static/'
      STATIC_ROOT = BASE_DIR / "staticfiles"
      STATICFILES_DIRS = [
      os.path.join(BASE_DIR, 'static'),
      ]
      step 5: Add this line to your settings.py file:
      STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
      step 6: run python manage.py collect static
      step 7: push to github and try to redeploy
      That should solve the issue