Closed AnasGhrab closed 9 years ago
0.8 indeed requires more dependencies in the settings and this should be in the documentation. Would you have a full traceback from your webserver?
"Would you have a full traceback from your webserver?" <-- I do not understand what you mean...
Could you provide the full error trace from the webserver? cheers G
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] mod_wsgi (pid=29969): Exception occurred processing WSGI script '/home/www/phono/phono/wsgi.py'.
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] Traceback (most recent call last):
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] self.load_middleware()
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 47, in load_middleware
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] mw_instance = mw_class()
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/middleware/locale.py", line 24, in __init__
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] for url_pattern in get_resolver(None).url_patterns:
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 365, in url_patterns
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 360, in urlconf_module
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] self._urlconf_module = import_module(self.urlconf_name)
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] __import__(name)
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/home/www/phono/phono/urls.py", line 7, in <module>
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] admin.autodiscover()
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", line 29, in autodiscover
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] import_module('%s.admin' % app)
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] __import__(name)
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/admin.py", line 5, in <module>
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] from django.contrib.admin.checks import InlineModelAdminChecks
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/checks.py", line 6, in <module>
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] from django.contrib.admin.utils import (
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/utils.py", line 8, in <module>
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] from django.core.exceptions import FieldDoesNotExist
[Fri Jul 10 16:41:37 2015] [error] [client 197.27.35.21] ImportError: cannot import name FieldDoesNotExist
[Fri Jul 10 16:41:37 2015] [debug] mod_deflate.c(700): [client 197.27.35.21] Zlib: Compressed 625 to 385 : URL /
This does not seem to be directly related to TimeSide, but maybe locales in admin pages. Could you please share your settings.py WITHOUT the passwords?
# -*- coding: utf-8 -*-
# Django settings for sandbox project.
import os, sys
from django.core.urlresolvers import reverse_lazy, reverse
sys.dont_write_bytecode = True
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
ADMINS = (
('Anas Ghrab', 'anas.ghrab@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'phono', # Or path to database file if using sqlite3.
'USER': '************', # Not used with sqlite3.
'PASSWORD': '******************', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
'OPTIONS' : { 'init_command' : 'SET storage_engine=MyISAM,character_set_connection=utf8,collation_connection=utf8_unicode_ci', },
}
}
# 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.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Paris'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'fr'
LANGUAGES = [ ('fr', 'French'),
('en', 'English'),
('de', 'German'),
('zh', 'Chinese'),
('ar_TN', 'Arabic'),
]
SITE_ID = 2
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
if not os.path.exists(MEDIA_ROOT):
os.mkdir(MEDIA_ROOT)
# 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/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
STATIC_ROOT = os.path.join(BASE_DIR, 'static_root/') # Pour la commande collectstatic afin de faciliter le deployement en mode production
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'a8l7%06wr2k+3=%#*#@#rvop2mmzko)44%7k(zx%lls^ihm9^5'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
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',
'django.middleware.locale.LocaleMiddleware',
# 'pagination.middleware.PaginationMiddleware',
)
ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'suit',
'django.contrib.admin',
'django.contrib.staticfiles',
'django_extensions',
'telemeta',
'timeside.player',
'jsonrpc',
'south',
'sorl.thumbnail',
'timezones',
'jqchat',
'ipauth',
'extra_views',
'debug_toolbar',
'bootstrap3',
'bootstrap_pagination',
'googletools',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.contrib.messages.context_processors.messages',
)
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'ipauth.backend.RangeBackend',
)
SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
TELEMETA_ORGANIZATION = 'CMAM'
TELEMETA_SUBJECTS = ('Phonotheque', 'Tunisie', 'Musicologie')
TELEMETA_DESCRIPTION = "Phonotheque Nationale de Tunisie"
#TELEMETA_LOGO = STATIC_URL + 'telemeta/images/logo_telemeta_2.png'
TELEMETA_LOGO = STATIC_URL + 'telemeta/images/logo_cmam.png'
#TELEMETA_GMAP_KEY = 'AIzaSyCOZ2SPeTpl3ikYFprXcZf_llT2ydiRZvU'
TELEMETA_GMAP_KEY = 'AIzaSyCOZ2SPeTpl3ikYFprXcZf_llT2ydiRZvU'
TELEMETA_CACHE_DIR = os.path.join(MEDIA_ROOT, 'cache')
TELEMETA_EXPORT_CACHE_DIR = os.path.join(MEDIA_ROOT, 'export')
TELEMETA_DATA_CACHE_DIR = os.path.join(TELEMETA_CACHE_DIR, 'data')
TELEMETA_DOWNLOAD_ENABLED = True
TELEMETA_STREAMING_FORMATS = ('mp3', 'ogg')
TELEMETA_DOWNLOAD_FORMATS = ('wav', 'mp3', 'ogg', 'flac')
TELEMETA_PUBLIC_ACCESS_PERIOD = 51
AUTH_PROFILE_MODULE = 'telemeta.userprofile'
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/desk/lists/'
EMAIL_HOST = 'localhost'
DEFAULT_FROM_EMAIL = 'anas.ghrab@gmail.com'
TIMESIDE_DEFAULT_GRAPHER_ID = 'waveform_centroid'
TIMESIDE_DEFAULT_WAVEFORM_SIZES = ['346x130', '640x130']
TIMESIDE_AUTO_ZOOM = False
# Settings for django-bootstrap3
BOOTSTRAP3 = {
'set_required': True,
'set_placeholder': False,
'error_css_class': 'has-error',
'required_css_class': 'has-warning',
'javascript_in_head': True,
}
PAGINATION_SETTINGS = {
'PAGE_RANGE_DISPLAYED': 10,
'MARGIN_PAGES_DISPLAYED': 2,
}
DEBUG_TOOLBAR_PATCH_SETTINGS = False
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
SUIT_CONFIG = {
'ADMIN_NAME': 'Telemeta Admin'
}
USE_I18N = True
USE_L10N = True
USE_TZ = True
# LOG_DIR = os.path.join(BASE_DIR, 'log')
# if not os.path.exists(LOG_DIR):
# os.mkdir(LOG_DIR)
# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'handlers': {
# 'file': {
# 'level': 'DEBUG',
# 'class': 'logging.FileHandler',
# 'filename': os.path.join(LOG_DIR, 'debug.log')
# },
# },
# 'loggers': {
# 'django.request': {
# 'handlers': ['file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
# },
# }
could you please try to comment ''django.middleware.locale.LocaleMiddleware' ?
Done.. no change :
[Fri Jul 10 17:07:20 2015] [info] [client 197.27.35.21] mod_wsgi (pid=31458, process='phonotheque', application=''): Loading WSGI script '/home/www/phono/phono/wsgi.py'.
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] mod_wsgi (pid=31458): Exception occurred processing WSGI script '/home/www/phono/phono/wsgi.py'.
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] Traceback (most recent call last):
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 206, in __call__
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] response = self.get_response(request)
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 194, in get_response
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 232, in handle_uncaught_exception
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] if resolver.urlconf_module is None:
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 360, in urlconf_module
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] self._urlconf_module = import_module(self.urlconf_name)
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] __import__(name)
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/home/www/phono/phono/urls.py", line 7, in <module>
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] admin.autodiscover()
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", line 29, in autodiscover
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] import_module('%s.admin' % app)
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] __import__(name)
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/admin.py", line 5, in <module>
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] from django.contrib.admin.checks import InlineModelAdminChecks
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/checks.py", line 6, in <module>
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] from django.contrib.admin.utils import (
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/utils.py", line 8, in <module>
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] from django.core.exceptions import FieldDoesNotExist
[Fri Jul 10 17:07:21 2015] [error] [client 197.27.35.21] ImportError: cannot import name FieldDoesNotExist
[Fri Jul 10 17:07:21 2015] [debug] mod_deflate.c(700): [client 197.27.35.21] Zlib: Compressed 625 to 385 : URL /
The e-mail I get is :
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 99, in get_response
resolver_match = resolver.resolve(request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 337, in resolve
for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 365, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 360, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/home/www/phono/phono/urls.py", line 7, in <module>
admin.autodiscover()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", line 29, in autodiscover
import_module('%s.admin' % app)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/admin.py", line 5, in <module>
from django.contrib.admin.checks import InlineModelAdminChecks
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/checks.py", line 6, in <module>
from django.contrib.admin.utils import (
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/utils.py", line 8, in <module>
from django.core.exceptions import FieldDoesNotExist
ImportError: cannot import name FieldDoesNotExist
weird! and this doesn't happen with 0.7, is it?
please also give me your urls.py
No.. it works normally when I have Telemeta 1.5.1 and TimeSide 0.7.1. If I upgrade TimeSide or Telemeta using a dev version, I get an Internal Server Error.
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url, include
from django.http import HttpResponse
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
js_info_dict = {
'packages': ('telemeta',),
}
robots_file = open('/home/www/phono/phono/robots.txt', 'r')
urlpatterns = patterns('',
# Example:
# (r'^sandbox/', include('sandbox.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/django/', include(admin.site.urls)),
#(r'^grappelli/', include('grappelli.urls')), # grappelli URLS
# Telemeta
(r'^', include('telemeta.urls')),
# Languages
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
(r'^robots\.txt$', lambda r: HttpResponse(robots_file.read(), mimetype="text/plain")),
)
Now my problem seems to be related to haystack :
[Fri Jul 10 19:11:43 2015] [error] [client 197.27.35.21] File "/usr/local/lib/python2.7/dist-packages/django_haystack-2.4.0-py2.7.egg/haystack/__init__.py", line 11, in <module>
[Fri Jul 10 19:11:43 2015] [error] [client 197.27.35.21] from haystack import signals
[Fri Jul 10 19:11:43 2015] [error] [client 197.27.35.21] ImportError: cannot import name signals
Hmm, seems like a configuration pb of django or python itself... Did you setup the instance in a virtualenv? I have to go, but will be online tomorrow as for the 0.8 release ;)
No i do not use any virutalenv as Telemeta-TimeSide are the only Python applications used on this server.
See you tomorrow.
I got it ! I was a basic problem with the haystack. I had to follow the documentation of haystack (http://django-haystack.readthedocs.org/en/v2.4.0/tutorial.html#configuration) :
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
# Added.
'haystack',
# Then your usual apps...
'blog',
]
Then installing pysolr
sudo pip install pysolr
and adding in the settings.py file :
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://phonotheque.cmam.tn:8983/solr'
},
}
I do not know if it is the perfect configuration, but it works now ;)
Oh, congrats Anas! I'm sorry because this new dependency should appear only in the feature/haystack branch which implements the new external search engine based on Haystack. Moreover, the traceback was now really explicit..
The install of TimeSide==0.8 (dev) gave me an Internal Server Error (http://phonotheque.cmam.tn/)