python - Django no module named setting -


i trying host basic django-oscar app on subdomain on amazon ec2 instance. working file on local server on hosting giving following error per

apache error log

 mod_wsgi (pid=13645): target wsgi script '/home/ubuntu/frobshop.com/frobshop/frobshop/wsgi.py' cannot loaded python module.  mod_wsgi (pid=13645): exception occurred processing wsgi script '/home/ubuntu/frobshop.com/frobshop/frobshop/wsgi.py'.  traceback (most recent call last):   file "/home/ubuntu/frobshop.com/frobshop/frobshop/wsgi.py", line 14, in <module>     application = get_wsgi_application()    file "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application   django.setup()    file "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 20, in setup     configure_logging(settings.logging_config, settings.logging)    file "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__      self._setup(name)    file "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup      self._wrapped = settings(settings_module)    file "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 98, in __init__      % (self.settings_module, e) importerror: not import settings 'frobshop.settings' (is on sys.path? there import error in settings file?): no module named frobshop.settings 

my settings.py file :

""" django settings frobshop project.  more information on file, see https://docs.djangoproject.com/en/1.7/topics/settings/  full list of settings , values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """  # build paths inside project this: os.path.join(base_dir, ...) import os import oscar oscar import oscar_main_template_dir oscar import get_core_apps oscar.defaults import * base_dir = os.path.dirname(os.path.dirname(__file__)) location = lambda x: os.path.join(     os.path.dirname(os.path.realpath(__file__)), x)   # quick-start development settings - unsuitable production # see https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/  # security warning: keep secret key used in production secret! secret_key = 'h9(c0lu!m8%5&qy)boa(l&32x4&0#(330zz-v%3%a_vu4b4hm+'  # security warning: don't run debug turned on in production! debug = true oscar_shop_name = "" oscar_homepage = reverse_lazy('promotions:home') # use_less = true  template_debug = true thumbnail_debug = true  allowed_hosts = []   # application definition  installed_apps = [     'django.contrib.admin',     'django.contrib.auth',     'django.contrib.contenttypes',     'django.contrib.sessions',     'django.contrib.messages',     'django.contrib.staticfiles',     'django.contrib.sites',     'django.contrib.flatpages',     'compressor' ] + get_core_apps()  site_id = 1  template_context_processors = (     "django.contrib.auth.context_processors.auth",     "django.core.context_processors.request",     "django.core.context_processors.debug",     "django.core.context_processors.i18n",     "django.core.context_processors.media",     "django.core.context_processors.static",     "django.core.context_processors.tz",     "django.contrib.messages.context_processors.messages",     'oscar.apps.search.context_processors.search_form',     'oscar.apps.promotions.context_processors.promotions',     'oscar.apps.checkout.context_processors.checkout',     'oscar.apps.customer.notifications.context_processors.notifications',     'oscar.core.context_processors.metadata', )  middleware_classes = (     'django.contrib.sessions.middleware.sessionmiddleware',     'django.middleware.common.commonmiddleware',     'django.middleware.csrf.csrfviewmiddleware',     'django.contrib.auth.middleware.authenticationmiddleware',     'django.contrib.auth.middleware.sessionauthenticationmiddleware',     'django.contrib.messages.middleware.messagemiddleware',     'django.middleware.clickjacking.xframeoptionsmiddleware',     'oscar.apps.basket.middleware.basketmiddleware',     'django.contrib.flatpages.middleware.flatpagefallbackmiddleware', )  authentication_backends = (     'oscar.apps.customer.auth_backends.emailbackend',     'django.contrib.auth.backends.modelbackend', )  template_dirs = (     location('templates'),     oscar_main_template_dir, )  staticfiles_dirs = (     os.path.join(base_dir, '/static/'), )  # compress_precompilers = ( #     ('text/less', 'lessc {infile} {outfile}'), # )  staticfiles_finders = (     'compressor.finders.compressorfinder', ) haystack_connections = {     'default': {         'engine': 'haystack.backends.simple_backend.simpleengine',     }, }  # haystack_connections = { #     'default': { #         'engine': 'haystack.backends.solr_backend.solrengine', #         'url': 'http://127.0.0.1:8983/solr', #         'include_spelling': true, #     }, # }  root_urlconf = 'frobshop.urls'  wsgi_application = 'frobshop.wsgi.application'   # database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases  databases = {     'default': {         'engine': 'django.db.backends.mysql',         'name': 'frobshop',         'user': 'root',         'password': 'password',         'host': 'localhost',         'port': '3306',         'atomic_requests': true,     } }  # internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/  language_code = 'en-us'  time_zone = 'utc'  use_i18n = true  use_l10n = true  use_tz = true   # static files (css, javascript, images) # https://docs.djangoproject.com/en/1.7/howto/static-files/  static_url = '/static/' static_root = base_dir + "/static/" media_url = '/media/' media_root = location("media")  oscar_initial_order_status = 'pending' oscar_initial_line_status = 'pending' oscar_order_status_pipeline = {     'pending': ('being processed', 'cancelled',),     'being processed': ('processed', 'cancelled',),     'cancelled': (), } 

the apache conf file :

wsgiscriptalias / /home/ubuntu/frobshop.com/frobshop/frobshop/wsgi.py wsgipythonpath /home/ubuntu/frobshop.com/frobshop  <virtualhost *:80>          alias /static/ /home/ubuntu/frobshop.com/static/         alias /media/ /home/ubuntu/frobshop.com/media/           servername "the subdomain using"          <directory /home/ubuntu/frobshop.com/frobshop/frobshop>                 <files wsgi.py>                         order deny,allow                         require granted                 </files>         </directory>          <directory /home/ubuntu/frobshop.com/frobshop/static>                 require granted         </directory>          <directory /home/ubuntu/frobshop.com/frobshop/media>                 require granted         </directory>          <directory /home/ubuntu/frobshop.com/media>                 require granted         </directory>          <directory /home/ubuntu/frobshop.com/frobshop/staticfiles>                 require granted         </directory>  </virtualhost> 

can guide through what/why error?

i can't comment because don't have enough rep. issue settings.py file not being found based on wsgi.py file says it's going be.

therefore need see project directory structure. should this.

yourproject    > frobshop      settings.py    wsgi.py 

the news wsgi file being found virtualenv, it's wsgi can't find settings.


Comments