background preloader

Webdevelopment

Facebook Twitter

Tool

How to use sessions | Django Documentation. Django provides full support for anonymous sessions. The session framework lets you store and retrieve arbitrary data on a per-site-visitor basis. It stores data on the server side and abstracts the sending and receiving of cookies. Cookies contain a session ID – not the data itself (unless you’re using the cookie based backend). Enabling sessions Sessions are implemented via a piece of middleware. To enable session functionality, do the following: Edit the MIDDLEWARE_CLASSES setting and make sure it contains 'django.contrib.sessions.middleware.SessionMiddleware'.

If you don’t want to use sessions, you might as well remove the SessionMiddleware line from MIDDLEWARE_CLASSES and 'django.contrib.sessions' from your INSTALLED_APPS. Configuring the session engine By default, Django stores sessions in your database (using the model django.contrib.sessions.models.Session). Using database-backed sessions Using cached sessions For better performance, you may want to use a cache-based session backend. Django-values - Google Code. An add-on application for Django that allows placeholders for settings to be defined in Python, while their values are set by staff using an editor while the server is up and running. Many value types are available, and they each map to a native Python type, so model methods and other Python code can access them as standard class attributes.

Much effort has also been made to reduce the overhead of this feature, so that the database is only queried once during each server restart, and only updated when the values themselves are updated. NOTE: This is not intended as a replacement for settings.py. This is designed for values that are expected to change based on the needs of the site or its users, so that such changes don't require so much as a restart. settings.py is still the place to go for settings that will only vary by project. Requirements: Django SVN (5302 revision or later) Benefits: XBLinJS Home. XBLinJS is an implementation of XBL-style widgets in pure, cross-platform Javascript, DOM 1, and CSS 1. (Higher levels of those technologies may be used, at the corresponding cost in cross-platform compatibility.) It provides the benefits of XBL in cross-platform HTML, and experimentally, provides a most-feature replacement for XBL in Mozilla development. (XBLinJS can be used selectively, too; you need not convert an entire existing XBL application over.)

In addition to that fundamental capability, XBLinJS implements several web widgets for use in web pages, which may be seen on the demo page if you are using a compatible browser. XBLinJS is targetted at experienced Web developers looking for a framework to organize and abstract out large chunks of dynamic, client-side code, often with AJAX-style code. Vital links: I believe the Widget interface is now stable, though implementation may continue to be tweaked. XBLinJS also brings some unique advantages that pure XBL does not have: BookChapter-4-1-TheControllerAPI – windmill – Trac.

Django Support in Trunk - Windmill Developers. I just made a pretty large checkin that adds support for running Windmill tests from your Django test framework. I won't be documenting it until we push it out in a release so I figured I should send out and email to show how it works. Basically what I did was take some code that has yet to be checked in to Django for running tests against a live server (ticket # and ported it to dynamically patch the pieces of the Django unittest framework it needed to and add a new TestCase class that could kick off windmill's test framework.

All you need to do is add a new WindmillUnitTestCase subclass anywhere that will get picked up by the Django unittest framework ( ). You tell the class where your tests are and what browser to use and it does all the rest for you. Here is an example from the new windmill unit test for making sure this feature stays working: -Mikeal.