How to Deploy a Django app to AWS Lightsail

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • This is an edited version of our live stream: How to Deploy a Django app to AWS Lightsail.
    AWS has an exciting product called Lightsail. It offers a lightweight, simplified deployment with transparent pricing. Win win.
    Familiarise yourself with AWS Lightsail: aws.amazon.com...
    Here's the finished code with code diffs for each step: github.com/Lon...
    And here's the AWS Lightsail Live Stream Preparation tutorial: • AWS Lightsail Live Str...

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

  • @dagneassefa4138
    @dagneassefa4138 8 месяцев назад

    Thank you for this excellent video. You answered all of the questions that would have taken me weeks or even months to research. Thank you again👍

  • @TechX-bx5jc
    @TechX-bx5jc 5 месяцев назад

    This was an amazing video. Thank you so much, it was extremely useful and I learned a lot! You have a new fan here. Liked and subscribed, of course!

  • @rommelrodriguez8376
    @rommelrodriguez8376 Год назад +3

    Thanks, was waiting for this video. I attended the live, but still wanted to have this reference in case I forgot anything.

  • @ClearVista
    @ClearVista Год назад

    So I'm going through this with my own project and I'm getting the following error when trying to do my first "migrate"
    django.db.utils.OperationalError: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

  • @yooujiin
    @yooujiin Год назад

    At the end, I get this error when creating superuser "[15/May/2023:19:49:40] Superuser created successfully.
    [15/May/2023:19:50:00] [deployment:14] Started 1 new node
    [15/May/2023:19:50:23] CommandError: Error: That username is already taken.
    [15/May/2023:19:51:29] [deployment:14] Started 1 new node
    [15/May/2023:19:51:54] CommandError: Error: That username is already taken" ...
    "Forbidden (403)
    CSRF verification failed. Request aborted.
    More information is available with DEBUG=True."

  • @tatemo_labs
    @tatemo_labs Год назад +3

    Great effort! Thank you for sharing your knowledge.

  • @Sports-Made
    @Sports-Made 5 месяцев назад

    si was was running a django app using rds, ec2, load balancers etc.. but it was just too expensive... How is deploying to lightsail cost? wat monthly cost are we looking at?

    • @LondonAppDeveloper
      @LondonAppDeveloper  4 месяца назад

      You can get all the pricing here: aws.amazon.com/lightsail/pricing/
      Too be honest, the price might be similar to using EC2 / Load Balancer / RDS directly. The benefit of lightsail is that the pricing is more predictable.
      If you want something really cheap then best bet is to run everything on a single VPS (database, app, etc...). For this, my personal preference is katapult.io. You could also check out fly.io/docs/about/pricing/

  • @rishabhdugar2
    @rishabhdugar2 7 месяцев назад

    I am facing an issue, it states:
    exec /scripts/run.sh: no such file or directory
    Please help me understand the issue and the way to resolve it

    • @LondonAppDeveloper
      @LondonAppDeveloper  4 месяца назад

      Is the run.sh file spelled correctly and in the right location?

  • @alan-overthenet
    @alan-overthenet Год назад

    Thanks very much for this. Sorry I missed it live.

    • @LondonAppDeveloper
      @LondonAppDeveloper  Год назад +1

      No worries. We're doing another on March 15th. if you can come.

  • @태기_개인
    @태기_개인 Год назад

    You are amazing!!

  • @adammisiak4082
    @adammisiak4082 Год назад

    Thanks for the video!
    What is the average cost of this kind of setup?

  • @of7104
    @of7104 Месяц назад +1

    Why do I keep getting this error;
    [26/Jul/2024:21:50:59] django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: '172.26.31.219'. You may need to add '172.26.31.219' to ALLOWED_HOSTS.

    • @of7104
      @of7104 Месяц назад

      To clarify the request are coming in every 5 seconds, so I'm wondering if some sort of internal health check?

    • @of7104
      @of7104 Месяц назад

      In case anyone ends up wondering - solved this with; ALLOWED_HOSTS = []
      ALLOWED_HOSTS.extend(
      filter(None, os.environ.get('ALLOWED_HOSTS', '').split(','))
      )
      ALLOWED_HOSTS.append(gethostbyname(gethostname())). Do please let me know if this isn't best practice

    • @LondonAppDeveloper
      @LondonAppDeveloper  6 дней назад +1

      As some have pointed out, to resolve this you’ll need to add the IP address of the running host to the ALLOWED_HOSTS in settings.py.
      There's an example in our API deployment course: github.com/LondonAppDeveloper/devops-recipe-app-api/blob/main/app/app/settings.py#L38
      Essentially:
      ```
      from socket import gethostname, gethostbyname

      ALLOWED_HOSTS = []
      ALLOWED_HOSTS.append(gethostbyname(gethostname()))
      ```

    • @of7104
      @of7104 3 дня назад

      @@LondonAppDeveloper that’s great thank you. First website now deployed and working well - thanks for the video!