Questions tagged django-rest-framework

Explore the latest questions and answers asked by our top developers.

Docker compose. Make DRF container visible only for frontend container

I’m creating a project using docker compose with 3 containers: db, django and frontend. I would like to have django endpoints usable only for frontend container, and frontend container accessible from everywhere. How can I do this? Source: Docker Questions

Alpine Docker Image Problem For Django with MySQL Database

I’m trying to compress the alpine docker image for Django with MYSQL database. But keep getting NameError: name ‘_mysql’ is not defined I’m using a multistage build and unable to fix this issue. ########### # BUILDER # ########### # pull official base image FROM python:3.9.6-alpine as builder # set work directory WORKDIR /usr/src/app # set […]

‘rest_framework_nested.routers’ error in Docker only

I am trying to deploy a Django app through docker but am stumped at this problem. When I run my application locally, I have no problems but when I deploy to Docker I get this error: AttributeError: module ‘rest_framework_nested.routers’ has no attribute ‘NestedDefaultRouter’ The last lines of the stack trace looks like this: File "<frozen […]

Django running port 8000 but image port is 80 in production

I have Serialized my model and it’s working well except an issue This is my class AuthorSerializer(serializers.ModelSerializer): class Meta: model = User fields = ("first_name", "last_name", "avatar",) this is what i am seeing in browser, Please have a look at this, the address bar port and image port are not same. It’s working well, […]

Run node module from django app within a dockerized environment

I have a django-rest-framework app that runs within a dockerized environment and is exposed on localhost:8080. I have a node module, folder with a node module(main.js). This node app is not served/exposed and cannot be accessed via an endpoint. The only way in which I can run my node module is via a command line, […]

Django REST Framework missing imports with Docker

So, recently I’ve started creating project using Docker for the first time so my knowledge is not very great. When I’m creating venv using python3 -m venv venv, and installing Rest Framework, everything works fine and I’m not having any problems at all. But in my project with Docker, I have no idea why but […]

Celery Async Issue in Django’s Docker Container

I have deployed micro services on docker containers using celery for queue management. Problem is that when I call sync operation it can access database container but async operation gives us this error HTTPConnectionPool(host=’database’, port=83): Max retries exceeded with url: Can anybody tell me the root cause of this behavior? why the same API is […]

What is the best practice for deploying a Dockerized Django with React.js application?

I’m quite confused I have set up docker-compose for client and server so the two of them match at the same port but I keep getting just the Django view at the front with the browsable API from Django Rest Framework. Any idea why the client is not showing up? Here is the set up: […]

By Rodragon
Categorised as django-rest-framework, docker, reactjs Tagged , ,

trying to build new Dockerfile in django app and it keeps throwing "bash: docker: command not found" error when trying to run "docker build ."

so im doing a django/DRF tutorial on udemy and were setting up a Dockerfile for the app and im not sure whats happening here but every time i try to run build dockerfile command in the terminal it doesnt seem to recognize the "docker build ." command. i cd’d into this app’s filepath and the […]

By buzzbomb138
Categorised as django, django-rest-framework, docker Tagged , ,

Django Rest Framework, Docker, nginx – Server Configuration – Base URL for mediafiles

I am trying to set up my Django Rest Framework application. Unfortunately I still can’t manage to get the media files url right. I tried adding the lines from this answer to my nginx configuration ending up with "Bad Request (400)": Django Rest framework swagger base url The application is running on { […]

1 2 3 8

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us