mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Since it triggers imports, it shouldn't be done lightly. This commit adds a public API for doing it explicitly, django.setup(), and does it automatically when using manage.py and wsgi.py.
		
			
				
	
	
		
			16 lines
		
	
	
		
			394 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			394 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import django
 | |
| from django.core.handlers.wsgi import WSGIHandler
 | |
| 
 | |
| 
 | |
| def get_wsgi_application():
 | |
|     """
 | |
|     The public interface to Django's WSGI support. Should return a WSGI
 | |
|     callable.
 | |
| 
 | |
|     Allows us to avoid making django.core.handlers.WSGIHandler public API, in
 | |
|     case the internal WSGI implementation changes or moves in the future.
 | |
| 
 | |
|     """
 | |
|     django.setup()
 | |
|     return WSGIHandler()
 |