我跟着这个blog,一切都很好。但我有一个问题如何处理Resources Resx Image或通过view调用。这是我的代码片段
BROKER_URL = 'sqs://' + AWS_ACCESS_KEY_ID + ':' + AWS_SECRET_ACCESS_KEY + '@'
BROKER_TRANSPORT = 'sqs'
BROKER_TRANSPORT_OPTIONS = {
'region': 'us-east-1',
'visibility_timeout': 3600,
# 'polling_interval': 0.3,
# 'queue_name_prefix': 'celery-',
}
BROKER_USER = AWS_ACCESS_KEY_ID
BROKER_PASSWORD = AWS_SECRET_ACCESS_KEY
CELERY_DEFAULT_QUEUE = 'mall4g-sqs'
CELERY_QUEUES = {
CELERY_DEFAULT_QUEUE: {
'exchange': CELERY_DEFAULT_QUEUE,
'binding_key': CELERY_DEFAULT_QUEUE,
}
}
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,
},
}
}
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ENABLE_UTC = True
CELERYBEAT_SCHEDULE = {
'orders-expired-task': {
'task': 'orders.tasks.orders_expired',
'schedule': timedelta(hours=2)
},
'remember-set-card': {
'task': 'orders.tasks.remember_set_credit_card',
'schedule': timedelta(days=14)
},
'example': {
'task': 'orders.tasks.example',
'schedule': timedelta(minutes=5)
},
}
# needed for worker monitoring
CELERY_SEND_EVENTS = True
# where to store periodic tasks (needed for scheduler)
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
CELERY_TIMEZONE = 'UTC'
答案 0 :(得分:1)
[string]的名称以及[Image name] .extension
<img src="~/[foldername]/@Resources.[string name]" class="map img-responsive" alt="Hajj MAp" width="1136" height="600">