Ticket #568: config_mod.diff
File config_mod.diff, 3.4 KB (added by , 19 years ago) |
---|
-
conf/global_settings.py
67 67 # the site managers. 68 68 DEFAULT_FROM_EMAIL = 'webmaster@localhost' 69 69 70 # This is the string that prefixes the admin and manager email messages 71 EMAIL_IDENT = "[Django]" 72 70 73 # Whether to append trailing slashes to URLs. 71 74 APPEND_SLASH = True 72 75 … … 167 170 # URL that handles the media served from MEDIA_ROOT. 168 171 # Example: "http://media.lawrence.com" 169 172 MEDIA_URL = '' 173 174 # This is the path to the JING executable 175 JING = '/usr/bin/jing' -
core/defaulttags.py
219 219 try: 220 220 t = template.Template(output) 221 221 return t.render(context) 222 except template.TemplateSyntaxError: 222 except template.TemplateSyntaxError,e: 223 raise e 223 224 return '' # Fail silently for invalid included templates. 224 225 return output 225 226 -
core/validators.py
23 23 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE) 24 24 url_re = re.compile(r'^http://\S+$') 25 25 26 JING = '/usr/bin/jing' 26 from django.conf.settings import JING 27 27 28 28 class ValidationError(Exception): 29 29 def __init__(self, message): … … 211 211 catch 'motherfucker' as well. Raises a ValidationError such as: 212 212 Watch your mouth! The words "f--k" and "s--t" are not allowed here. 213 213 """ 214 bad_words = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit' ] # all in lower case214 bad_words = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit','assclown'] # all in lower case 215 215 field_data = field_data.lower() # normalize 216 216 words_seen = [w for w in bad_words if field_data.find(w) > -1] 217 217 if words_seen: -
core/mail.py
1 1 # Use this module for e-mailing. 2 2 3 from django.conf.settings import DEFAULT_FROM_EMAIL, EMAIL_HOST 3 from django.conf.settings import DEFAULT_FROM_EMAIL, EMAIL_HOST, EMAIL_IDENT 4 4 from email.MIMEText import MIMEText 5 5 6 import smtplib 6 7 7 8 def send_mail(subject, message, from_email, recipient_list, fail_silently=False): … … 41 42 def mail_admins(subject, message, fail_silently=False): 42 43 "Sends a message to the admins, as defined by the ADMINS constant in settings.py." 43 44 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) 45 46 46 47 def mail_managers(subject, message, fail_silently=False): 47 48 "Sends a message to the managers, as defined by the MANAGERS constant in settings.py" 48 49 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)