
# Expose the tag library in the site.
# If `django.contrib.comments` is not used, this library can provide stubs instead.
# Currently, the real tags are exposed as the template already checks for `object.comments_are_open`.
# When a custom template is used, authors likely choose the desired commenting library instead.

from django.contrib.comments.templatetags.comments import register

from django.template import Library
from fluent_utils.django_compat import is_installed

# Expose the tag library in the site.
# If `django.contrib.comments` is not used, this library can provide stubs instead.
# Currently, the real tags are exposed as the template already checks for `object.comments_are_open`.
# When a custom template is used, authors likely choose the desired commenting library instead.

if is_installed('django.contrib.comments'):
    from django.contrib.comments.templatetags.comments import register
elif is_installed('django_comments'):
    from django_comments.templatetags.comments import register
else:
    register = Library()

Support django-contrib-comments instead of django.contrib.comments for Django 1.8
Support django-contrib-comments instead of django.contrib.comments for Django 1.8

+ from django.template import Library
+ from fluent_utils.django_compat import is_installed
  
  # Expose the tag library in the site.
  # If `django.contrib.comments` is not used, this library can provide stubs instead.
  # Currently, the real tags are exposed as the template already checks for `object.comments_are_open`.
  # When a custom template is used, authors likely choose the desired commenting library instead.
  
+ if is_installed('django.contrib.comments'):
- from django.contrib.comments.templatetags.comments import register
+     from django.contrib.comments.templatetags.comments import register
+ elif is_installed('django_comments'):
+     from django_comments.templatetags.comments import register
+ else:
+     register = Library()
  
Support django-contrib-comments instead of django.contrib.comments for Django 1.8
## Code Before:

# Expose the tag library in the site.
# If `django.contrib.comments` is not used, this library can provide stubs instead.
# Currently, the real tags are exposed as the template already checks for `object.comments_are_open`.
# When a custom template is used, authors likely choose the desired commenting library instead.

from django.contrib.comments.templatetags.comments import register

## Instruction:
Support django-contrib-comments instead of django.contrib.comments for Django 1.8
## Code After:
from django.template import Library
from fluent_utils.django_compat import is_installed

# Expose the tag library in the site.
# If `django.contrib.comments` is not used, this library can provide stubs instead.
# Currently, the real tags are exposed as the template already checks for `object.comments_are_open`.
# When a custom template is used, authors likely choose the desired commenting library instead.

if is_installed('django.contrib.comments'):
    from django.contrib.comments.templatetags.comments import register
elif is_installed('django_comments'):
    from django_comments.templatetags.comments import register
else:
    register = Library()
