"not all arguments converted during string formatting" Python Django

django, python

Solution

Change:

ruta = "MultimediaData/Users/$s/%s"%(self.user.username, filename)

To:

ruta = "MultimediaData/Users/%s/%s"%(self.user.username, filename)
#                            ^ Notice the sign change

You seem to have used a `$` instead of a `%`, which was the problem.

Problem

I am programming in Django 1.5 with Python 2.7 on Windows Vista. I am trying to create user profiles. However, when I visit localhost:8000/admin/home/userprofile, I got the 1146, "Table 'demo.home_userprofile' doesn't exist error. Now I have in `models.py` : ``` from django.db import models from django.contrib.auth.models import User # Create your models here. class userProfile(models.Model): def url(self, filename): ruta = "MultimediaData/Users/$s/%s"%(self.user.username, filename) return ruta user = models.OneToOneField(User) photo = models.ImageField(upload_to = url) telefono = models.CharField(max_length = 30) def __unicode__(self): return self.user.username ``` And Django page is pointing `not all arguments converted during string formatting` error at me. This is a page that allows user to upload picture and phone number. What seems to be the problem?

Original source