title: django+uploadify - don't working
body: <p>I'm trying to use an example posted on the "github" the link is <a href="http://github.com/tstone/django-uploadify" rel="nofollow noreferrer">http://github.com/tstone/django-uploadify</a>. And I'm having trouble getting work. can you help me? I followed step by step, but does not work.</p>
  
  <p>Accessing the "URL" / upload /
  the only thing is that returns "True"</p>
  
  <p><strong>part of settings.py</strong></p>
  
  <pre><code>import os
  PROJECT_ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
  
  MEDIA_ROOT = os.path.join(PROJECT_ROOT_PATH, 'media')
  TEMPLATE_DIRS = (  os.path.join(PROJECT_ROOT_PATH, 'templates'))
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from django.conf.urls.defaults import *
  from django.conf import settings
  from teste.uploadify.views import *
  from django.contrib import admin
  
  admin.autodiscover()
  
  urlpatterns = patterns('',
      (r'^admin/', include(admin.site.urls)),  
      url(r'upload/$', upload, name='uploadify_upload'),
  )
  </code></pre>
  
  <p><strong>views.py</strong> </p>
  
  <pre><code>from django.http import HttpResponse
  import django.dispatch
  
  upload_received = django.dispatch.Signal(providing_args=['data'])
  
  def upload(request, *args, **kwargs):
      if request.method == 'POST':
          if request.FILES:
              upload_received.send(sender='uploadify', data=request.FILES['Filedata'])
      return HttpResponse('True') 
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from django.db import models
  
  def upload_received_handler(sender, data, **kwargs):
      if file:
          new_media = Media.objects.create(
              file = data,
              new_upload = True,
       )
  
      new_media.save()
      upload_received.connect(upload_received_handler, dispatch_uid='uploadify.media.upload_received')
  
  class Media(models.Model):
      file = models.FileField(upload_to='images/upload/', null=True, blank=True)
      new_upload = models.BooleanField()
  </code></pre>
  
  <p><strong>uploadify_tags.py</strong></p>
  
  <pre><code>from django import template
  
  from teste import settings 
  
  register = template.Library()
  
  @register.inclusion_tag('uploadify/multi_file_upload.html', takes_context=True)
  
      def multi_file_upload(context, upload_complete_url):
          """
          * filesUploaded - The total number of files uploaded
          * errors - The total number of errors while uploading
          * allBytesLoaded - The total number of bytes uploaded
          * speed - The average speed of all uploaded files
          """
          return {
              'upload_complete_url' : upload_complete_url,
              'uploadify_path' : settings.UPLOADIFY_PATH, # checar essa linha
              'upload_path' : settings.UPLOADIFY_UPLOAD_PATH,
          }    
  </code></pre>
  
  <p><strong>template - uploadify/multi_file_upload.html</strong></p>
  
  <pre><code>{% load uploadify_tags }{ multi_file_upload '/media/images/upload/' %}
  &lt;script type="text/javascript" src="{{ MEDIA_URL }}js/swfobject.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.uploadify.js"&gt;&lt;/script&gt;
  &lt;div id="uploadify" class="multi-file-upload"&gt;&lt;input id="fileInput" name="fileInput" type="file" /&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;// &lt;![CDATA[
  $(document).ready(function() {
      $('#fileInput').uploadify({
          'uploader'    : '/media/swf/uploadify.swf',
          'script'    : '{% url uploadify_upload %}',
          'cancelImg'   : '/media/images/uploadify-remove.png/',
          'auto'     : true,
          'folder'    : '/media/images/upload/',
          'multi'    : true,
          'onAllComplete' : allComplete
      });
  });
  
  function allComplete(event, data) {
   $('#uploadify').load('{{ upload_complete_url }}', {
    'filesUploaded'  : data.filesUploaded,
    'errorCount'   : data.errors,
    'allBytesLoaded'  : data.allBytesLoaded,
    'speed'     : data.speed
   });
  
   // raise custom event
   $('#uploadify') .trigger('allUploadsComplete', data);
  }
  // ]]&lt;/script&gt;
  </code></pre>