Login

Snippets by henrikv

Snippet List

Url overrides and concurrent site versions

If you want to run multiple versions of a site from the same project IE a staging version and the live one, you need two settings and urlconf files. 1. make separate copies of settings_staging.py and urls_staging.py in the project dir. 2. Change SITE_ID and ROOT_URLCONF in settings_staging.py 3. Make extra include lines in the projects urls_staging.py like the example. 4. Add urls_staging.py to applications where you need extra urls. Make them just like you would normally do urls.py Thanks to ronny for suggesting the double entries in urlconf.

  • urlconf
  • staging
Read More

Contact Form

A simple way to get started using newforms. Implement a contact form. Mine saves the data in a table and sends a dedicated mailbox the feedback as well. I added support for TinyMCE as described in the django wiki. http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE?format=txt Anyway use this as a starting point for writing your own form handling.

  • newforms
Read More

henrikv has posted 2 snippets.