Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode issue with url input #5

Closed
mutaku opened this issue Apr 4, 2011 · 1 comment
Closed

unicode issue with url input #5

mutaku opened this issue Apr 4, 2011 · 1 comment

Comments

@mutaku
Copy link
Owner

mutaku commented Apr 4, 2011

Environment:

Request Method: GET
Request URL: http://192.168.11.4:8001/url/http://forecast.weather.gov/MapClick.php?CityName=Philadelphia&state=PA&site=PHI&lat=39.9525&lon=-75.1657/

Django Version: 1.3 SVN-16009
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'shortener']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/home/mugen/programming/django/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/mugen/programming/Stumpy/shortener/views.py" in submit
  2. thisurl = url(longurl=theurl)

Exception Type: TypeError at /url/http://forecast.weather.gov/MapClick.php?CityName=Philadelphia&state=PA&site=PHI&lat=39.9525&lon=-75.1657/
Exception Value: 'unicode' object is not callable

from shortener.models import url
url = u'http://t04u.be/'
type(url)
<type 'unicode'>
b = url(longurl=url)
Traceback (most recent call last):
File "", line 1, in
TypeError: 'unicode' object is not callable
from django.utils.encoding import smart_str
b = url(longurl=smart_str(url))
Traceback (most recent call last):
File "", line 1, in
TypeError: 'unicode' object is not callable
smart_str(url)
'http://t04u.be/'
type(smart_str(url))
<type 'str'>
a = smart_str(url)
type(a)
<type 'str'>
b = url(longurl=a)
Traceback (most recent call last):
File "", line 1, in
TypeError: 'unicode' object is not callable

@mutaku mutaku closed this as completed Apr 4, 2011
@mutaku
Copy link
Owner Author

mutaku commented Apr 4, 2011

fixed. changed class names. was using a variable url which was also a class. doh. i'm a tired moron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant