Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use project.foo.development style settings file with Django #241

Closed
derega opened this issue Aug 25, 2011 · 3 comments
Closed
Assignees

Comments

@derega
Copy link

derega commented Aug 25, 2011

I have directory structure like this:

bin/gunicorn_django
project/foo/development.py
project/init.py
project/foo/init.py

This is created by buildout. And "project" dir is in PYTHONPATH.

Now, I try to run:
DJANGO_SETTINGS_MODULE=project.foo.development bin/gunicorn_django -b 127.0.0.1:8061

And it fails:
ImportError: Could not import settings 'foo.development' (Is it on sys.path?): No module named development

But when I comment out line https://github.com/benoitc/gunicorn/blob/0.13.1/gunicorn/app/djangoapp.py#L126 it works fine.

@aleszoulek
Copy link

You can, but don't use gunicorn's django handler.

Just call directly gunicorn and pass it the wsgi handler instance:

DJANGO_SETTINGS_MODULE='project.foo.development' bin/gunicorn -b 127.0.0.0:900 'django.core.handlers.wsgi:WSGIHandler()'

@ghost ghost assigned tilgovi Oct 28, 2011
@tilgovi
Copy link
Collaborator

tilgovi commented Oct 28, 2011

I think #272 addresses this issue. Could you confirm that taking my issue266 branches fixes this?

benoitc added a commit that referenced this issue Feb 19, 2012
- handle new way to launch applications in django 1.4
- simplify the way we discover the project path and settings
- add --pythonpath & --settings options for django applications
- still compatible with older versions (>=1.1)
-handle DJANGO_SETTINGS_MODULE env.

close #283, #275, #274, #241
@benoitc
Copy link
Owner

benoitc commented Feb 19, 2012

fixed in cc43f89 . Thanks!

@benoitc benoitc closed this as completed Feb 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants