Stucked in Tutorial 3
Hi, I am very new in Django and Python. I am stucked in Tutorial 3 in part "Write views that actually do something". I don't get it to run the index.html. I have copied: " from django.template import Context, loader from mysite.polls.models import Poll from django.http import HttpResponse def index(request): latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] t = loader.get_template('polls/index.html') c = Context({ 'latest_poll_list': latest_poll_list, }) return HttpResponse(t.render(c)) " in my views.py. My setting file looks like this: "TEMPLATE_DIRS = ("/home/username/dtest/mysite/templates" # Put strings here, like "/home/html/django_templates" or "C:/www/ django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) I get this answer if I type this in my browser "http://127.0.0.1:8000/ polls": File "/home/username/dtest/mysite/../mysite/polls/views.py", line 13 return HttpResponse(t.render(c)) SyntaxError: 'return' outside function What is wrong? Thanks for help!!! Craphunter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
SITE_ID
Hey, I do have problem with SITE_ID. I don't really get this. What is it? I am using the django registration from bitbucker. When I click on register I get the following error-message: You're using the Django "sites framework" without having set the SITE_ID setting. Create a site in your database and set the SITE_ID setting to fix this error. Am I right that I do have to set an ID in my database? For example mysql > test.db table 1? settings.py SITE_ID = 1 Can somebody write me a little tutorial? Thanks, Craphunter PS: Sorry, newbee! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: SITE_ID
Yes, I have read it, but I don't really get it. What is the meaning of it? Craphunter On 25 Sep., 16:51, Max Countryman wrote: > http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#site-id > > On Sep 25, 2010, at 10:50 AM, craphunter wrote: > > > Hey, > > > I do have problem with SITE_ID. I don't really get this. What is it? > > > I am using the django registration from bitbucker. When I click on > > register I get the following error-message: > > > You're using the Django "sites framework" without having set the > > SITE_ID setting. Create a site in your database and set the SITE_ID > > setting to fix this error. > > > Am I right that I do have to set an ID in my database? > > > For example > > mysql > test.db table 1? > > > settings.py > > > SITE_ID = 1 > > > Can somebody write me a little tutorial? > > > Thanks, > > > Craphunter > > > PS: Sorry, newbee! > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: SITE_ID
Yes, I have read it, but I don't really get it. What ist the meaning? What do I have to do?! Craphunter On 25 Sep., 16:50, craphunter wrote: > Hey, > > I do have problem with SITE_ID. I don't really get this. What is it? > > I am using the django registration from bitbucker. When I click on > register I get the following error-message: > > You're using the Django "sites framework" without having set the > SITE_ID setting. Create a site in your database and set the SITE_ID > setting to fix this error. > > Am I right that I do have to set an ID in my database? > > For example > mysql > test.db table 1? > > settings.py > > SITE_ID = 1 > > Can somebody write me a little tutorial? > > Thanks, > > Craphunter > > PS: Sorry, newbee! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Checkbox registration from
Hi, I am using this code for registration http://code.google.com/p/django-registration/. It is working fine properly. But I don't get one thing to run. How do I run the checkbox with the term of service. I do I implement this in my registration_form.html? Thanks in advance!!! I appreciate! craphunter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Checkbox registration from
Sorry! HOW do I implement this in my registration_form.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Checkbox registration from
still don't get it. what do I have to type in my template?! tia craphunter On 29 Sep., 22:30, aa56280 wrote: > You'll have to use the RegistrationFormTermsOfService class instead of > RegistrationForm. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Registrion activate.html 0.8
Hi, I am using the registration 0.8 alpha. I can create an account and the activation email is send the activation link. When I click on the link the account is getting active in the database but the message on the webpage is telling me something different. I do use this template. {% extends "base.html" %} {% block title %}Account activated{% endblock %} {% block content %} Account activated. {% load humanize %} {% if account %} Thanks for signing up! Now you can log in. {% else %} Sorry, it didn't work. Either your activation link was incorrect, or the activation key for your account has expired; activation keys are only valid for {{ expiration_days|apnumber }} days after registration. {% endif %} {% endblock %} Why doesn't come up the Thanks... text obviously the use is activated in the database? Do I have to set up something in the configuration file? Craphunter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.