Can't create super user

2011-03-05 Thread royy
Hello.

I can't create a superuser for an admin area,  i type username and e-
mail, then when I try to type password the keyboard freezes and
doesn't respond so I need to use the Ctrl + break to quit server (I'm
following the steps for writing my first Django app).

I tried to create it in two different ways after the command python
manage.py syncdb and then with command manage.py createsuperuser but
still can't.

Please 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.



template loader is missing a character.

2011-03-12 Thread royy
Hi.

I'm following the tutotial for my first Django app, in part 3 after
edit the views.py file  I'm getting the error.

I already created the polls directory with the index.html file as
indicated in the tutorial, also I've edited the setting.py to indicate
where the templates are located. When I run the server or load the
page I'm getting this error:

TemplateDoesNotExist at /polls/
polls/index.html

Django tried loading these templates, in this order:

•Using loader django.template.loaders.filesystem.Loader:
◦c:\documents and settings\hp_propietario\mysite\ emplates\polls
\index.html (File does not exist)
•Using loader django.template.loaders.app_directories.Loader:
◦c:\python27\lib\site-packages\django\contrib\admin\templates\polls
\index.html (File does not exist)

As you can see template loader is missing the letter " t "  of
templates

I've changed twice the directory in TEMPLATE_DIRS and still getting
the same error.

What can I do to fix this problem?

Thanks.

-- 
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: template loader is missing a character.

2011-03-12 Thread royy
error fixed.

The problem: I was using c:\documents and settings\hp_propietario
\mysite\ emplates\polls
\index.html (File does not exist)

instead of:

c:/documents and settings/hp_propietario/mysite/templates/polls
/index.html (File does not exist)

thanks..

-- 
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.



help to finish my 1st Django app.

2011-03-14 Thread royy
Hi.

I've finished the tutorial for the polls app.

I tought everythin was OK till I load the server and type the addres:
http://127.0.0.1:8000/polls/

web browser shows me the message "No polls are available" isn't a web
browser error message, because it is plain text.

I've created 3 polls with 3 choices each one.

admin page works fine, just the polls address is the one that don't
loads well. This is my final views.py code:

from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.template import RequestContext
from polls.models import Choice, Poll

def vote(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
try:
selected_choice = p.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):

return render_to_response('polls/poll_detail.html', {
'poll': p,
'error_message': "You didn't select a choice.",
}, context_instance=RequestContext(request))
else:
selected_choice.votes += 1
selected_choice.save()
return HttpResponseRedirect(reverse('poll_results',
args=(p.id,)))

-

and this is my final polls/urls.py code:

from django.conf.urls.defaults import *
from polls.models import Poll

info_dict = {
'queryset': Poll.objects.all(),
}

urlpatterns = patterns('',
(r'^$', 'django.views.generic.list_detail.object_list',
info_dict),
(r'^(?P\d+)/$',
'django.views.generic.list_detail.object_detail', info_dict),
url(r'^(?P\d+)/results/$',
'django.views.generic.list_detail.object_detail', dict(info_dict,
template_name='polls/results.html'), 'poll_results'),
(r'^(?P\d+)/vote/$', 'polls.views.vote'),
)


Please help me to find what's wrong.

Thanks

-- 
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.