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

Allow custom path to wsgi application #70

Closed
k4ml opened this issue Mar 10, 2013 · 4 comments
Closed

Allow custom path to wsgi application #70

k4ml opened this issue Mar 10, 2013 · 4 comments

Comments

@k4ml
Copy link

k4ml commented Mar 10, 2013

Currently the generated .wsgi script pull out the application from django.core.handlers.wsgi.WSGIHandler(). Sometimes it's desirable to specify custom application callable, such as when integrating with third party debug application. Ideally, with settings such as:-

[django]
...
wsgiapp = myproject.wsgi.application

The generated .wsgi script will import the application as is, rather than calling djangorecipe.wsgi.main() function.

I've worked a bit on this but so far I have to follow djangorecipe approach of calling something like myproject.wsgi.main(). Since default django template already include myproject.wsgi module with attribute named application, it would be much better if we can follow the same pattern.

@jellegerbrandy
Copy link

Wouldn't settings.WSGI_APPLICATION be the place to specify the wsgi app?

https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-WSGI_APPLICATION

@k4ml
Copy link
Author

k4ml commented Jun 6, 2013

That I think does not allow you to fully wrap the application, such as even before django itself get called.

@jellegerbrandy
Copy link

I'm not really sure what you mean by "wrapping the application before django gets called" - how would that work exactly?

In any case, as far as i can see, having the wsgi script respect the WSGI_APPLICATION setting of django (just as the "runserver" command does) is something that seems a good idea in any case...

@reinout
Copy link
Collaborator

reinout commented May 27, 2014

I've merged #78, I guess that solves the issue in a generic way? If needed you can wrap/modify the wsgi application object that way.

Can you take a look at djangorecipe 1.9 and its deploy_script_extra option?

@reinout reinout closed this as completed May 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants