Re: Displaying events by month
Thank you Nikolas. Works perfect :) On Wednesday, June 20, 2012 11:21:28 PM UTC+1, Nikolas Stevenson-Molnar wrote: > > First, order by date in your query: > > events = Event.objects.order_by('date') > > Then in your template, use the ifchanged tag ( > https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#ifchanged): > > {% for event in events %} > {% ifchanged event.date.month event.date.year %} > month here > {% endifchanged %} > item here > {% endfor %} > > _Nik > > On 6/20/2012 2:22 PM, grimmus wrote: > > Hi, > > I am trying to output upcoming events in the following format > > *June 2012* > 12th - Event 1 > 15th - Event 2 > > *July 2012* > 1st - Event 3 > > *August 2012* > 20th - Event 4 > > My model is very simple with just a title and dateTime field. I am > unsure how i could output the months followed by the events in the style > above. I guess nested loops would be necessary but would i need a separate > loop for each month output ? > > Thanks for any tips. > -- > 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/-/RHAvjD4cKqUJ. > 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. > > > > -- 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/-/77AAh4wEiBkJ. 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: Stuck with a dynamic form within formwizard
I saw that lots will change in formwizard in future releases of Django, and i could not get this working. Therefore i switched to Jquery formwizard http://thecodemine.org/ This plugin makes it possible to show parts of forms on different pages (and do some server side validation when switching between two pages) I am running in some issues with this as well, but i will start a new topic for this. -- 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.
django-tynimce
Hi, I am using this application, I am able to render the widget but when I am clicking save (tinymce button or html button) the POST form is sent but without the content of the textarea. Any one have some experience about it? My config js is attached and the html rendered code is as follows: -- name='csrfmiddlewaretoken' value='ff9e58be24ff3807fce39286fdd2c033' /> Subject name="subject" size="110" /> Body cols="40" name="body" id="id_body"> tinyMCE.init({"relative_urls": false, "spellchecker_languages": "Spanish / Catalan=es,+English=en", "elements": "id_body", "language": "en", "directionality": "ltr", "theme": "advanced", "strict_loading_mode": 1, "mode": "exact"}) -- Thanks, Xavi -- 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. mail_manager_textareas.js Description: application/javascript
Re: 403 error when POSTing to a view with csrf protection
Hi Mike, Please provide some code examples, a traceback snippet and a bit more info. Here are some great tips on how to do this: https://code.djangoproject.com/wiki/UsingTheMailingList Without this information, others on the list may find it much more difficult to help you. Cal On Sun, Jun 24, 2012 at 7:28 AM, Mike wrote: > I realized that I was heading down the wrong track with my previous > message to this mailing list so I studied the problem some more. Now I am > trying to send a POST request to a view and it gets rejected with a 403 > error. when I disable the csrf requirement using the @csrf_exempt > decorator, the view works as expected. the csrf token is being passed in > the POST request, so I don't understand why else the request fails. Any > ideas? > > -- > 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/-/DDIIvexJoLMJ. > 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. > -- 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.
acces cleaned data from a dynamic form
Django 1.2.3 For a restaurant i want to make a form, were the user can add their address, and their order. The order part is dynamic (users can add extra fields). I used jquery.formset for this. To accomplish this i have an address form and a dishes formset: class Address(models.Model): name = models.CharField(max_length=20) class AddressForm(ModelForm): class Meta: model = Address class DishesForm(forms.Form): dish = forms.CharField(max_length=200) DishesFormset = formsets.formset_factory(DishesForm) In the view i call these forms with: form = AddressForm() formset = DishesFormset() I have two problems with the formset: 1. in the template i can only get a form with {{formset}} . {{formset.dish}} doesn't work 2. how do i access the cleaned_data from the formset? When I test I see in the POST that multiple dishes are posted, but I can only get the first one in the cleaned_data Rob -- 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: Integrity Error: column username is not unique
Hi, username field in django.contrib.auth.User model is unique. Probably, the username you are trying to save already exists. In your view, you might want to check, try: username = User.objects.get(username=form.cleaned_data['username']) except ObjectDoesNotExist: #create user new object here -Dhivya On Sunday, June 24, 2012 9:36:48 AM UTC-4, Nikhil Verma wrote: > > > Hi > > I got this error when i was making a post after filling the details from > the user. > > Can somebody throw a light in this where i am going wrong. > > models.py > > class UserProfile(models.Model): > user = models.ForeignKey(User, blank=True, null=True, unique=True) > first_name = models.CharField(max_length=30, blank=True) > last_name = models.CharField(max_length=30, blank=True) > gender = models.CharField(max_length=1, choices=GENDER_CHOICES, > blank=True) > birth_date = models.DateField(auto_now_add=True) > street = models.CharField(max_length=75, blank=True) > state = models.CharField(max_length=30, blank=True) > zip_code = models.IntegerField(max_length=7, blank=True, null=True) > country = models.CharField(max_length=30, blank=True) > mobile = models.CharField(max_length=15, blank=True) > home_phone = models.CharField(max_length=15, blank=True) > primary_email = models.EmailField(max_length=60, blank=True) > institution_name = > models.CharField(max_length=100,blank=True,null=True) > institution_website = > models.CharField(max_length=100,blank=True,null=True) > > > forms.py > > class UserProfileForm(forms.Form): > > username = forms.CharField(label='Username', max_length=20) > first_name = forms.CharField(label="First Name", max_length=40, > required=True) > last_name = forms.CharField(label="Last Name", max_length=40, > required=True) > gender = forms.CharField(max_length=1, > widget=Select(choices=GENDER_CHOICES), required=True) > date_of_birth = CustomDateField(label='Date of Birth', required=False) > telephone = forms.CharField(label='Mobile Phone', max_length=40, > required=False) > institution_name = forms.CharField(label='Institute Name', > max_length=80, required=False) > street = forms.CharField(label='Street', max_length=100, > required=False) > zip_code = forms.CharField(label='Zip Code', max_length=40, > required=False) > state = forms.CharField(label='State', max_length=80, required=False) > country = forms.CharField(label='Country', max_length=80, > required=False) > institue_name = forms.CharField(label='Institute Name', max_length=80, > required=False) > institue_website = forms.URLField(label='Institute Website', > max_length=80, required=False) > > > views.py > def createprofile(request): > """ > Creating Profile > """ > > if request.method == "POST": > form = UserProfileForm(request.POST) > if form.is_valid(): > user = User( > username = form.cleaned_data['username'], > first_name = form.cleaned_data['first_name'], > last_name = form.cleaned_data['last_name'], > ) > user.save() > userprofile_obj = UserProfile( > user = user.username, > first_name = user.first_name, > last_name = user.last_name, > gender = form.cleaned_data['gender'], > birth_date = form.cleaned_data['date_of_birth'], > mobile = form.cleaned_data['telephone'], > institution_name = form.cleaned_data['institution_name'], > street = form.cleaned_data['street'], > zip_code = form.cleaned_data['zip_code'], > state = form.cleaned_data['state'], > country = form.cleaned_data['country'], > ) > userprofile_obj.save() > > > Any help how can i solve this problem ? > > > -- > Regards > Nikhil Verma > +91-958-273-3156 > > -- 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/-/QlDJxHaSvdsJ. 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.
comment moderation can't work with customized comment
Hi all, The generic comment moderation worked as expected in my application while using the default comment model. Moderation stopped setting ``is_public`` to ``0`` when I customized the build-in comment app by adding a title field as the dev doc said. Here is the code. models.py class Post(models.Model): #... class PostModerator(CommentModerator): email_notification = True enable_field = 'enable_comments' auto_moderate_field = 'date_created' moderate_after = 0 def moderate(self, comment, content_object, request): #... return True moderator.register(Post, PostModerator) class CommentWithTitle(Comment): title = models.CharField(max_length=300) forms.py class CommentFormWithTitle(CommentForm): def get_comment_model(self): return CommentWithTitle def get_comment_create_data(self): data = super(CommentFormWithTitle, self).get_comment_create_data() data['title'] = self.cleaned_data['title'] return data __init__.py def get_model(): return CommentWithTitle def get_form(): return CommentFormWithTitle settings.py INSTALLED_APPS = ( #... 'mycomment', ) COMMENTS_APP = 'mycomment' Comment to post can be saved but can't be moderated. Did I make something wrong? Thanks. -- 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/-/kzuT4koXrEcJ. 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: Send message to SMS Gateway
Have a look at a Bulk SMS Gatway from txtNation - SMS Gateway. See the SMPP API on-line at: http://wiki.txtnation.com/wiki/SMPP_Bulk and their info on http://gateway.txtnation.com -- 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/-/JknOrTGfI4kJ. 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: Working Django forums code for integration?
Are there any forum packages not listed at > > http://www.djangopackages.com/grids/g/forums/ -- 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/-/OefJfoaDiVoJ. 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.
DISTINCT ON fields is not supported by this database backend
Please help, http://dpaste.com/762942/ Thanks alot ! -- 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/-/v5qIbmtR5ZwJ. 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: DISTINCT ON fields is not supported by this database backend
DISTINCT ON fields is not supported by this database backend What more is there to say? Either stop using the distinct method, or switch to another database backend. On Sun, Jun 24, 2012 at 11:24 AM, upmauro wrote: > Please help, > > http://dpaste.com/762942/ > > Thanks alot ! > > -- > 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/-/v5qIbmtR5ZwJ. > 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. > -- Marcin Tustin Tel: 07773 787 105 -- 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: New to DJANGO
On Thu, Jun 21, 2012 at 9:37 PM, LJ wrote: > I started out learning Django using the "Writing your first Django app" > article: > https://docs.djangoproject.com/en/dev/intro/tutorial01/ > This is a very well-written tutorial that goes through each part in detail. > Please note, at the bottom of each section there is a link to the next > section. There are 3 parts. > Part 2 shows how to create the urls.py. > Part 3 shows how to create the views.py. The tutorial has expanded to 4 lessons and I cannot recommend it highly enough - is one of the best introductions available for new users. I regularly go back to it to look over and keep my eye in. cheers L. -- 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.
Finding a developer
I have been planning to implement my backend server in Django/Python but I am still in the early phases. I thought I ought to look into Ruby on Rails as well. The technical articles comparing them come out pretty even. It appears that there is perhaps three times as much RR activity out there as Django/Python. I am doing prototype work myself right now, but I will need professional help eventually. That led me to my question. Is it easier to find a Django developer or a Rails developer? Despite there being more activity around Rails, the availability of developers may not follow. Also, is there any difference in cost? Cheers, Bob Bob Carlson | +1 719 571 9228 (office) | +1 541 521 9525 (mobile) b...@rjcarlson.com | rjcarlson49 (aim or skype) -- 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: Finding a developer
Hello Bob, I think its easier to find a RR developer than a django developer (definitely in my region / and I think this is international) In terms of costs both should be quite similar - Experience will set the rate. Regards, -- Raphael http://develissimo.com On Sun, 2012-06-24 at 13:35 -0700, Bob Carlson wrote: > I have been planning to implement my backend server in Django/Python > but I am still in the early phases. I thought I ought to look into > Ruby on Rails as well. The technical articles comparing them come out > pretty even. It appears that there is perhaps three times as much RR > activity out there as Django/Python. I am doing prototype work myself > right now, but I will need professional help eventually. That led me > to my question. > > > > Is it easier to find a Django developer or a Rails developer? Despite > there being more activity around Rails, the availability of developers > may not follow. Also, is there any difference in cost? > > > > Cheers, Bob > > > > Bob Carlson | +1 719 571 9228 (office) | +1 541 521 9525 (mobile) > > b...@rjcarlson.com | rjcarlson49 (aim or skype) > > > > -- > 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. -- 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: 403 error when POSTing to a view with csrf protection
Hey Mike, Make sure that you include this within your block: {% csrf_token %} Then, check the source code of that page to make sure the CSRF token tag was included. Finally, using a Javascript debugger (such as Firebug) check to make sure that your request sent, when clicking the "submit" button, included the csrf token. Also, make sure your cache and sessions are setup correctly as that is what Django relies upon for using this protection. On Sun, Jun 24, 2012 at 9:15 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi Mike, > > Please provide some code examples, a traceback snippet and a bit more info. > > Here are some great tips on how to do this: > https://code.djangoproject.com/wiki/UsingTheMailingList > > Without this information, others on the list may find it much more > difficult to help you. > > Cal > > On Sun, Jun 24, 2012 at 7:28 AM, Mike wrote: > >> I realized that I was heading down the wrong track with my previous >> message to this mailing list so I studied the problem some more. Now I am >> trying to send a POST request to a view and it gets rejected with a 403 >> error. when I disable the csrf requirement using the @csrf_exempt >> decorator, the view works as expected. the csrf token is being passed in >> the POST request, so I don't understand why else the request fails. Any >> ideas? >> >> -- >> 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/-/DDIIvexJoLMJ. >> 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. >> > > -- > 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. > -- 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: Finding a developer
well, it may be hard to find if you require their presence otherwise you will find many great developers who are looking for remote full/ part time work. On Jun 24, 11:35 pm, "Bob Carlson" wrote: > I have been planning to implement my backend server in Django/Python but I am > still in the early phases. I thought I ought to look into Ruby on Rails as > well. > The technical articles comparing them come out pretty even. It appears that > there is perhaps three times as much RR activity out there as Django/Python. I > am doing prototype work myself right now, but I will need professional help > eventually. That led me to my question. > > Is it easier to find a Django developer or a Rails developer? Despite there > being more activity around Rails, the availability of developers may not > follow. > Also, is there any difference in cost? > > Cheers, Bob > > Bob Carlson | +1 719 571 9228 (office) | +1 541 521 9525 (mobile) > > b...@rjcarlson.com | rjcarlson49 (aim or skype) -- 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.
Userena configuration
Hi, I just installed Userena and it works fine. I would like to use the signup form where the button for the terms of service appear but I can't find how. And also when editing a user profile, there is a field called privacy, it does not really make sense in my case so I set it up to default to Closed but now I would like it to disappear from the editable fields in the profile, how can I do that? Thanks for your help. -- 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/-/CjgA4_DLmoUJ. 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: Userena configuration
Hey Bastian, For the privacy portion, you'll need to create your own Form based on the Userena's user-editing form and just exclude that field. As for the terms of service -- I'm not sure off of the bat. I could possibly take a look in the next few days if nobody jumps in with an answer. You might have good luck just reading over the userena source code. It's really well written and nicely commented. On Sun, Jun 24, 2012 at 5:45 PM, Bastian wrote: > Hi, > > I just installed Userena and it works fine. I would like to use the signup > form where the button for the terms of service appear but I can't find how. > And also when editing a user profile, there is a field called privacy, it > does not really make sense in my case so I set it up to default to Closed > but now I would like it to disappear from the editable fields in the > profile, how can I do that? > > Thanks for your help. > > -- > 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/-/CjgA4_DLmoUJ. > 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. > -- 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.
Uninstall for clean install
I need to uninstall django (on ubuntu) so as to do a clean installation. Anybody have a procedure for removing django cleanly? Thanks -- 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/-/vhtf6u6MEqwJ. 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: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.
On Friday, June 22, 2012 3:46:42 PM UTC-4, Bill Torcaso wrote: > > > Hi, > I'm working through the tutorail. Part 1 was fine, and part 2 shows me > the site with the light blue background. I proceed to make my first app, > 'djangotest'. > >1. I run django-admin.py and get a project >2. I edit settings.py to select sqlite3, and put in an absolute path >to a sqlite db file. I leave 'America/Chicago' unchanged. the same error >happens if I change it to my timezone in EST. >3. When I run syncdb, I get this error. I look in the source and it >has something to do with 'locale' and a tuple of (None, None). Please > help. > > > [-] python manage.py syncdb > Creating tables ... > Creating table auth_permission > Creating table auth_group_permissions > Creating table auth_group > Creating table auth_user_user_permissions > Creating table auth_user_groups > Creating table auth_user > Creating table django_content_type > Creating table django_session > Creating table django_site > > You just installed Django's auth system, which means you don't have any > superusers defined. > Would you like to create one now? (yes/no): yes > Traceback (most recent call last): > File "manage.py", line 10, in > execute_from_command_line(sys.argv) > File > "/Library/Python/2.7/site-packages/django/core/management/__init__.py", > line 443, in execute_from_command_line > utility.execute() > File > "/Library/Python/2.7/site-packages/django/core/management/__init__.py", > line 382, in execute > self.fetch_command(subcommand).run_from_argv(self.argv) > File "/Library/Python/2.7/site-packages/django/core/management/base.py", > line 196, in run_from_argv > self.execute(*args, **options.__dict__) > File "/Library/Python/2.7/site-packages/django/core/management/base.py", > line 232, in execute > output = self.handle(*args, **options) > File "/Library/Python/2.7/site-packages/django/core/management/base.py", > line 371, in handle > return self.handle_noargs(**options) > File > "/Library/Python/2.7/site-packages/django/core/management/commands/syncdb.py", > > line 110, in handle_noargs > emit_post_sync_signal(created_models, verbosity, interactive, db) > File "/Library/Python/2.7/site-packages/django/core/management/sql.py", > line 189, in emit_post_sync_signal > interactive=interactive, db=db) > File "/Library/Python/2.7/site-packages/django/dispatch/dispatcher.py", > line 172, in send > response = receiver(signal=self, sender=sender, **named) > File > "/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", > > line 73, in create_superuser > call_command("createsuperuser", interactive=True, database=db) > File > "/Library/Python/2.7/site-packages/django/core/management/__init__.py", > line 150, in call_command > return klass.execute(*args, **defaults) > File "/Library/Python/2.7/site-packages/django/core/management/base.py", > line 232, in execute > output = self.handle(*args, **options) > File > "/Library/Python/2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", > > line 70, in handle > default_username = get_default_username() > File > "/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", > > line 105, in get_default_username > default_username = get_system_username() > File > "/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", > > line 85, in get_system_username > return getpass.getuser().decode(locale.getdefaultlocale()[1]) > TypeError: decode() argument 1 must be string, not None > > > Thanks, > > -- Bill > -- 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/-/12tQAZJkzyUJ. 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: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.
Thanks, Kurtis. More googling brought me the answer, found here: http://level09.com/54/tip-how-to-fix-django-locale-problem-on-mac-osx-10-7 The solution is to explicitly export LANG and a bunch of LC_* local variables in ~/.bashrc. This may be a workaround, but it's good enough for me. The precise problem seems to be that there is no default locale set, not even the C locale, so locale.get_default_locale() returns (None, None), and calling code blows up. Since the link mentions Mac OSX 10.7 and was posted two months ago, it seems likely that this is a recently-created problem on Macs. Whoever maintains the tutorial might consider mentioning this, if only in a footnote. Cheers, -- Bill On Friday, June 22, 2012 4:22:22 PM UTC-4, Kurtis wrote: > > Did you get an opportunity to type anything after "yes"? Or did it > just blow up at that point? > > Based on the traceback, it looks like it is having trouble getting > your system's default username. I've never really noticed that it has > that functionality before but I wonder if there's something "weird" > about your System's configuration? > > Which version of Django are you using? > > To by-pass this (until you get the real problem worked out) give this a > shot: > > python manage.py shell # This will open up a terminal-shell in your > Django Environment > from django.contrib.auth.models import User # Import the User Model so > we can create a new user > user = User.objects.create_user(username='someusername', > password='somepassword', is_superuser=True) # Create the new User > (Remember these credentials) > user.save() # Save the User > exit() # Exit the Python Shell > > And you should be all good to go. > > On Fri, Jun 22, 2012 at 3:46 PM, Bill Torcaso > wrote: > > > > > > Hi, > > I'm working through the tutorail. Part 1 was fine, and part 2 shows me > the site with the light blue background. I proceed to make my first app, > 'djangotest'. > > > > I run django-admin.py and get a project > > I edit settings.py to select sqlite3, and put in an absolute path to a > sqlite db file. I leave 'America/Chicago' unchanged. the same error > happens if I change it to my timezone in EST. > > When I run syncdb, I get this error. I look in the source and it has > something to do with 'locale' and a tuple of (None, None). Please help. > > > > > > [-] python manage.py syncdb > > Creating tables ... > > Creating table auth_permission > > Creating table auth_group_permissions > > Creating table auth_group > > Creating table auth_user_user_permissions > > Creating table auth_user_groups > > Creating table auth_user > > Creating table django_content_type > > Creating table django_session > > Creating table django_site > > > > You just installed Django's auth system, which means you don't have any > superusers defined. > > Would you like to create one now? (yes/no): yes > > Traceback (most recent call last): > > File "manage.py", line 10, in > > execute_from_command_line(sys.argv) > > File > "/Library/Python/2.7/site-packages/django/core/management/__init__.py", > line 443, in execute_from_command_line > > utility.execute() > > File > "/Library/Python/2.7/site-packages/django/core/management/__init__.py", > line 382, in execute > > self.fetch_command(subcommand).run_from_argv(self.argv) > > File > "/Library/Python/2.7/site-packages/django/core/management/base.py", line > 196, in run_from_argv > > self.execute(*args, **options.__dict__) > > File > "/Library/Python/2.7/site-packages/django/core/management/base.py", line > 232, in execute > > output = self.handle(*args, **options) > > File > "/Library/Python/2.7/site-packages/django/core/management/base.py", line > 371, in handle > > return self.handle_noargs(**options) > > File > "/Library/Python/2.7/site-packages/django/core/management/commands/syncdb.py", > > line 110, in handle_noargs > > emit_post_sync_signal(created_models, verbosity, interactive, db) > > File > "/Library/Python/2.7/site-packages/django/core/management/sql.py", line > 189, in emit_post_sync_signal > > interactive=interactive, db=db) > > File > "/Library/Python/2.7/site-packages/django/dispatch/dispatcher.py", line > 172, in send > > response = receiver(signal=self, sender=sender, **named) > > File > "/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", > > line 73, in create_superuser > > call_command("createsuperuser", interactive=True, database=db) > > File > "/Library/Python/2.7/site-packages/django/core/management/__init__.py", > line 150, in call_command > > return klass.execute(*args, **defaults) > > File > "/Library/Python/2.7/site-packages/django/core/management/base.py", line > 232, in execute > > output = self.handle(*args, **options) > > File > "/Library/Python/2.7/site-packages/django/contrib/auth/management/comma
Re: Uninstall for clean install
How did you install it? Did you do it through apt-get or did you install it through a downloaded tar.gz package from the Django website? On Jun 25, 2012 12:31 AM, "thomasgrzybow...@gmail.com" < thomasgrzybow...@gmail.com> wrote: > I need to uninstall django (on ubuntu) so as to do a clean installation. > Anybody have a procedure for removing django cleanly? > Thanks > > -- > 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/-/vhtf6u6MEqwJ. > 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. > -- 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: Uninstall for clean install
To answer my own question, if you did it through the package manager try sudo apt-get purge python-django on the command line if from tar.gz package, on the command line change directory to /usr/local/lib/python(your version)/dist-packages/ and delete django files there using sudo rm django -rf and th Django egg info. That's how it's done on Ubuntu 12.04 On 25 June 2012 01:17, Gethin Llyn ab Alwyn wrote: > How did you install it? Did you do it through apt-get or did you install > it through a downloaded tar.gz package from the Django website? > On Jun 25, 2012 12:31 AM, "thomasgrzybow...@gmail.com" < > thomasgrzybow...@gmail.com> wrote: > >> I need to uninstall django (on ubuntu) so as to do a clean installation. >> Anybody have a procedure for removing django cleanly? >> Thanks >> >> -- >> 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/-/vhtf6u6MEqwJ. >> 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. >> > -- 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: runserver and the tty echo flag
On Tue, Jun 5, 2012 at 9:18 AM, Bill Freeman wrote: > I have been noticing in recent Django versions (I don't remember it in > 1.2, probably) that having run the development server, the tty's echo > flag is set afterwards, no matter its value before. (I frequently run > from an emacs shell window, which has echo off because emacs will have > "echoed" the text into the window long before it is sent to the pseudo > tty.) > > I would expect most programs that fiddle with the tty configuration to > restore it on exit. > > So, is this intentional, or a regression that I should try to help find > and fix? > > It was an intentional change, a fix for: https://code.djangoproject.com/ticket/15565 Code as initially written has already required a couple of changes to work properly in unanticipated environments. If you've got another such fix feel free to open a ticket with suggested improvement. Karen -- 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: Uninstall for clean install
Thomas, If you've ever wanted to know why vitualenv is a good idea - here's a great reason. Since it compartmentalises everything - packages the whole deal, you can just create a new virtualenv and start developing. http://www.arthurkoziel.com/2008/10/22/working-virtualenv/ Cheers L. On Sun, Jun 24, 2012 at 5:46 PM, Gethin Llyn ab Alwyn wrote: > To answer my own question, if you did it through the package manager try > > sudo apt-get purge python-django on the command line > > if from tar.gz package, on the command line change directory to > /usr/local/lib/python(your version)/dist-packages/ and delete django files > there using sudo rm django -rf and th Django egg info. > > That's how it's done on Ubuntu 12.04 > > > On 25 June 2012 01:17, Gethin Llyn ab Alwyn wrote: >> >> How did you install it? Did you do it through apt-get or did you install >> it through a downloaded tar.gz package from the Django website? >> >> On Jun 25, 2012 12:31 AM, "thomasgrzybow...@gmail.com" >> wrote: >>> >>> I need to uninstall django (on ubuntu) so as to do a clean installation. >>> Anybody have a procedure for removing django cleanly? >>> Thanks >>> >>> -- >>> 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/-/vhtf6u6MEqwJ. >>> 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. > > > -- > 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. -- 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: Uninstall for clean install
+1 virtualenv, and virtualenvwrapper On Jun 25, 2012 2:06 AM, "Lachlan Musicman" wrote: > Thomas, If you've ever wanted to know why vitualenv is a good idea - > here's a great reason. Since it compartmentalises everything - > packages the whole deal, you can just create a new virtualenv and > start developing. > > http://www.arthurkoziel.com/2008/10/22/working-virtualenv/ > > > Cheers > L. > > > On Sun, Jun 24, 2012 at 5:46 PM, Gethin Llyn ab Alwyn > wrote: > > To answer my own question, if you did it through the package manager try > > > > sudo apt-get purge python-django on the command line > > > > if from tar.gz package, on the command line change directory to > > /usr/local/lib/python(your version)/dist-packages/ and delete django > files > > there using sudo rm django -rf and th Django egg info. > > > > That's how it's done on Ubuntu 12.04 > > > > > > On 25 June 2012 01:17, Gethin Llyn ab Alwyn wrote: > >> > >> How did you install it? Did you do it through apt-get or did you install > >> it through a downloaded tar.gz package from the Django website? > >> > >> On Jun 25, 2012 12:31 AM, "thomasgrzybow...@gmail.com" > >> wrote: > >>> > >>> I need to uninstall django (on ubuntu) so as to do a clean > installation. > >>> Anybody have a procedure for removing django cleanly? > >>> Thanks > >>> > >>> -- > >>> 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/-/vhtf6u6MEqwJ. > >>> 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. > > > > > > -- > > 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. > > -- > 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. > > -- 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.
base_url() in django
Actually, I was PHP developer, I use codeigniter as framework. In codeigniter, we can call helper url functions base_url() and it will return absolute domain url such: http://example.com or https://example.com It is automatically, we even don't need to create custom function, because base_url() is a helper function. I call the base_url() function just in views (in django context it will be template). So, what 'function' should I call in django template to return absolute path domain such base_url() in Codeigniter? -- 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/-/FwpDcOVfaRUJ. 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: Creating permalink for blog tags that have the Post class as foreign key
On Mon, Jun 25, 2012 at 8:40 AM, Matthew Meyer wrote: > Hi all, Django newbie here, > > I have a simple blog app I am working on and am trying to figure out the > best way to create a permalink for tags that I have added for blog posts. > Basically, my models.py consists of two classes: Post and Tag, which has > Post as a foreign key: http://dpaste.org/Ojhh5/ > > I am then trying to access the permalink to the tag using: {{ > tag.get_absolute_url }} Hi Matthew, If {{ tag.get_absolute_url }} isn't rendering anything, once of three things must be happening: 1) get_absolute_url isn't defined. Tag clearly has a get_absolute_url method, and there's no typo there, so this isn't the problem. 2) get_absolute_url is raising an error, or returning None. You can check this by putting some debug in the get_absolute_url method, or sticking a python debugger breakpoint in the method. 3) tag isn't a valid variable in the template you're rendering. In the context you're rendering, tag is a variable in a for loop -- so the first think to establish is whether you're iterative over anything at all. Are you seeing anything rendered by the for loop, or is it just the {{ tag.get_absolute_url }} call that is returning an empty string? If it's just get_absolute_url, then the problem is (2); otherwise, you need to look into (3). The other way to debug this -- fire up a Python shell. Django's template language silences almost all errors. This is by design, since the worst thing you could have in production is error messages leaking through to the user. However, the upshot of this is that templates can be harder to debug, since there's no difference between "doesn't work" and "nothing to print". However, if you fire up a Python shell (./manage.py shell), you can interrogate the same API that the template is using: # Do your imports, then... # Get the post you want to render >>> post = get_object_or_404(Post, tag='my tag') # Print the list of tags >>> print post.posttag_set.all() # Print the absolute URL for the first tag >>> print post.posttag_set.all()[0].get_absolute_url() If there's an error being raised somewhere, these calls will show you the full error trace, rather than silencing the errors. Hope that helps you debug the problem! Yours, Russ Magee %-) -- 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: Creating permalink for blog tags that have the Post class as foreign key
I didn't think to check the shell! It is definitely issue 2. I was able to output: >>> for tag in post.posttag_set.all(): tag.get_absolute_url() ... '/blog/footag/' which is exactly what I expect. (I have one post with the tag "footag") post = get_object_or_404(Post, tag='footag') returns the error: FieldError: Cannot resolve keyword 'tag' into field. Choices are: html, id, posttag, pub_date, slug, title So I tried: post = get_object_or_404(Post, posttag='footag') which returned: ValueError: invalid literal for int() with base 10: 'zzz' I think a lot of my issues are being caused by my ignorance of how I would refer to a Post objects tag since they are only related via foreign key. btw, my templates print the tags perfectly with {% for tag in post.posttag_set.all %} so seeing >>> for tag in post.posttag_set.all(): tag.get_absolute_url() print the tag url exactly came as a surprise to me. On Sunday, June 24, 2012 8:40:25 PM UTC-4, Matthew Meyer wrote: > > Hi all, Django newbie here, > > I have a simple blog app I am working on and am trying to figure out the > best way to create a permalink for tags that I have added for blog posts. > Basically, my models.py consists of two classes: Post and Tag, which has > Post as a foreign key: http://dpaste.org/Ojhh5/ > > I am then trying to access the permalink to the tag using: {{ > tag.get_absolute_url }} > > This doesn't seem to print anything however. I am basically just > replicating the method I used to generate the permalink for the slug field > in my Post class. I guess it isn't working since Tag is using post as > a foreign key though or something? Being a beginner though, I really have > no clue. > > Can explain what I am doing wrong as well as point me in the direction of > the correct way to achieve the goal here? > > Other relevant code: > blogapp urls.py: http://dpaste.org/D69gw/ > views.py: http://dpaste.org/Hoku3/ > template: http://dpaste.org/eIXCY/ > -- 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/-/_1ufinwp-TgJ. 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: Creating permalink for blog tags that have the Post class as foreign key
I didn't think to check the shell! It is definitely issue 2. I was able to output: >>> for tag in post.posttag_set.all(): tag.get_absolute_url() ... '/blog/footag/' which is exactly what I expect. (I have one post with the tag "footag") post = get_object_or_404(Post, tag='footag') returns the error: FieldError: Cannot resolve keyword 'tag' into field. Choices are: html, id, posttag, pub_date, slug, title So I tried: post = get_object_or_404(Post, posttag='footag') which returned: ValueError: invalid literal for int() with base 10: 'zzz' I think a lot of my issues are being caused by my ignorance of how I would refer to a Post objects tag since they are only related via foreign key. btw, my templates print the tags perfectly with {% for tag in post.posttag_set.all %} so seeing >>> for tag in post.posttag_set.all(): tag.get_absolute_url() print the tag url exactly came as a surprise to me. On Sunday, June 24, 2012 9:13:32 PM UTC-4, Russell Keith-Magee wrote: > > On Mon, Jun 25, 2012 at 8:40 AM, Matthew Meyer > https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=matthewwilliamme...@gmail.com>> > > wrote: > > Hi all, Django newbie here, > > > > I have a simple blog app I am working on and am trying to figure out the > > best way to create a permalink for tags that I have added for blog > posts. > > Basically, my models.py consists of two classes: Post and Tag, which has > > Post as a foreign key: http://dpaste.org/Ojhh5/ > > > > I am then trying to access the permalink to the tag using: {{ > > tag.get_absolute_url }} > > Hi Matthew, > > If {{ tag.get_absolute_url }} isn't rendering anything, once of three > things must be happening: > > 1) get_absolute_url isn't defined. Tag clearly has a get_absolute_url > method, and there's no typo there, so this isn't the problem. > > 2) get_absolute_url is raising an error, or returning None. You can > check this by putting some debug in the get_absolute_url method, or > sticking a python debugger breakpoint in the method. > > 3) tag isn't a valid variable in the template you're rendering. > > In the context you're rendering, tag is a variable in a for loop -- so > the first think to establish is whether you're iterative over anything > at all. Are you seeing anything rendered by the for loop, or is it > just the {{ tag.get_absolute_url }} call that is returning an empty > string? If it's just get_absolute_url, then the problem is (2); > otherwise, you need to look into (3). > > The other way to debug this -- fire up a Python shell. Django's > template language silences almost all errors. This is by design, since > the worst thing you could have in production is error messages leaking > through to the user. However, the upshot of this is that templates can > be harder to debug, since there's no difference between "doesn't work" > and "nothing to print". However, if you fire up a Python shell > (./manage.py shell), you can interrogate the same API that the > template is using: > > # Do your imports, then... > # Get the post you want to render > >>> post = get_object_or_404(Post, tag='my tag') > > # Print the list of tags > >>> print post.posttag_set.all() > > # Print the absolute URL for the first tag > >>> print post.posttag_set.all()[0].get_absolute_url() > > If there's an error being raised somewhere, these calls will show you > the full error trace, rather than silencing the errors. > > Hope that helps you debug the problem! > > Yours, > Russ Magee %-) > -- 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/-/kezRIPNyCAsJ. 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: Creating permalink for blog tags that have the Post class as foreign key
After making some changes debugging in the shell revealed, I have gotten it to work, thanks!!! On Sunday, June 24, 2012 9:13:32 PM UTC-4, Russell Keith-Magee wrote: > > On Mon, Jun 25, 2012 at 8:40 AM, Matthew Meyer > https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=matthewwilliamme...@gmail.com>> > > wrote: > > Hi all, Django newbie here, > > > > I have a simple blog app I am working on and am trying to figure out the > > best way to create a permalink for tags that I have added for blog > posts. > > Basically, my models.py consists of two classes: Post and Tag, which has > > Post as a foreign key: http://dpaste.org/Ojhh5/ > > > > I am then trying to access the permalink to the tag using: {{ > > tag.get_absolute_url }} > > Hi Matthew, > > If {{ tag.get_absolute_url }} isn't rendering anything, once of three > things must be happening: > > 1) get_absolute_url isn't defined. Tag clearly has a get_absolute_url > method, and there's no typo there, so this isn't the problem. > > 2) get_absolute_url is raising an error, or returning None. You can > check this by putting some debug in the get_absolute_url method, or > sticking a python debugger breakpoint in the method. > > 3) tag isn't a valid variable in the template you're rendering. > > In the context you're rendering, tag is a variable in a for loop -- so > the first think to establish is whether you're iterative over anything > at all. Are you seeing anything rendered by the for loop, or is it > just the {{ tag.get_absolute_url }} call that is returning an empty > string? If it's just get_absolute_url, then the problem is (2); > otherwise, you need to look into (3). > > The other way to debug this -- fire up a Python shell. Django's > template language silences almost all errors. This is by design, since > the worst thing you could have in production is error messages leaking > through to the user. However, the upshot of this is that templates can > be harder to debug, since there's no difference between "doesn't work" > and "nothing to print". However, if you fire up a Python shell > (./manage.py shell), you can interrogate the same API that the > template is using: > > # Do your imports, then... > # Get the post you want to render > >>> post = get_object_or_404(Post, tag='my tag') > > # Print the list of tags > >>> print post.posttag_set.all() > > # Print the absolute URL for the first tag > >>> print post.posttag_set.all()[0].get_absolute_url() > > If there's an error being raised somewhere, these calls will show you > the full error trace, rather than silencing the errors. > > Hope that helps you debug the problem! > > Yours, > Russ Magee %-) > -- 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/-/7VGh436MKSEJ. 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.