This is a simple module for use with django to make a per user
dropbox access simple
Requirements:
* standard django authentication
* django sessions enabeled
* dropbox python api
>> easy_install dropbox
To use this dropbox module you have to add the following configuration to your
settings.py file
`DROPBOX_SETTINGS = {
  'app_key'    : "insert key",
  'app_secret' : "insert secret",
  'type'       : "app_folder",
}`
and of course to include it in INSTALLED_APPS
`INSTALLED_APPS = (
...,
'django_dropbox',
)`
to make a table to store personal access tokens for your users run
>> python manage.py syncdb
In your views you can import the dropbox_user_required decorator
to mark views that should recive the named parameter dropbox_client
`
from django_dropbox.decorator import dropbox_user_required
@dropbox_user_required
def myViewFunk(request, ..., dropbox_client):
    file = ...
    dropbox_client.put_file(file)
`
                
            
            
        
        
        
            
                
                This is a snippet for a simple CAPTCHA. A random image from a list of images is shown, and the form checks if the correct solution was given.  
Normally I would use django-simple-captcha or maybe reCAPTCHA, but in this case I wanted to have a number of fixed images, nothing dynamically generated.  
I wanted to include the contact form in multiple pages, most of which are `direct_to_template` generic views.
However, passing the random image to the `extra_context` of `direct_to_template` didn't work, because the value was only initialized once on startup.  
Therefore I pass the list of possible choices to `extra_context`, and use the template filter `|random` to select one image. The form's clean method will check if the correct solution was given when `form.is_valid()` is called in the view. If not, the view will display a new captcha.
Of course there are other, more elegant solutions like a custom template tag or overriding the generic view, but this works fine for me. Using a fixed number of images will probably not provide good protection for sites that are of much interest to spammers, but for smaller sites it should be sufficient.
You can see the CAPTCHA in action at [http://www.lackieren-in-polen.de/](http://www.lackieren-in-polen.de/)