Django Rest Framework Course - Module 3

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 19

  • @amarmusovic7748
    @amarmusovic7748 6 місяців тому +1

    Thanks for the great content! I find your way of copy/pasting code snippets and then explaining them works just fine, and makes the videos somewhat shorter. 👍👍

    • @DidCoding
      @DidCoding  6 місяців тому

      Glad you enjoy the format 😀

  • @progravado5099
    @progravado5099 Рік тому +1

    Thanks again, apreciate the effort and the content quality!

    • @DidCoding
      @DidCoding  Рік тому

      Thank you for the feedback

  • @davidecastelli3200
    @davidecastelli3200 Рік тому +1

    First of all, THANK YOU for videos!! You have done an amazing job !!! Anyway I followed all 3 models but I don't understand why nothing is working ehehhehe . First of all I had a problem to download NETCAT and choose btw tradional and openbsd. After choose netcat-traditional I have encoutered the endpoint's problem tackled already changig the permission. Even now after run the command build nothing is displaying in my docker desktop and i localhost doesn't change to api ... Do you have any tip to put me in the right path ????

    • @DidCoding
      @DidCoding  Рік тому

      Yeah it looks like something is broken. It’ll be hard for me to debug without the traceback. Also , it’s been a while since I’ve looked at this project.
      I know that some users had issues when running the containers on mac or Ubuntu… have you checked out the issues on GitHub?
      Bobby

  • @emanueltameklo6245
    @emanueltameklo6245 2 роки тому +2

    Hi Bobby, I have completed all of module 3 and for some reason my API container is not working. I have researched some of the Docker docs and can't seem to find the solution. Would have any pointers to some basic troubleshooting that could help figure out the issue. Please and thank you.

    • @DidCoding
      @DidCoding  2 роки тому

      Hi mate. I just emailed you.
      I think it’s the line endings. Try changing LF to CRLF on the dockerfiles.

    • @DidCoding
      @DidCoding  2 роки тому

      And entry points

  • @kennytanner1329
    @kennytanner1329 2 роки тому +2

    Hi Bobby, I'm afraid my API container running into a similar issue exec /code/docker/entrypoints/entrypoint.sh: no such file or directory
    Any suggestions would be greatly appreciated!
    Also the request returns this error.
    http: error: ConnectionError: HTTPConnectionPool(host='api', port=8000): Max retries exceeded with url: /contact/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) while doing a POST request to URL: api:8000/contact/

    • @DidCoding
      @DidCoding  2 роки тому +1

      This would suggest that you need to change permission on the bash file but this is done in the Dockerfile. Try changing the dockerfile to the following.
      FROM python:3.10
      ENV PYTHONUNBUFFERED 1
      ENV PYTHONDONTWRITEBYTECODE 1
      RUN set -e;
      apt-get update ;
      apt-get -y install netcat ;
      apt-get -y install gettext ;
      RUN mkdir /code
      COPY . /code/
      WORKDIR /code
      RUN set -e;
      /usr/local/bin/python -m pip install --upgrade pip ;
      python -m pip install -r /code/requirements.txt ;\
      EXPOSE 8000
      CMD [ "python", "manage.py" , "runserver"]
      You will then need to run the following code in Docker CLI
      python manage.py makemigrations
      python manage.py migrate

    • @kennytanner1329
      @kennytanner1329 2 роки тому +2

      @@DidCoding simply changing that final docker entry point line to CMD [ "python", "manage.py" , "runserver"] appears to have done the trick. Thanks!!

    • @DidCoding
      @DidCoding  2 роки тому

      @@kennytanner1329 🙌

  • @DiederikNomden
    @DiederikNomden 2 роки тому

    Hi Bobby, I followed all steps (script for is slightly different from the one you're showing in your video, class ContactViewSet is called ContactAPIView in my downloaded script), and somehow no endpoint 'contact' has been made on the server... Could you help me out?
    Thanks!

    • @DidCoding
      @DidCoding  2 роки тому

      There were some alterations made to the repo.
      Have you added the url?
      If in doubt, pull down the code from the following module 👍
      Thanks
      Bobby

  • @s.nazeri2009
    @s.nazeri2009 Рік тому

    thank you so much

  • @travishetzel
    @travishetzel Рік тому +1

    If an ""exec: \"/entrypoint.sh\": permission denied" error shows up:
    cd into docker/entrypoints and enter "chmod +x entrypoint.sh" into the terminal and rebuild via "docker-compose up -d --build"

    • @DidCoding
      @DidCoding  Рік тому

      Yeah, some people have had the permission error.
      Changing the entry point command to the following also works:
      CMD [ "python", "manage.py" , "runserver"]