Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

332
Visualizações
Django and docker, ImportError: Could not import settings '"config"' Is it on sys.path?

I'm step by step switching my django project to work on local from vagrant to docker.

With docker, you don't need a virtualenv. Even if I find it very convenient I'm facing some new troublesome issues.

The main one is this error on ./manage.py cmd:

ImportError: Could not import settings '"config"' (Is it on sys.path? Is there an import error in the settings file?): No module named '"config"'

So when I start the python console code and type:

>> import sys
>> sys.path
>> ['', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']

But my path project is: /var/www/webapps/wrapper_website/app

I've a setup environment loaded on docker-compose up which contain: DJANGO_CONFIGURATION="LocalContent"

And that's what I'm trying to reach. The config folder is in: /var/www/webapps/wrapper_website/app/config

I've tried this in the wsgi.py:

import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config")
os.environ.setdefault("DJANGO_CONFIGURATION", "Production")
sys.path.insert(0, 
os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) <- this line
from configurations.wsgi import get_wsgi_application

application = get_wsgi_application()

Without success.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda