Re: Processing a file...

2009-02-13 Thread Amirouche B.

thank you for your answers and the insight into the how servers works.

Using a background process, is kind of a burden for deployement
but let's do it the way it works :D
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Processing a file...

2009-02-12 Thread Amirouche B.

Hello,

I 'd like to process some file before saving it, let's say it's an
audio file that I want to be converted to ogg before it lands in the
database forever.

I tried to run ffmpeg2theora in the save method of the models but this
doesn't work verywell, the testserver hangup after the processing is
done.

## FILE : models.py, ##

class Song:
[...]

def save(self):
super(Song, self).save()
path = self.file.path.split("/")
path, file = path[1:-1], path[-1]
joined_path = "/"
for e in path:
joined_path += e + "/"

os.chdir(joined_path)

res = os.popen("/usr/bin/ffmpeg2theora " + path)

any help ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Unicode errors

2008-07-19 Thread Amirouche B.

it works, I don't know why but...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Unicode errors

2008-07-19 Thread Amirouche B.

here are my models http://dpaste.com/66067/

I use smart_unicode even if it's already UTF-8 and no more error but
nothing appears in the admin detailed view of posts

On 19 juil, 14:49, Amirouche <[EMAIL PROTECTED]> wrote:
> I'm using the trunck version
>
> Environment:
>
> Request Method: GET
> Request URL:http://127.0.0.1:8000/admin/blogfeeds/post/15/
> Django Version: 0.97-newforms-admin-SVN-7977
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.admin',
>  'blogfeeds']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware')
>
> Template error:
> In template /home/amirouche/local/src/django/django/contrib/admin/
> templates/admin/change_form.html, error at line 19
>    Caught an exception while rendering: 'ascii' codec can't encode
> character u'\u2605' in position 0: ordinal not in range(128)
>    9 : {% block stylesheet %}{% admin_media_prefix %}css/forms.css{%
> endblock %}
>
>    10 :
>
>    11 : {% block coltype %}{% if ordered_objects %}colMS{% else
> %}colM{% endif %}{% endblock %}
>
>    12 :
>
>    13 : {% block bodyclass %}{{ opts.app_label }}-
> {{ opts.object_name.lower }} change-form{% endblock %}
>
>    14 :
>
>    15 : {% block breadcrumbs %}{% if not is_popup %}
>
>    16 : 
>
>    17 :      {% trans "Home" %} 
>
>    18 :      {{ opts.verbose_name_plural|capfirst }}
> 
>
>    19 :      {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{%
> else %} {{ original|truncatewords:"18" }} {% endif %}
>
>    20 : 
>
>    21 : {% endif %}{% endblock %}
>
>    22 :
>
>    23 : {% block content %}
>
>    24 : {% block object-tools %}
>
>    25 : {% if change %}{% if not is_popup %}
>
>    26 :    class="historylink">{% trans "History" %}
>
>    27 :   {% if has_absolute_url %}{% trans
> "View on site" %}{% endif%}
>
>    28 :   
>
>    29 : {% endif %}{% endif %}
>
> Traceback:
> File "/home/amirouche/local/src/django/django/core/handlers/base.py"
> in get_response
>   85.                 response = callback(request, *callback_args,
> **callback_kwargs)
> File "/home/amirouche/local/src/django/django/contrib/admin/sites.py"
> in root
>   144.                 return self.model_page(request, *url.split('/',
> 2))
> File "/home/amirouche/local/src/django/django/views/decorators/
> cache.py" in _wrapped_view_func
>   44.         response = view_func(request, *args, **kwargs)
> File "/home/amirouche/local/src/django/django/contrib/admin/sites.py"
> in model_page
>   161.         return admin_obj(request, rest_of_url)
> File "/home/amirouche/local/src/django/django/contrib/admin/
> options.py" in __call__
>   252.             return self.change_view(request, unquote(url))
> File "/home/amirouche/local/src/django/django/contrib/admin/
> options.py" in change_view
>   581.         return self.render_change_form(request, context,
> change=True, obj=obj)
> File "/home/amirouche/local/src/django/django/contrib/admin/
> options.py" in render_change_form
>   460.         ], context,
> context_instance=template.RequestContext(request))
> File "/home/amirouche/local/src/django/django/shortcuts/__init__.py"
> in render_to_response
>   18.     return HttpResponse(loader.render_to_string(*args,
> **kwargs), **httpresponse_kwargs)
> File "/home/amirouche/local/src/django/django/template/loader.py" in
> render_to_string
>   107.     return t.render(context_instance)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   176.         return self.nodelist.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   751.                 bits.append(self.render_node(node, context))
> File "/home/amirouche/local/src/django/django/template/debug.py" in
> render_node
>   71.             result = node.render(context)
> File "/home/amirouche/local/src/django/django/template/loader_tags.py"
> in render
>   97.         return compiled_parent.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   176.         return self.nodelist.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   751.                 bits.append(self.render_node(node, context))
> File "/home/amirouche/local/src/django/django/template/debug.py" in
> render_node
>   71.             result = node.render(context)
> File "/home/amirouche/local/src/django/django/template/loader_tags.py"
> in render
>   97.         return compiled_parent.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   176.         return self.nodelist.render(context)
> File "/home/amirouche/local/src/django/django/template/__init__.py" in
> render
>   751.