So now I am still at the Django tutorial part 3:
http://docs.djangoproject.com/en/1.1/intro/tutorial03/#intro-tutorial03
Trying to set up the urls.py with this piece of code provided by the tutorial
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^polls/$', 'mysite.polls.views.index'),
(r'^polls/(?P<poll_id>\d+)/$', 'mysite.polls.views.detail'),
(r'^polls/(?P<poll_id>\d+)/results/$', 'mysite.polls.views.results'),
(r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
(r'^admin/', include(admin.site.urls)),
)
If I change my default urls.py (with nothing in it) with this code, the 127.0.0.1:8000/polls/ is showing up, but for some reason the 127.0.0.1:8000/admin is no longer there and gives me the following error:
Exception Type: TemplateSyntaxError Exception Value: Caught an exception while rendering: Tried vote in module mysite.polls.views. Error was: 'module' object has no attribute 'vote'
And this (Error line 30):
Caught an exception while rendering: Tried vote in module mysite.polls.views. Error was: 'module' object has no attribute 'vote'
20 <!-- Header -->
21 <div id="header">
22 <div id="branding">
23 {% block branding %}{% endblock %}
24 </div>
25 {% if user.is_authenticated and user.is_staff %}
26 <div id="user-tools">
27 {% trans 'Welcome,' %}
28 <strong>{% firstof user.first_name user.username %}</strong>.
29 {% block userlinks %}
**30 {% url django-admindocs-docroot as docsroot %}**
31 {% if docsroot %}
32 <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
33 {% endif %}
34 {% url admin:password_change as password_change_url %}
35 {% if password_change_url %}
36 <a href="{{ password_change_url }}">
37 {% else %}
38 <a href="{{ root_path }}password_change/">
39 {% endif %}
40 {% trans 'Change password' %}</a> /
It seems to me that the error should be here:
(r'^admin/', include(admin.site.urls)),
But I cant find it.
Thanks for the attention!!