I don't know how fussy about not using stuff from django you are, but the following works for me:
$ DJANGO_SETTINGS_MODULE=foo.ct python >>> from django.conf import settings >>> settings.INSTALLED_APPS Obviously, you replace "foo" with the name of your project. This prints my installed apps. For settings with defaults, middlewares, for example, you will the default if you haven't set it in your settings file. You must have DJANGO_SETTINGS_MODULE in the environment, though you could, instead of using the shell, add it to os.environ (I don't think that it has to be there for the import from django.conf, but it must be there for the first reference to an attribute of settings, which is a lazy object). This doesn't import much, unless you have a things implied in your project path or settings module. I have the currect celery boiler plate in my project's __init__.py file, so I get a lot of stuff. Just check sys.modules and see if the import load is too much for you before you go re-implementing the django.conf mechanisms. On Fri, Jul 4, 2014 at 5:12 PM, Chen Xu <xuche...@gmail.com> wrote: > Hi Everyone, > I want to access some variables in my settings.py without starting my > server, I know I will have to run settings.configure(); however, running > settings.configure() does not allow me to access my custom variables. > > What should I do with that. > > > Thanks > > -- > ⚡ Chen Xu ⚡ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CACac-qbCUJ3WCDVN022%3DU6nnh40X4tYPiW8oJ6q%3DY_LTGN9Bhw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CACac-qbCUJ3WCDVN022%3DU6nnh40X4tYPiW8oJ6q%3DY_LTGN9Bhw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0s4def1YrqcQ2V%2B2f%3DVcxfQkngxHmU2GMs-NtNH5eLwxw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.