djangosnippets.org: Latest snippets tagged with 'spam'https://djangosnippets.org/tags/spam/2015-05-04T18:16:01.755350-05:00Template Tag to protect the E-mail address
2015-05-04T18:16:01.755350-05:00end0https://djangosnippets.org/snippets/10482/<p>Update to https://djangosnippets.org/snippets/1907/ to be a bit more flexible, and code cleaned up a tiny bit.</p>
<p>To use, add this snippet as a file in a templatetags folder in an app or in a project. Then include and call the tag with </p>
<p>{% obfuscate_email 'email' %}
or
{% obfuscate_email 'email' …</p>
Freely redistributableClean spam from comments by running management command and akismet
2012-10-20T17:49:27.612326-05:00iElectrichttps://djangosnippets.org/snippets/2835/<p>..</p>
Freely redistributablekonkr.com API detect is spam - lastest
2011-11-25T19:14:22.233180-06:00magik_cypresshttps://djangosnippets.org/snippets/2611/<p>Detect Spam or Ham with a konkr web-service</p>
<p>https://konkr.com/api-documentation</p>
Freely redistributablekonkr.com API detect is spam
2011-11-25T12:08:54.058488-06:00magik_cypresshttps://djangosnippets.org/snippets/2610/<p>Detect Spam or Ham with a konkr web-service</p>
<p>https://konkr.com/api-documentation</p>
Freely redistributableHammeringMiddleware
2011-03-10T17:10:05.462985-06:00pandoodlhttps://djangosnippets.org/snippets/2389/<p>A middleware which will protect from page hammering using flexible spanning time windows using the cache backend.
Please read the Docstring of the class for details.</p>
Freely redistributableEncode emails as URIs
2010-08-18T19:18:27.225426-05:00fahhemhttps://djangosnippets.org/snippets/2155/<p>Put this snippet in a file in a templatetags/ directory and load it in your templates. Then use it to encode your emails:</p>
<p><code>{{"email@example.com"|html_encode_email}}</code></p>
<p>Or if you want some control over the anchor tag:</p>
<p><code><a href="mailto:{{"email@example.com"|html_encode}}&subject=Feedback">Send Feedback</a></code></p>
<p>From <a href="http://fahhem.com/">fahhem.com</a> and <a href="http://recreclabs.com/">Recrec Labs</a></p>
Freely redistributableAntiSpamForm
2010-02-14T11:47:39.052847-06:00zenxhttps://djangosnippets.org/snippets/1925/<p>A general AntiSpamForm using some tricks to prevent spam based on current <a href="http://code.djangoproject.com/browser/django/trunk/django/contrib/comments/forms.py">django.contrib.comments.forms</a>. It uses a timestamp, a security hash and a honeypot field. See <a href="http://www.djangosnippets.org/snippets/1856/">AntiSpamModelForm</a> too.</p>
Freely redistributableAntiSpamModelForm
2010-01-07T19:31:40.568628-06:00zenxhttps://djangosnippets.org/snippets/1856/<p>A general AntiSpamModelForm using some tricks to prevent spam based on current <a href="http://code.djangoproject.com/browser/django/trunk/django/contrib/comments/forms.py">django.contrib.comments.forms</a>. It uses a timestamp, a security hash and a honeypot field. See <a href="http://www.djangosnippets.org/snippets/1925/">AntiSpamForm</a> too.
</p>
Freely redistributablePrevent Django newcomments spam with Akismet (reloaded)
2009-07-17T02:20:04.313759-05:00sciyoshihttps://djangosnippets.org/snippets/1638/<p>This is a rewrite of <a href="http://www.djangosnippets.org/snippets/1006/">snippet #1006</a> to use the moderation features available in Django's comments framework. This is more customizable than the signals approach and works well if other moderation features are being used. If you want to make comments that are flagged as spam become hidden instead of …</p>
Freely redistributableentity encoded email-address
2009-04-16T04:40:12.024625-05:00emnahttps://djangosnippets.org/snippets/1443/<p>entity encoded string for a somewhat safer email-address.</p>
<p>this filter encodes strings to numeric entities, almost every standard-browsers decodes the entities and display them the right way.</p>
<p>needless to say that bots are smart, so this is not a 100% guaranteed spam prevention.</p>
Freely redistributableUsing Akismet/TypePad AntiSpam with Django's new comments framework
2008-08-27T18:27:54.252749-05:00sciyoshihttps://djangosnippets.org/snippets/1006/<p>See the description in the blog entry at <a href="http://sciyoshi.com/blog/2008/aug/27/using-akismet-djangos-new-comments-framework/">http://sciyoshi.com/blog/2008/aug/27/using-akismet-djangos-new-comments-framework/</a>
</p>
Freely redistributableHoneypot Field
2007-03-23T17:05:47.789591-05:00SmileyChrishttps://djangosnippets.org/snippets/131/<p>Simple anti-spam field which will cause the form to raise a <code>ValidationError</code> if the value in this field changes. Displays as a CSS hidden <code><input type="text" /></code> field.</p>
<p>If you specify a <code>class</code> in the <code>attrs</code> of the widget, the default <code>style="display:none;"</code> won't be rendered with the widget so that …</p>
Freely redistributableAkismet Webservice
2007-03-14T17:17:19.955700-05:00sneeuhttps://djangosnippets.org/snippets/107/<p>A short little bit of code to test for comment spam against Akimet.</p>
<p>Use:
a = Akismet('<AkismetKey>', 'http://sneeu.com/blog/')
a.verify_key()
print a.comment_check(
comment_author='...',
comment_author_email='sneeu@example.com',
user_ip='10.0.0.1',
comment_content="""Comment content!"""
)</p>
Freely redistributable