@shared_task()<EOL>def publish_object(content_type_pk, obj_pk):
ct = ContentType.objects.get_for_id(content_type_pk)<EOL>obj = ct.get_object_for_this_type(pk=obj_pk)<EOL>try:<EOL><INDENT>logger.info("<STR_LIT>" % obj)<EOL>obj.build()<EOL>if not getattr(settings, '<STR_LIT>', True):<EOL><INDENT>logger.info("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>management.call_command("<STR_LIT>")<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>logger.error("<STR_LIT>", exc_info=True)<EOL><DEDENT>
Build all views related to an object, and then sync with S3.

Accepts primary keys to retrieve a model object that
inherits bakery's BuildableModel class.