<commit_before>from django.core.management.base import NoArgsCommand
import sys
import django
try:
    from decimal import Decimal
except:
    from django.utils._decimal import Decimal


class Command(NoArgsCommand):
    help = "Check the system to see if the Satchmo components are installed correctly."
    
    def handle_noargs(self, **options):
        from django.conf import settings
        errors = []
        print "Checking your satchmo configuration."
        try:
            import satchmo
        except ImportError:
            errors.append("Satchmo is not installed correctly. Please verify satchmo is on your sys path.")
        print "Using Django version %s" % django.get_version()
        print "Using Satchmo version %s" % satchmo.get_version()
        try:
            import Crypto.Cipher
        except ImportError:
            errors.append("The Python Cryptography Toolkit is not installed.")
        try:
            import Image
        except ImportError:
            try:
                import PIL as Image
            except ImportError:
                errors.append("The Python Imaging Library is not installed.")
        try:
            import reportlab
        except ImportError:
            errors.append("Reportlab is not installed.")
        try:
            import trml2pdf
        except ImportError:
            errors.append("Tiny RML2PDF is not installed.")
        try:
            import registration
        except ImportError:
            errors.append("Django registration is not installed.")
        try:
            import yaml
        except ImportError:
            errors.append("YAML is not installed.")
        try:
             from satchmo.l10n.utils import get_locale_conv
             get_locale_conv()
        except:
            errors.append("""
            Locale is not set correctly.  Try 
            Unix: sudo locale-gen en_US  
            Windows: set LANGUAGE_CODE in settings.py to LANGUAGE_CODE = 'us'
            """)
        try:
            cache_avail = settings.CACHE_BACKEND<commit_msg>Add some additional troubleshooting tips.<commit_after>from django.core.management.base import NoArgsCommand
import sys
import django
try:
    from decimal import Decimal
except:
    from django.utils._decimal import Decimal


class Command(NoArgsCommand):
    help = "Check the system to see if the Satchmo components are installed correctly."
    
    def handle_noargs(self, **options):
        from django.conf import settings
        errors = []
        print "Checking your satchmo configuration."
        try:
            import satchmo
        except ImportError:
            errors.append("Satchmo is not installed correctly. Please verify satchmo is on your sys path.")
        print "Using Django version %s" % django.get_version()
        print "Using Satchmo version %s" % satchmo.get_version()
        try:
            import Crypto.Cipher
        except ImportError:
            errors.append("The Python Cryptography Toolkit is not installed.")
        try:
            import Image
        except ImportError:
            try:
                import PIL as Image
            except ImportError:
                errors.append("The Python Imaging Library is not installed.")
        try:
            import reportlab
        except ImportError:
            errors.append("Reportlab is not installed.")
        try:
            import trml2pdf
        except ImportError:
            errors.append("Tiny RML2PDF is not installed.")
        try:
            import registration
        except ImportError:
            errors.append("Django registration is not installed.")
        try:
            import yaml
        except ImportError:
            errors.append("YAML is not installed.")
        try:
             from satchmo.l10n.utils import get_locale_conv
             get_locale_conv()
        except:
            errors.append("""
            Locale is not set correctly.  Try 
            Unix: sudo locale-gen en_US  
            If the above does not work, try
            sudo localedef -i en_US -f ISO-8859-1 en_US
            Windows: set LANGUAGE_CODE in settings.py to LANGUAGE_CODE = 'us'
            """)
        try:
            cache_avail = settings.CACHE_BACKEND
{'fraction_non_alphanumeric': 0.06232427366447985, 'fraction_numerical': 0.0030459231490159327, 'mean_word_length': 1.8422103861517976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2552820', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1040, 'n_words': 365}