Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Celery integration with Django 1.7a1 -> ImportError: No module named validation #1850

Closed
davidfischer-ch opened this issue Feb 5, 2014 · 0 comments

Comments

@davidfischer-ch
Copy link

I cannot start the worker when following the tutorial to integrate Celery with Django : A Python exception is raised (http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html). Thanks for your help.

Ubuntu 13.10 x86 | Linux 3.11.0-15-generic | Python 2.7.5+ | Celery 3.1.8 | Django 1.7a1

Django from : https://github.com/davidfischer-ch/django/tree/fixes

$ celery -A HomeMadeEdition worker -l info

/usr/local/lib/python2.7/dist-packages/celery/app/defaults.py:245: CPendingDeprecationWarning: 
    The 'BROKER_PASSWORD' setting is scheduled for deprecation in     version 2.5 and removal in version v4.0.     Use the BROKER_URL setting instead
  alternative='Use the {0.alt} instead'.format(opt))
Traceback (most recent call last):
  File "/usr/local/bin/celery", line 9, in <module>
    load_entry_point('celery==3.1.8', 'console_scripts', 'celery')()
  File "/usr/local/lib/python2.7/dist-packages/celery/__main__.py", line 30, in main
    main()
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 80, in main
    cmd.execute_from_commandline(argv)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 746, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 308, in execute_from_commandline
    return self.handle_argv(self.prog_name, argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 738, in handle_argv
    return self.execute(command, argv)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 692, in execute
    ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/worker.py", line 175, in run_from_argv
    return self(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 271, in __call__
    ret = self.run(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/worker.py", line 208, in run
    state_db=self.node_format(state_db, hostname), **kwargs
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 100, in __init__
    self.setup_instance(**self.prepare_args(**kwargs))
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 131, in setup_instance
    signals.worker_init.send(sender=self)
  File "/usr/local/lib/python2.7/dist-packages/celery/utils/dispatch/signal.py", line 150, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/celery/fixups/django.py", line 61, in on_worker_init
    self._worker_fixup = DjangoWorkerFixup(self.app).install()
  File "/usr/local/lib/python2.7/dist-packages/celery/fixups/django.py", line 151, in install
    self.validate_models()
  File "/usr/local/lib/python2.7/dist-packages/celery/fixups/django.py", line 137, in validate_models
    from django.core.management.validation import get_validation_errors
ImportError: No module named validation

$ celery -A HomeMadeEdition report

/usr/local/lib/python2.7/dist-packages/celery/app/defaults.py:245: CPendingDeprecationWarning: 
    The 'BROKER_PASSWORD' setting is scheduled for deprecation in     version 2.5 and removal in version v4.0.     Use the BROKER_URL setting instead
  alternative='Use the {0.alt} instead'.format(opt))

software -> celery:3.1.8 (Cipater) kombu:3.0.11 py:2.7.5+
            billiard:3.3.0.14 py-amqp:1.4.2
platform -> system:Linux arch:32bit, ELF imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:amqp results:djcelery.backends.database:DatabaseBackend

EMAIL_USE_TLS: False
CSRF_COOKIE_SECURE: False
LANGUAGE_CODE: u'fr'
ROOT_URLCONF: u'HomeMadeEdition.urls'
LOGIN_URL: u'/users/login/'
BROKER_URL: u'amqp://gavi:********@localhost:5672//'
EMAIL_HOST_PASSWORD: '********'
DEFAULT_CHARSET: 'utf-8'
SESSION_SERIALIZER: 'django.contrib.sessions.serializers.JSONSerializer'
STATIC_ROOT: u'/var/www/gavidev.hepia.ch/homemadeedition/static'
APP_ROOT: u'/var/www/gavidev.hepia.ch/homemadeedition'
MAP_CENTER: <Point object at 0xa0a9c20>
ALLOWED_HOSTS: []
STATIC_CSS_URL: u'/static/css/'
MESSAGE_STORAGE: 'django.contrib.messages.storage.fallback.FallbackStorage'
LANGUAGES_CHOICES: 
    ([u'en', u'English'], [u'fr', u'Fran\xe7ais'], (u'', u'----'))
EMAIL_SUBJECT_PREFIX: '[Django] '
THOUSAND_SEPARATOR: ','
STATICFILES_FINDERS: 
    (u'django.contrib.staticfiles.finders.FileSystemFinder',
 u'django.contrib.staticfiles.finders.AppDirectoriesFinder')
SESSION_CACHE_ALIAS: 'default'
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_NAME: 'sessionid'
ADMIN_FOR: 
    ()
TIME_INPUT_FORMATS: 
    ('%H:%M:%S', '%H:%M:%S.%f', '%H:%M')
DATABASES: {
    u'default': {   u'ENGINE': u'django.contrib.gis.db.backends.postgis',
                    u'HOST': u'127.0.0.1',
                    u'NAME': u'geodatabase',
                    u'PASSWORD': '********',
                    u'PORT': u'',
                    u'USER': u'geouser'}}
FILE_UPLOAD_DIRECTORY_PERMISSIONS: None
PROD_MEDIA_PATH: u'/var/www/gavidev.hepia.ch/homemadeedition/media'
SERVER_EMAIL: 'root@localhost'
FILE_UPLOAD_HANDLERS: 
    ('django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler')
DEFAULT_CONTENT_TYPE: 'text/html'
AUDIO_TRANSCODE_EXTENSION: u'm4a'
APPEND_SLASH: True
FIRST_DAY_OF_WEEK: 0
DATABASE_ROUTERS: []
EMAIL_USE_SSL: False
YEAR_MONTH_FORMAT: 'F Y'
STATICFILES_STORAGE: 'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES: {
    u'default': {   u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'},
    u'imagefit': {   u'BACKEND': u'django.core.cache.backends.filebased.FileBasedCache',
                     u'LOCATION': u'/tmp/django_imagefit'}}
DOMAIN: u'gavidev.hepia.ch'
SESSION_COOKIE_PATH: '/'
STATIC_MARKERS_URL: u'/static/markers/'
SILENCED_SYSTEM_CHECKS: []
MIDDLEWARE_CLASSES: 
    (u'django.middleware.common.CommonMiddleware',
 u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'django.middleware.locale.LocaleMiddleware')
USE_I18N: True
SECRET_KEY: '********'
DATE_INPUT_FORMATS: 
    ('%Y-%m-%d',
 '%m/%d/%Y',
 '%m/%d/%y',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y')
LANGUAGE_COOKIE_NAME: 'django_language'
DEFAULT_INDEX_TABLESPACE: ''
ALLOWED_INCLUDE_ROOTS: 
    ()
TRANSACTIONS_MANAGED: False
LOGGING_CONFIG: 'logging.config.dictConfig'
TEMPLATE_LOADERS: 
    ((u'django.template.loaders.cached.Loader',
  (u'template_minifier.template.loaders.filesystem.Loader',
   u'template_minifier.template.loaders.app_directories.Loader')),)
WSGI_APPLICATION: u'HomeMadeEdition.wsgi.application'
FORMAT_MODULE_PATH: None
X_FRAME_OPTIONS: 'SAMEORIGIN'
AUTHENTICATION_BACKENDS: 
    ('django.contrib.auth.backends.ModelBackend',)
FORCE_SCRIPT_NAME: None
USE_X_FORWARDED_HOST: False
SIGNING_BACKEND: 'django.core.signing.TimestampSigner'
SESSION_COOKIE_SECURE: False
DB_ROOT_PASSWORD: '********'
FILE_CHARSET: 'utf-8'
DEBUG: True
SESSION_FILE_PATH: None
DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS: 
    (u'django_admin_bootstrapped',
 u'django.contrib.admin',
 u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.gis',
 u'django.contrib.humanize',
 u'django.contrib.messages',
 u'django.contrib.sessions',
 u'django.contrib.sites',
 u'django.contrib.staticfiles',
 u'braces',
 u'crispy_forms',
 u'django_extensions',
 u'djcelery',
 u'email_obfuscator',
 u'extra_views',
 u'imagefit',
 u'multilingualfield',
 u'homemadeedition')
LANGUAGES_BIDI: 
    ('he', 'ar', 'fa', 'ur')
VIDEO_TRANSCODE_EXTENSION: u'mp4'
COMMENTS_ALLOW_PROFANITIES: False
STATICFILES_DIRS: 
    ()
PREPEND_WWW: False
SECURE_PROXY_SSL_HEADER: None
SESSION_COOKIE_HTTPONLY: True
DEBUG_PROPAGATE_EXCEPTIONS: False
CSRF_COOKIE_DOMAIN: None
DATETIME_INPUT_FORMATS: 
    ('%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M:%S.%f',
 '%Y-%m-%d %H:%M',
 '%Y-%m-%d',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%Y',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M',
 '%m/%d/%y')
TEMPLATE_MINIFIER: True
MONTH_DAY_FORMAT: 'F j'
BROKER_PASSWORD: '********'
MANAGERS: 
    ()
SESSION_EXPIRE_AT_BROWSER_CLOSE: False
LANGUAGES_REPLACEMENT: {
    u'en': u'Coming soon'}
IMAGEFIT_ROOT: u'/var/www/gavidev.hepia.ch/homemadeedition'
TIME_FORMAT: 'P'
MAP_ZOOM: 18
AUTH_USER_MODEL: 'auth.User'
CSRF_COOKIE_NAME: 'csrftoken'
USE_THOUSAND_SEPARATOR: True
PASSWORD_RESET_TIMEOUT_DAYS: 3
CACHE_MIDDLEWARE_ALIAS: 'default'
SESSION_SAVE_EVERY_REQUEST: False
NUMBER_GROUPING: 0
SESSION_ENGINE: 'django.contrib.sessions.backends.db'
PROD_STATIC_PATH: u'/var/www/gavidev.hepia.ch/homemadeedition/static'
CSRF_FAILURE_VIEW: 'django.views.csrf.csrf_failure'
LOCALE_PATHS: 
    (u'/var/www/gavidev.hepia.ch/homemadeedition/locale',)
LOGIN_REDIRECT_URL: u'/'
PROJECT_ROOT: '/var/www/gavidev.hepia.ch/HomeMadeEdition'
DECIMAL_SEPARATOR: '.'
IGNORABLE_404_URLS: 
    ()
CSRF_COOKIE_PATH: '/'
TEMPLATE_STRING_IF_INVALID: ''
TEMPLATE_MINIFIER_HTML_TAGS: False
USE_L10N: True
TEMPLATE_MINIFIER_TEMPLATE_TAGS: True
SETTINGS_FILE: u'/var/www/gavidev.hepia.ch/HomeMadeEdition/settings.json'
FIXTURE_DIRS: 
    ()
EMAIL_HOST: 'localhost'
DATE_FORMAT: 'N j, Y'
LOGGING: {
    u'disable_existing_loggers': False,
    u'filters': {   u'require_debug_false': {   u'()': u'django.utils.log.RequireDebugFalse'}},
    u'formatters': {   u'simple': {   u'format': u'%(levelname)s %(message)s'},
                       u'verbose': {   u'format': u'%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'}},
    u'handlers': {   u'console': {   u'class': u'logging.StreamHandler',
                                     u'formatter': u'simple',
                                     u'level': u'DEBUG'},
                     u'file': {   u'class': u'logging.FileHandler',
                                  u'filename': u'/var/www/gavidev.hepia.ch/site.log',
                                  u'formatter': u'simple',
                                  u'level': u'DEBUG'},
                     u'mail_admins': {   u'class': u'django.utils.log.AdminEmailHandler',
                                         u'filters': [   u'require_debug_false'],
                                         u'level': u'ERROR'},
                     u'null': {   u'class': u'logging.NullHandler',
                                  u'level': u'DEBUG'}},
    u'loggers': {   u'django': {   u'handlers': [u'console'],
                                   u'level': u'INFO',
                                   u'propagate': True},
                    u'django.request': {   u'handlers': [u'console'],
                                           u'level': u'ERROR',
                                           u'propagate': True},
                    u'homemadeedition': {   u'handlers': [u'console'],
                                            u'level': u'INFO',
                                            u'propagate': True}},
    u'version': 1}
MEDIA_ROOT: u'/var/www/gavidev.hepia.ch/homemadeedition/media'
POI_TYPE_DEFAULT: u'Bar'
DEFAULT_EXCEPTION_REPORTER_FILTER: 'django.views.debug.SafeExceptionReporterFilter'
ADMINS: 
    ()
TEMPLATE_DEBUG: True
DEFAULT_FROM_EMAIL: 'webmaster@localhost'
PROD_LOG_PATH: u'/var/log/gavidev.hepia.ch'
MEDIA_URL: u'/media/'
DATETIME_FORMAT: 'N j, Y, P'
TEMPLATE_DIRS: 
    (u'/var/www/gavidev.hepia.ch/homemadeedition/templates',)
SITE_ID: 1
DISALLOWED_USER_AGENTS: 
    ()
LOGOUT_URL: '/accounts/logout/'
TILES_ROOT: u'/var/www/gavidev.hepia.ch/homemadeedition/static/tiles'
SEND_BROKEN_LINK_EMAILS: False
ITEM_ICON_DEFAULT: u'Flower'
TEST_RUNNER: 'django.test.runner.DiscoverRunner'
PROD_CODE_PATH: u'/var/www/gavidev.hepia.ch'
SHORT_DATE_FORMAT: 'm/d/Y'
CACHE_MIDDLEWARE_KEY_PREFIX: '********'
TIME_ZONE: u'Europe/Zurich'
FILE_UPLOAD_MAX_MEMORY_SIZE: 2621440
NEWS_TYPE_DEFAULT: u'Animation'
PROD_LOG_FILENAME: u'/var/log/gavidev.hepia.ch/site.log'
EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_TABLESPACE: ''
TEMPLATE_CONTEXT_PROCESSORS: 
    (u'django.contrib.auth.context_processors.auth',
 u'django.core.context_processors.debug',
 u'django.core.context_processors.i18n',
 u'django.core.context_processors.media',
 u'django.contrib.messages.context_processors.messages',
 u'django.core.context_processors.static',
 u'django.core.context_processors.tz')
IMAGEFIT_PRESETS: {
    u'api_header': {   u'crop': False, u'height': 512, u'width': 512},
    u'api_image': {   u'crop': False, u'height': 512, u'width': 512},
    u'api_thumbnail': {   u'crop': True, u'height': 80, u'width': 80},
    u'site_header': {   u'crop': False, u'height': 768, u'width': 768},
    u'site_image': {   u'crop': False, u'height': 768, u'width': 768},
    u'site_item_image': {   u'crop': False, u'height': 550, u'width': 550},
    u'site_thumbnail': {   u'crop': True, u'height': 128, u'width': 128}}
MIGRATION_MODULES: {
    }
MAP_TILES: [(0, u'garden_0', '[]'),
 (1, u'greenhouse_1', '[]'),
 (1, u'greenhouse_2', '[]'),
 (1, u'greenhouse_3', '[]'),
 (0, u'museum_0', '[]'),
 (1, u'museum_1', '[]')]
SESSION_COOKIE_AGE: 1209600
SETTINGS_MODULE: 'HomeMadeEdition.settings'
USE_ETAGS: False
SITE_ROOT: '/var/www/gavidev.hepia.ch'
LANGUAGES: [[u'en', u'English'], [u'fr', u'Fran\xe7ais']]
AUDIO_TRANSCODE_STRING: u'-y -strict experimental -c:a aac -ac 1 -ar 22050 -b:a 64k -vn'
FILE_UPLOAD_TEMP_DIR: None
INTERNAL_IPS: 
    (u'127.0.0.1',)
STATIC_URL: u'/static/'
EMAIL_PORT: 25
FILE_UPLOAD_PERMISSIONS: None
USE_TZ: True
SHORT_DATETIME_FORMAT: 'm/d/Y P'
CELERY_RESULT_BACKEND: 'djcelery.backends.database:DatabaseBackend'
APP_NAME: u'homemadeedition'
PASSWORD_HASHERS: 
    (u'django.contrib.auth.hashers.PBKDF2PasswordHasher',
 u'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
 u'django.contrib.auth.hashers.BCryptPasswordHasher',
 u'django.contrib.auth.hashers.SHA1PasswordHasher',
 u'django.contrib.auth.hashers.MD5PasswordHasher',
 u'django.contrib.auth.hashers.CryptPasswordHasher')
ABSOLUTE_URL_OVERRIDES: {
    }
DB_GEO_PASSWORD: '********'
WYSIWYG_EDITORS_OPTIONS_JSON: '{"color": false, "image": false, "lists": true, "stylesheets": ["/static/css/wysiwyg-color.css"], "emphasis": true, "html": false, "link": true, "font-styles": true}'
IMAGEFIT_CACHE_ENABLED: True
CACHE_MIDDLEWARE_SECONDS: 600
IMAGEFIT_CACHE_BACKEND_NAME: u'imagefit'
CSRF_COOKIE_HTTPONLY: False
CRISPY_TEMPLATE_PACK: u'bootstrap'
VIDEO_TRANSCODE_STRING: u'-y -strict experimental -c:a aac -ac 1 -ar 22050 -b:a 64k -c:v libx264 -crf 22 -maxrate 800k -bufsize 2048k -vf "scale=trunc(oh*a/2)*2:min(480\\,ih)" -refs 3 -f mp4'
EMAIL_HOST_USER: ''
PROFANITIES_LIST: 
    ()
@ask ask closed this as completed in 70a568c Feb 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants