Ticket #568: config_mod.diff

File config_mod.diff, 3.4 KB (added by anonymous, 19 years ago)

patch for configuration

  • conf/global_settings.py

     
    6767# the site managers.
    6868DEFAULT_FROM_EMAIL = 'webmaster@localhost'
    6969
     70# This is the string that prefixes the admin and manager email messages
     71EMAIL_IDENT = "[Django]"
     72
    7073# Whether to append trailing slashes to URLs.
    7174APPEND_SLASH = True
    7275
     
    167170# URL that handles the media served from MEDIA_ROOT.
    168171# Example: "http://media.lawrence.com"
    169172MEDIA_URL = ''
     173
     174# This is the path to the JING executable
     175JING = '/usr/bin/jing'
  • core/defaulttags.py

     
    219219            try:
    220220                t = template.Template(output)
    221221                return t.render(context)
    222             except template.TemplateSyntaxError:
     222            except template.TemplateSyntaxError,e:
     223                raise e
    223224                return '' # Fail silently for invalid included templates.
    224225        return output
    225226
  • core/validators.py

     
    2323phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)
    2424url_re = re.compile(r'^http://\S+$')
    2525
    26 JING = '/usr/bin/jing'
     26from django.conf.settings import JING
    2727
    2828class ValidationError(Exception):
    2929    def __init__(self, message):
     
    211211    catch 'motherfucker' as well. Raises a ValidationError such as:
    212212        Watch your mouth! The words "f--k" and "s--t" are not allowed here.
    213213    """
    214     bad_words = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit'] # all in lower case
     214    bad_words = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit','assclown'] # all in lower case
    215215    field_data = field_data.lower() # normalize
    216216    words_seen = [w for w in bad_words if field_data.find(w) > -1]
    217217    if words_seen:
  • core/mail.py

     
    11# Use this module for e-mailing.
    22
    3 from django.conf.settings import DEFAULT_FROM_EMAIL, EMAIL_HOST
     3from django.conf.settings import DEFAULT_FROM_EMAIL, EMAIL_HOST, EMAIL_IDENT
    44from email.MIMEText import MIMEText
     5
    56import smtplib
    67
    78def send_mail(subject, message, from_email, recipient_list, fail_silently=False):
     
    4142def mail_admins(subject, message, fail_silently=False):
    4243    "Sends a message to the admins, as defined by the ADMINS constant in settings.py."
    4344    from django.conf.settings import ADMINS, SERVER_EMAIL
    44     send_mail('[Django] ' + subject, message, SERVER_EMAIL, [a[1] for a in ADMINS], fail_silently)
     45    send_mail(EMAIL_IDENT + ' ' + subject, message, SERVER_EMAIL, [a[1] for a in ADMINS], fail_silently)
    4546
    4647def mail_managers(subject, message, fail_silently=False):
    4748    "Sends a message to the managers, as defined by the MANAGERS constant in settings.py"
    4849    from django.conf.settings import MANAGERS, SERVER_EMAIL
    49     send_mail('[Django] ' + subject, message, SERVER_EMAIL, [a[1] for a in MANAGERS], fail_silently)
     50    send_mail(EMAIL_IDENT + ' ' + subject, message, SERVER_EMAIL, [a[1] for a in MANAGERS], fail_silently)
Back to Top