Oh, and it works when the url is http://localhost:8000/polls/1/vote/

On Thursday, August 16, 2012 11:19:09 AM UTC+8, Sky wrote:
>
> I'm pretty sure the source is the same as I copied it out from the editor. 
> I'm using sqlite3, not sure if that affects anything. I'm not sure what's 
> wrong as I got the code straight from the tutorial.
>
> The traceback:
>
>
>    - 
>    
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py
>     in get_response
>    1. 
>       
>                                   request.path_info)
>       
>       ...
>    ▶ Local vars <http://localhost:8000/polls/#>
>    - 
>    
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py
>     in resolve
>    1. 
>       
>                           sub_match = pattern.resolve(new_path)
>       
>       ...
>    ▶ Local vars <http://localhost:8000/polls/#>
>    - 
>    
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py
>     in resolve
>    1. 
>       
>                   return ResolverMatch(self.callback, args, kwargs, self.name)
>       
>       ...
>    ▶ Local vars <http://localhost:8000/polls/#>
>    - 
>    
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py
>     in callback
>    1. 
>       
>               self._callback = get_callable(self._callback_str)
>       
>       ...
>    ▶ Local vars <http://localhost:8000/polls/#>
>    - 
>    
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py
>     in wrapper
>    1. 
>       
>               result = func(*args)
>       
>       ...
>    ▶ Local vars <http://localhost:8000/polls/#>
>    - 
>    
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py
>     in get_callable
>    1. 
>       
>                           (lookup_view, mod_name))
>       
>       ...
>    ▶ Local vars <http://localhost:8000/polls/#>
>    
>
> On Thursday, August 16, 2012 11:03:27 AM UTC+8, Kurtis wrote:
>>
>> This line should be commented out: "Uncomment the next two lines to 
>> enable the admin:"
>>
>> Also, I don't see why it's trying to import 'polls.views.index'. That 
>> would be a function named 'index' in your views.py file in the polls 
>> directory (also known as a module). Not only does that 'index' 
>> method/function not exist, I don't see anywhere in your urls.py that 
>> indicates you are trying to load or otherwise reference that method.
>>
>> So as Melvyn implied, are you sure this source code you presented is 
>> exactly the same as you're trying to run? I think he assumed you were using 
>> a WSGI Handler -- but runserver should pick up any changes that you make up 
>> to the structure automatically.
>>
>> Can you share the traceback that your web browser shows when you try to 
>> access your Django application? Just make sure to hide any 
>> private/sensetive data:
>> http://localhost:8000 after executing 'python manage.py runserver'
>>
>> On Wed, Aug 15, 2012 at 10:45 PM, Sky <a.technic...@gmail.com> wrote:
>>
>>> How do I do that? 
>>>
>>> I've tried the commands python manage.py syncdb followed by python 
>>> manage.py runserver several times but they don't work.
>>>
>>>
>>> On Wednesday, August 15, 2012 9:45:21 PM UTC+8, Melvyn Sopacua wrote:
>>>>
>>>> On 15-8-2012 10:01, Pengfei Xue wrote: 
>>>> > there's no function in views.py, you should define that 'index' 
>>>> > handler 
>>>>
>>>> No, he's not using it according to source. 
>>>> Which means the source is not in sync with what is being run, typically 
>>>> fixed by restarting the WSGI provider. 
>>>>
>>>> -- 
>>>> Melvyn Sopacua 
>>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/django-users/-/VTBxdWtZXTYJ.
>>>
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/iMjF3xXQia8J.
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.

Reply via email to