你帮我获得加拿大的工作移民签证,我就可以帮你解决问题。

在 2020年5月17日星期日 UTC+8上午4:51:45,chaitan写道:
>
> Hi, I am facing ModuleNotFoundError in my Django application. It got 
> configured with multiple settings files for production, Development & 
> Testing. 
> When I Try to run Python manage.py runserver --settings= settings_dev_sai. 
>
> This is My *Settings* File:
>
> import socket
>
> #import settings depending on the box we are on
> HOST = socket.gethostname()
> TPA_CODE = "Bridge"
> TPA_NAME = "Bridge Benefits System"
>
> #development
> if HOST == "BITS-DP-LAPTOP":
>     from settings_dev import *
>     TPA_NAME = "ICBA Benefit Services Ltd."
>     TPA_CODE = 'ICBA' 
> #DFG bridge
> elif HOST == "dfginternal":
>     from settings_dfg_ees import *
>     TPA_NAME = "Dehoney Financial Group"
>     TPA_CODE = 'DFG' 
> #test
> elif HOST == "DFGTEST02":
>     from settings_staging import *
> elif HOST == "icbaweb":
>     from settings_production_icba import *
>     TPA_NAME = "ICBA Benefit Services Ltd."
>     TPA_CODE = 'ICBA' 
> elif HOST == "meritweb":
>     from settings_production_merit import *
>     TPA_NAME = "Ontario Construction Industry Benefit Plan"
>     TPA_CODE = 'MERIT' 
> elif HOST == "dfgweb" :
>     from settings_production_dfg import *
>     TPA_NAME = "Dehoney Financial Group"
>     TPA_CODE = 'DFG' 
> elif HOST == "dev" or HOST == "j-ubu" :
>     from settings_dev_baikal import *
> elif HOST == "jdev" :
>     from settings_dev_juliab import *
> elif HOST == "Sai" :
>     from settings_dev_sai import *
> elif HOST == "johnstonesweb" :
>     from settings_production_johnstones import *
>     TPA_NAME = "Johnstone's Benefits"
>     TPA_CODE = 'JOHNSTONES' 
> elif HOST == "bridgedemo" :
>     from settings_demo import *
>     TPA_CODE = "Bridge"
>     TPA_NAME = "Bridge Benefits System"
> else:
>     raise ImportError("This server's hostname [" + HOST + "] does not have 
> a proper expanded settings file. Please configure one.")
> *****************
>
> This is my *settings_dev_sai*
>
> from settings_common import *
>
> DEBUG = True
> RUN_TYPE = RUN_DEV
>
> DATABASES = {
>     'default': {
>         'ENGINE': 'django.db.backends.postgresql_psycopg2',
>         #'NAME': 'bridge_icba',
>         'NAME': 'bridge_js',
>         #'NAME': 'bridge_dfg_internal',
>         #'NAME': 'bridge_dfg',
>         'HOST': 'localhost',
>         'USER': 'django',
>         'PASSWORD': 'bridge_user',
>         'PORT': '',
>     },
> }
>
> MEDIA_ROOT = 'C:/Users/DavidPiccione/Dropbox/Work - 
> Bridge/Projects/bridge/MEDIA/'
> MEDIA_URL = '/media/'
>
> EMAIL_HOST = 'smtp.gmail.com'
> EMAIL_PORT = 587
> EMAIL_HOST_USER = 'bridgeautoma...@gmail.com <javascript:>'
> EMAIL_HOST_PASSWORD = 'bridgeautomaticmessenger123'
> EMAIL_USE_TLS = True
> DEFAULT_FROM_EMAIL = 'bridgeautoma...@gmail.com <javascript:>'
>
>
> STATIC_ROOT = ''
> STATIC_URL = '/static/'
> STATICFILES_DIRS = ("C:/Users/DavidPiccione/Dropbox/Work - 
> Bridge/Projects/bridge/static",)
> STATIC_PATH = 'C:/Users/DavidPiccione/Dropbox/Work - 
> Bridge/Projects/bridge/static'
>
> TEMPLATES = [
>         {
>         'BACKEND': 'django.template.backends.django.DjangoTemplates',
>         'DIRS': ["C:/Users/DavidPiccione/Dropbox/Work - 
> Bridge/Projects/bridge/TEMPLATES",],
>         'APP_DIRS': False,
>         'OPTIONS': {
>                 'context_processors': [
>                 'django.contrib.auth.context_processors.auth',
>                 'django.template.context_processors.debug',
>                 'django.template.context_processors.i18n',
>                 'django.template.context_processors.media',
>                 'django.template.context_processors.static',
>                 'django.template.context_processors.tz',
>                 'django.template.context_processors.request',
>                 'django.contrib.messages.context_processors.messages',
>                 'bridge.context_processors.global_settings',],
>                 },
>         },
> ]
>
>
> USE_ASSOCIATION_BANK_ACCOUNTS = True
>
>
> ******************************************************
>
> This is *settings_common* file
>
> DMINS = ()
> BRIDGE_VERSION = "3.6.1 Build 202004.4" 
>
> MANAGERS = ADMINS
>
> TIME_ZONE = 'America/Vancouver'
> LANGUAGE_CODE = 'en-us'
> SITE_ID = 1
>
> USE_I18N = True
> USE_L10N = True
> USE_TZ = False
>
> # Make this unique and don't share it with anybody.
> SECRET_KEY ='removed for privacy reason'
> SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
>
> STATICFILES_FINDERS = (
>     'django.contrib.staticfiles.finders.FileSystemFinder',
>     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> )
>
> MIDDLEWARE_CLASSES = (
>     'django.middleware.common.CommonMiddleware',
>     'django.contrib.sessions.middleware.SessionMiddleware',
>     'django.middleware.csrf.CsrfViewMiddleware',
>     'django.contrib.auth.middleware.AuthenticationMiddleware',
>     'django.contrib.messages.middleware.MessageMiddleware',
>     'bridge.request_access.Middleware',
> )
>
> ROOT_URLCONF = 'bridge.urls'
> WSGI_APPLICATION = 'bridge.wsgi.application'
>
> TEST_RUNNER = ('django.test.runner.DiscoverRunner')
>
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.contenttypes',
>     'django.contrib.sessions',
>     'django.contrib.sites',
>     'django.contrib.messages',
>     'django.contrib.staticfiles',
>     'django.contrib.humanize',
>     'bridge',
>     'block',
>     'temporal',
>     'log',
>     'association',
>     'client',
>     'client_wizard',
>     'employee',
>     'employee_wizard',
>     'receivables',
>     'payables',
>     'reports',
>     'import_tool',
>     'user_accounts',
>     'carrier',
>     'commission',
>     # celery - async tasks.
>     'django_celery_results',
>     # ,'test_runner'
>     'client_portal',
>     #bootstrap forms for client portal
>     'edi',
>     'widget_tweaks', 
>     'payroll_extract',
> )
>
> RQ_QUEUES = {
>     'default': {
>         'HOST': 'localhost',
>         'PORT': 6379,
>         'DB': 0,
>         'DEFAULT_TIMEOUT': 360,
>     },
> }
>
> LOGGING = {
>     'version': 1,
>     'disable_existing_loggers': False,
>     'filters': {
>         'require_debug_false': {
>             '()': 'django.utils.log.RequireDebugFalse'
>         }
>     },
>     'handlers': {
>         'mail_admins': {
>             'level': 'ERROR',
>             'filters': ['require_debug_false'],
>             'class': 'django.utils.log.AdminEmailHandler'
>         }
>     },
>     'loggers': {
>         'django.request': {
>             'handlers': ['mail_admins'],
>             'level': 'ERROR',
>             'propagate': True,
>         },
>     }
> }
>
> # custom project settings follow...
> LOGIN_URL = '/login'
> LOGIN_REDIRECT_URL = '/'
> AUTH_PROFILE_MODULE = "user_accounts.UserProfile"
>
> COUNTRY_LOCALE = ''
>
> SYSTEM_SALES_TAX = 'BC' #This is the province that the TPA client is based 
> in. This is the fall back tax if nothing is set at the client level.
> USE_ASSOCIATION_BANK_ACCOUNTS = False
>
> ADMIN_FEE_ON_ZERO_PREMIUMS = False # overwrite by setting it to True in 
> settings_production_BenefitAdminCompanyName.py if the Admin Fee is charged 
> even if the current premium is zero.
>
> # DEPRECIATED
> INVOICE_ORDER = ('LIFE', 'AD&D', 'WI', 'LTD', 'DEPL', 'EHC', 'DENT', 
> 'EAP', 'MSP', 'OPTLF', 'OSPLIF', 'OPTADD', 'OSPADD', 'VADD', 'CI',)
> # END DEPRECIATED
>
> # celery settings
> CELERY_RESULT_BACKEND = 'django-db'
> CELERY_IMPORTS = ("receivables.async_tasks",'edi.edi', 
> 'payroll_extract.views')
>
> INTERNAL_IPS = ('127.0.0.1')
>
> '''
> # RUN_TYPE is a binary flag - it can be any combination of RUN_*
> # for ex. to set RUN_DEV and RUN_TEST at the same time use:
>
> RUN_TYPE = RUN_DEV | RUN_TEST
>
> # to check use:
>
> if RUN_TYPE & RUN_DEV == RUN_DEV:
>     #...
> # or
> if RUN_TYPE & RUN_DEV:
>     #...
>
> '''
> RUN_DEV = 1
> RUN_TEST = 2
> RUN_PROD = 4
> RUN_TYPE = RUN_PROD
>
>
> USE_CACHE = True # enable/disable request level caching by @cache 
> annotation
> TRACK_CALLS = False # enable/disable function call count by @cache and 
> @track annotations
> TEST_CREATE_NEW_DUMP = True
> TEST_RESTORE_DB = True
> TEST_DB_TMPFS = False
> TEST_LOG_FILE=''
> TEST_USER = 'auto_test'
> TEST_PSWD = 'pass'
> LOG_SQL = False
> USE_DEBUG_TOOLBAR = False
>
> LEDGER_SWITCH_DATE = '2019-12-01'
> ***************************************************************
> Error LOG
>
>
> $ python manage.py makemigrations 
> --settings=bridge.settings.settings_dev_sai
> Traceback (most recent call last):
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py",
>  
> line 328, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py",
>  
> line 366, in execute
>     self.check()
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py",
>  
> line 392, in check
>     all_issues = self._run_checks(
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py",
>  
> line 382, in _run_checks
>     return checks.run_checks(**kwargs)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\checks\registry.py",
>  
> line 72, in run_checks
>     new_errors = check(app_configs=app_configs)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\checks\translation.py",
>  
> line 32, in check_setting_language_code
>     tag = settings.LANGUAGE_CODE
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py",
>  
> line 76, in __getattr__
>     self._setup(name)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py",
>  
> line 63, in _setup
>     self._wrapped = Settings(settings_module)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py",
>  
> line 142, in __init__
>     mod = importlib.import_module(self.SETTINGS_MODULE)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\importlib\__init__.py",
>  
> line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 961, in 
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 219, in 
> _call_with_frames_removed
>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 975, in 
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
>   File "<frozen importlib._bootstrap>", line 219, in 
> _call_with_frames_removed
>   File "F:\brdge\bridge_sai\bridge\settings.py", line 38, in <module>
>     from settings_dev_sai import *
> ModuleNotFoundError: No module named 'settings_dev_sai'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "manage.py", line 10, in <module>
>     execute_from_command_line(sys.argv)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py",
>  
> line 401, in execute_from_command_line
>     utility.execute()
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py",
>  
> line 395, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py",
>  
> line 341, in run_from_argv
>     connections.close_all()
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\utils.py",
>  
> line 225, in close_all
>     for alias in self:
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\utils.py",
>  
> line 219, in __iter__
>     return iter(self.databases)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\functional.py",
>  
> line 48, in __get__
>     res = instance.__dict__[self.name] = self.func(instance)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\utils.py",
>  
> line 153, in databases
>     self._databases = settings.DATABASES
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py",
>  
> line 76, in __getattr__
>     self._setup(name)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py",
>  
> line 63, in _setup
>     self._wrapped = Settings(settings_module)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py",
>  
> line 142, in __init__
>     mod = importlib.import_module(self.SETTINGS_MODULE)
>   File 
> "C:\Users\1\AppData\Local\Programs\Python\Python38-32\lib\importlib\__init__.py",
>  
> line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 961, in 
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 219, in 
> _call_with_frames_removed
>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 975, in 
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
>   File "<frozen importlib._bootstrap>", line 219, in 
> _call_with_frames_removed
>   File "F:\brdge\bridge_sai\bridge\settings.py", line 38, in <module>
>     from settings_dev_sai import *
> ModuleNotFoundError: No module named 'settings_dev_sai'
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9b640916-f620-4880-9122-58f295bff1a3%40googlegroups.com.

Reply via email to