Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9277035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:00:10+00:00 2026-06-18T17:00:10+00:00

I can’t figure out why Django doesn’t use the database engine I specify in

  • 0

I can’t figure out why Django doesn’t use the database engine I specify in the settings.py file but instead uses value django.db.backends.dummy.

Here is the DB part of my settings.py file which is located at /project/app/settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'my_db_name',
        'USER': 'my_user',
        'PASSWORD': 'my_pass',
        'HOST': '',
        'PORT': '',
    }
}

And here is what Django debug log shows:

DATABASES   
{'default': {'ENGINE': 'django.db.backends.dummy',
             'HOST': '',
             'NAME': 'my_db_name',
             'OPTIONS': {},
             'PASSWORD': u'********************',
             'PORT': '',
             'TEST_CHARSET': None,
             'TEST_COLLATION': None,
             'TEST_MIRROR': None,
             'TEST_NAME': None,
             'TIME_ZONE': 'UTC',
             'USER': 'my_user'}}

I’m running this site in production with gunicorn and nginx. The site has currently setup debug mode to True.

UPDATE 1: When I run python manage.py diffsettings I get the following (the engine is correct):

DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'TEST_MIRROR': None, 'NAME': 'my_db_name', 'TEST_CHARSET': None, 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'OPTIONS': {}, 'HOST': '', 'USER': 'my_user', 'TEST_NAME': None, 'PASSWORD': 'my_pass', 'PORT': ''}}

UPDATE 2: I tried also this in shell, works as expected, I can reach my db:

# python manage.py shell

>>> from myapp.models import MyModel
>>> test = MyModel.objects.all()
>>> test
# Outputs all objects from MyModel.

UPDATE 3: Something strange is happening. To debug this problem I commented out all INSTALLED APPS in the settings.py, restarted nginx, but Django still shows them in the debug log:

INSTALLED_APPS  

('django.contrib.auth',
 'django.contrib.humanize',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'grappelli',
 'django.contrib.admin',
 'foureggs',
 'registration',
 'massadmin')

It looks like Django is using some kind of cached version of my settings.py file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:00:12+00:00Added an answer on June 18, 2026 at 5:00 pm

    Here is what fixed my problem in the end. I’m not sure what was the real cause but it looks like it had something to do with running supervisord.

    I had 2 virtual environments defined under my domain (i.e. /home/mydomain/www/env1 and /home/mydomain/www/env2). The problem I described in the original question was with the env2.

    I first thought that it’s the env1 that’s causing the problems and somehow its settings.py is used instead of settings.py from env2. But settings.py in env1 looked totally different so that probably wasn’t the issue.

    Anyway, here are the steps I’ve taken, it might give some pointers to others running into the same issue:

    1. I deleted env1 (/home/mydomain/www/env1) <– this is probably not related to the problem but I deleted the envivornment anyway since I didn’t need it

    2. I killed these processes: supervisord, nginx, gunicorn_django (i.e. pkill supervisord)

    3. I started supervisord (which runs the bash script to start gunicorn_django process) and nginx

    Site now worked as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one help me in sorting this out in sed/awk/perl Input file Start
Can we use the asterisk character * for a search action in SQL database?
Can anyone help me trying to find out why this doesn't work. The brushes
Can someone help me figure out why my logo image isn't resizing according the
Can I order my users in the database, so I don't have to say
Can I authenticate with just Google account username and password instead of using OAuth?
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Can we use javap in our own java code in a programmable way? for
I want use html5's new tag to play a wav file (currently only supported
Can someone access the database files and/or other files of my app stores in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.