mirror of
				https://github.com/django/django.git
				synced 2025-10-28 08:06:09 +00:00 
			
		
		
		
	Fixed #19724 -- Output error when settings are improperly configured
...during retrieval of available management commands. Thanks Peter Davis for the report and Julien Phalip for the review.
This commit is contained in:
		| @@ -107,10 +107,13 @@ def get_commands(): | |||||||
|         from django.conf import settings |         from django.conf import settings | ||||||
|         try: |         try: | ||||||
|             apps = settings.INSTALLED_APPS |             apps = settings.INSTALLED_APPS | ||||||
|         except ImproperlyConfigured: |         except ImproperlyConfigured as e: | ||||||
|             # Still useful for commands that do not require functional settings, |             # Still useful for commands that do not require functional settings, | ||||||
|             # like startproject or help |             # like startproject or help | ||||||
|             apps = [] |             apps = [] | ||||||
|  |             sys.stderr.write(color_style().ERROR( | ||||||
|  |                 "Project settings contain errors: %s\n" | ||||||
|  |                 "As a result, only the core Django commands are available.\n" % e)) | ||||||
|  |  | ||||||
|         # Find and load the management module for each installed app. |         # Find and load the management module for each installed app. | ||||||
|         for app_name in apps: |         for app_name in apps: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user