|  | @@ -1,5 +1,8 @@
 | 
											
												
													
														|  | 
 |  | +import os
 | 
											
												
													
														|  |  from celery.loaders.base import BaseLoader
 |  |  from celery.loaders.base import BaseLoader
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +DEFAULT_CONFIG_MODULE = "celeryconfig"
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  DEFAULT_SETTINGS = {
 |  |  DEFAULT_SETTINGS = {
 | 
											
												
													
														|  |      "DEBUG": False,
 |  |      "DEBUG": False,
 | 
											
												
													
														|  |      "DATABASE_ENGINE": "sqlite3",
 |  |      "DATABASE_ENGINE": "sqlite3",
 | 
											
										
											
												
													
														|  | @@ -21,9 +24,12 @@ class Loader(BaseLoader):
 | 
											
												
													
														|  |      """
 |  |      """
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      def read_configuration(self):
 |  |      def read_configuration(self):
 | 
											
												
													
														|  | -        """Read configuration from ``celeryconf.py`` and configure
 |  | 
 | 
											
												
													
														|  | 
 |  | +        """Read configuration from ``celeryconfig.py`` and configure
 | 
											
												
													
														|  |          celery and Django so it can be used by regular Python."""
 |  |          celery and Django so it can be used by regular Python."""
 | 
											
												
													
														|  |          config = dict(DEFAULT_SETTINGS)
 |  |          config = dict(DEFAULT_SETTINGS)
 | 
											
												
													
														|  | 
 |  | +        configname = os.environ.get("CELERY_CONFIG_MODULE",
 | 
											
												
													
														|  | 
 |  | +                                    DEFAULT_CONFIG_MODULE)
 | 
											
												
													
														|  | 
 |  | +        celeryconfig = __import__(configname, {}, {}, [''])
 | 
											
												
													
														|  |          import celeryconfig
 |  |          import celeryconfig
 | 
											
												
													
														|  |          usercfg = dict((key, getattr(celeryconfig, key))
 |  |          usercfg = dict((key, getattr(celeryconfig, key))
 | 
											
												
													
														|  |                              for key in dir(celeryconfig)
 |  |                              for key in dir(celeryconfig)
 |