hook-django.db.backends.py 983 B

12345678910111213141516171819202122232425
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2005-2021, PyInstaller Development Team.
  3. #
  4. # Distributed under the terms of the GNU General Public License (version 2
  5. # or later) with exception for distributing the bootloader.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10. #-----------------------------------------------------------------------------
  11. import glob
  12. import os
  13. from PyInstaller.utils.hooks import get_module_file_attribute
  14. # Compiler (see class BaseDatabaseOperations)
  15. hiddenimports = ['django.db.models.sql.compiler']
  16. # Include all available Django backends.
  17. modpath = os.path.dirname(get_module_file_attribute('django.db.backends'))
  18. for fn in glob.glob(os.path.join(modpath, '*')):
  19. if os.path.isdir(fn):
  20. fn = os.path.basename(fn)
  21. hiddenimports.append('django.db.backends.' + fn + '.base')