Problémes au niveau de mon settings.py
Réponses:
2
Visites:
846
Up one level
Vous devez être un membre enregistré pour contribuer sur ce forum.
Inscrivez-vous maintenant
Problémes au niveau de mon settings.py
Posté par
makelou
le
19/05/2010 12:19
Bonjour à tous voilà j'ai un probléme sur mon serveur de Dev.J'ai développé un projet sous Django qui marche parfaitement en local sur ma machine mais sur mon serveur de Dev quand j'ai l'erreur suivante:
----------------------------------------------------- MOD_PYTHON ERROR ProcessId: 16684 Phase: 'PythonHandler' Handler: 'django.core.handlers.modpython' Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg) File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target result = object(arg) File "/usr/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 228, in handler return ModPythonHandler()(req) File "/usr/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 201, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 143, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 167, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/usr/lib/python2.5/site-packages/django/views/debug.py", line 56, in technical_500_response html = reporter.get_traceback_html() File "/usr/lib/python2.5/site-packages/django/views/debug.py", line 134, in get_traceback_html return t.render(c) File "/usr/lib/python2.5/site-packages/django/template/__init__.py", line 184, in render return self._render(context) File "/usr/lib/python2.5/site-packages/django/template/__init__.py", line 178, in _render return self.nodelist.render(context) File "/usr/lib/python2.5/site-packages/django/template/__init__.py", line 799, in render bits.append(self.render_node(node, context)) File "/usr/lib/python2.5/site-packages/django/template/debug.py", line 82, in render_node raise wrapped TemplateSyntaxError: <unprintable TemplateSyntaxError object> ------------------------------------------------------------------------------------------------ Et voilà mon settings.py: # Django settings for sustainergynet project. from os.path import dirname, join _dir = dirname(__file__) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'Africa/Dakar' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'fr' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = join(_dir, 'media') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/media/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = 'egk&%^0bhn4e9k2@8jx9q%1!0q&pfsj(=fs%i&f^m)bm-mpvnm' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ROOT_URLCONF = 'urls' TEMPLATE_DIRS = ( join(_dir, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.gis', 'wiki', 'forum', 'core', 'homepage', ) GEOIP_PATH = join(_dir, 'geodata') #POSTGIS_TEMPLATE='template_postgis' #POSTGIS_SQL_PATH='/usr/share/postgresql-8.3-postgis' GOOGLE_MAPS_API_KEY='ABQIAAAA6x_E9GQzmKCn4O2EcfVttxTNm58kceYj9NhzjYOvfyJL04iKjRSwWpHuybVpZWoGdnQwTBSZ6Ek_4A' try: from local_settings import * except ImportError: pass Merci d'avance pour votre aide |
Re: Problémes au niveau de mon settings.py
Posté par
adrienhaxaire
le
26/05/2010 10:23
Bonjour,
ton serveur il utilise apache avec mod_python ? si oui, et si tu peux changer cela, je te conseille d'utiliser gunicorn et un virtual host adapté. si ton projet fonctionne bien en local avec runserver, il fonctionnera bien aussi sur ton serveur. ce n'est qu'un problème de configuration. |
Re: Problémes au niveau de mon settings.py
Posté par
makelou
le
15/07/2010 14:34
Bonjour,
Merci pour ta réponse.Effectivement c'était un probléme de config dans mon setting.py au niveau des paramétres de base de données. Sinon je vais regarder gunicorn aussi. |




