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 7020505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:19:39+00:00 2026-05-27T23:19:39+00:00

I am running Django in a virtual environment (using virtualenv), and I’m trying to

  • 0

I am running Django in a virtual environment (using virtualenv), and I’m trying to add a custom development environment settings file to simplify app configuration when I’m developing. My plan was to do this with two lines of code

if os.environ.get('DEVELOPMENT', None):
    from login import settings_dev

I’ve also tried import settings_def and from login.settings_dev import *. My settings_dev.py file is sitting in the same directory as my settings.py file and my app is sitting in a folder called login. When I run python login/manage.py syncdb I get this error:

Error: Import by filename is not supported.

My searching keeps bringing up DJANGO_SETTINGS_MODULE (though I’m not sure how it plays into all this – first Django app :]), so just an FYI it is set in my settings.py file like so:

os.environ['DJANGO_SETTINGS_MODULE'] = 'login.settings'

I’ve also tried exporting it in my terminal, but I get the same error.

Does anyone know how I can fix this/what I’m doing wrong here?

  • 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-05-27T23:19:40+00:00Added an answer on May 27, 2026 at 11:19 pm

    In the original settings.py, at the very end:

    try:
        from settings_dev import *
    except ImportError:
        pass
    

    Create settings_dev.py in the same directory as settings.py, and in it, add these two lines at the very top:

    import sys
    globals().update(vars(sys.modules['settings']))
    

    Now add whatever development settings you want in this file.

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

Sidebar

Related Questions

I'm running a Django app using FastCGI and lighttpd. Can somebody explain me what
I'm working on a project, using Python/Django running on a Virtual Private Server, which
I'm using Python 2.7 and django-nonrel for running Django projects on Google app engine.
I'm running Django 1.3, using Sessions Middleware and Auth Middleware: # settings.py SESSION_ENGINE =
I am trying to allow users to upload files for a django app running
I am trying to write a program by running Django using manage.py runserver ip:port
I'm running Django 1.0 and I'm close to deploying my app. As such, I'll
I'm running Django 1.2 beta and trying out the new feature: message framework. http://docs.djangoproject.com/en/dev/ref/contrib/messages/
I'm running Django on Linux using fcgi and Lighttpd. Every now and again (about
I'm running a django instance behind nginx connected using fcgi (by using the manage.py

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.