Login

Snippets by yourcelf

Snippet List

Better debugging mail server

Python includes (and [Django recommends](http://docs.djangoproject.com/en/dev/topics/email/?from=olddocs#testing-e-mail-sending)) a simple email debugging server which prints mail to stdout. The trouble is, unlike any half-competent mail reader, long lines are broken up, and thus long URLs don't work without modification. This snippet simply unwraps long lines (broken by "=") so long URLs can be easily copied/pasted from the terminal. Save this snippet into a file named "better.py" and execute it.

  • mail
  • debuggingserver
  • long-lines
Read More

MoinMoin auth backend

This snippet implements an authentication backend for MoinMoin user accounts. If you have a MoinMoin running on the same server which has users, you can allow those users to sign into a Django site with the same username and password. To use, define the following settings: MOIN_DATA_DIR = "/path/to/moinmoin/data/dir" AUTH_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', '<this snippet module>.MoinMoinBackend', ) # optional list of groups that authenticating users must be in MOIN_AUTH_GROUPS = ["EditorGroup",]

  • auth
  • backend
  • moinmoin
Read More

yourcelf has posted 2 snippets.