Apache environment variables in Django 1.6

2013-11-20 Thread Jon Dufresne
Hi, I recently upgraded my Django application from 1.5 to 1.6. This application runs on Apache with mod_wsgi. After upgrading, Django seems unable to access environment variables set by Apache using SetEnv and SetEnvIf. Using Django 1.5 I was able to access this using the following recipe in

Model Design: Adding Params to Relationship FIelds

2013-11-20 Thread Thomas Murphy
Hi all, I'm working on a hour-reporting system. Each Project has many Users, and each User has many Projects(These are established and working nicely). My design issue is this: How can I assign each User an IntegerField "Hours" on each Project they are assigned to? This Integer Field is

Re: Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
Does the fact that I use a relat_name on the Review.paper field have anything to do with it not working? In the Review model, notice: paper = models.ForeignKey(Paper, verbose_name=_('Paper'), related_name="%(app_label)s_%(class)s_related+", null=False, blank=False, help_text=_("Select a paper."))

Re: Using admin views "outside" of admin

2013-11-20 Thread Gonzalo Delgado
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 El 20/11/13 12:54, Brad Smith escribió: > Based on other threads I've read here, it seems that the > conventional wisdom is that the admin interface is only for > low-level access to the database, and isn't designed for anything > "fancy", like

Re: Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
Thanks DAniel. The models: class Review(models.Model): """ A review of one paper.""" INCLUDE_CHOICES = [(True,'Include'),(False,'Exclude')] paper = models.ForeignKey(Paper, verbose_name=_('Paper'), related_name="%(app_label)s_%(class)s_related+", null=False, blank=False,

Re: Using Aggregate and Count

2013-11-20 Thread Daniel Roseman
On Wednesday, 20 November 2013 20:04:13 UTC, Timothy W. Cook wrote: > > Hi Daniel, > > On Wed, Nov 20, 2013 at 5:47 PM, Daniel Roseman > > wrote: > > On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > > > > You're accessing a `review_count`

Re: Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
Hi Daniel, On Wed, Nov 20, 2013 at 5:47 PM, Daniel Roseman wrote: > On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > You're accessing a `review_count` attribute via each Paper instance, but you > haven't set up anything that would do that - you only

Re: Admin custom template

2013-11-20 Thread Luca Corti
On 19/nov/2013, at 11:29, Mrinmoy Das wrote: > I have made a functionality where a user can input address through google map > on a site. Now the thing is, how can I enable the same stuff on django admin > panel? I am using django-grappelli. Any help guys? > > I have

Re: Using Aggregate and Count

2013-11-20 Thread Daniel Roseman
On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > I see there was a similar question on this issue earlier today but > alas it didn't answer my question. > > In my app I have models for: > Project: a project (not really part of this question but used for > context in the

Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
I see there was a similar question on this issue earlier today but alas it didn't answer my question. In my app I have models for: Project: a project (not really part of this question but used for context in the question). Paper: an academic paper description Review: a review of a paper ...

Re: Writing your first Django app, part 1

2013-11-20 Thread Larry Barnett
Found it. I had Polls in the wrong place in the settings file. Thanks! On Wednesday, November 20, 2013 12:39:14 PM UTC-6, Larry Barnett wrote: > > In the tutorial after I enter: > > python manage.py sql polls > > I get the following error: > > CommandError: App with label polls could not be

Re: Writing your first Django app, part 1

2013-11-20 Thread Jonathan Baker
Is "polls" listed in within INSTALLED_APPS of settings.py? If so, does your polls app have an __init__.py file? On Wed, Nov 20, 2013 at 11:39 AM, Larry Barnett wrote: > In the tutorial after I enter: > > python manage.py sql polls > > I get the following error: > >

Writing your first Django app, part 1

2013-11-20 Thread Larry Barnett
In the tutorial after I enter: python manage.py sql polls I get the following error: CommandError: App with label polls could not be found. Are you sure your INSTALLED_APPS setting is correct? I have built the site twice with the same results. I cannot locate any error in the example or the

Re: data not saving through a many to many relationship

2013-11-20 Thread MikeKJ
Update: So editing AdviceLevel with def edit_advice(request): if not request.user.is_authenticated(): return HttpResponseRedirect('/user/login/') this_advice = request.POST.get('advice_id') sp = Specialism.objects.all().filter(advicelevel=this_advice) de =

Re: AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'

2013-11-20 Thread burak . kuyucakli
Hello, Is there an answer to this problem? On Tuesday, July 2, 2013 4:56:08 PM UTC+3, Pratik Mandrekar wrote: > > Hey Tom, > > My ROOT_URLCONF points to 'urls' which is the top level urlconf for my > site. Besides all my urls do work. This error keeps coming intermittently > but does not

Using admin views "outside" of admin

2013-11-20 Thread Brad Smith
Hello all, Based on other threads I've read here, it seems that the conventional wisdom is that the admin interface is only for low-level access to the database, and isn't designed for anything "fancy", like users with different levels of administrative rights within an app, etc. Ok, I get

Re: How to test django app

2013-11-20 Thread bobhaugen
Recommend: https://pycon-2012-notes.readthedocs.org/en/latest/testing_and_django.html http://webtest.pythonpaste.org/en/latest/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it,

Re: Django Admin Error: pop-up entry form

2013-11-20 Thread Derek
Solved. You need to add "u" to the unicode representation of your model's record. As in: def __unicode__(self): return u'%s' % self.fieldname This "error" does not show up in the normal admin page for the model, only when its accessed via the pop-up route. On Tuesday, 19

Re: How can I forloop this count() in my template code?

2013-11-20 Thread Pepsodent Cola
Thanks Tom it worked! :) On Wednesday, November 20, 2013 12:18:23 PM UTC+1, Pepsodent Cola wrote: > > How can I forloop this count() in my template code? > > * I have attached my project files that you might run and see for > yourselves. > * I have attached a screenshot of the table I'm working

Re: Invalid control character char 30262

2013-11-20 Thread Chi Tak Lam
I end up fix the problem by just passing strict=false to json.loads()... json.loads(response.read(), strict=False). The error didn't occur anymore, seem like working fine. Thanks On Saturday, November 9, 2013 11:44:53 PM UTC+8, Chi Tak Lam wrote: > > Hi, > > I have a django-celery task to

Re: Tango with Django Chapter 7 (Add_page)

2013-11-20 Thread Amimo Benja
Hi Lee, I have been continuing with the django tutorials and at the moment I am on chapter 10 dealing with cookies. On the exercises when a user logs in and clicks the about page link, mine just shows he visited the site 1 time no matter how many times he clicks on the about page. Is it

Re: Non-Ascii Characters in URL causes crash

2013-11-20 Thread Rafael E. Ferrero
i try on www.plandroid.com/消防隊員 and get a 500-internal server error.. Im interest on know how you resolve this question, i dont have idea how it works... i mean... its posible to put a try catch somewhere to pass silently an error page ? 2013/11/20 Peter > I have a

Re: data not saving through a many to many relationship

2013-11-20 Thread MikeKJ
Decided that the relationship advice = models.ManyToManyField(Advice, through='AdviceLevel') in the Organsiation model is redundant and removed it but it hasn;t made any difference to the now NON intermdiate model AdviceLevel -- You received this message because you are subscribed to the

data not saving through a many to many relationship

2013-11-20 Thread MikeKJ
In the view do_advice the specialism, delivery_method and face_to_face_locations selections are not being saved into the corresponding tables of

Non-Ascii Characters in URL causes crash

2013-11-20 Thread Peter
I have a slightly weird issue. Someone is sending http requests with Chinese characters in the URL. Ok, it's probably just Chinese hackers trying something. But it's causing Django to fall over with a UnicodeEncodeError in the response. I'm thinking this must be a bug in Django as the

Re: How can I forloop this count() in my template code?

2013-11-20 Thread Tom Evans
On Wed, Nov 20, 2013 at 11:18 AM, Pepsodent Cola wrote: > How can I forloop this count() in my template code? > > * I have attached my project files that you might run and see for > yourselves. > * I have attached a screenshot of the table I'm working on. > * User/Pass =

Re: How to test django app

2013-11-20 Thread Tom Evans
On Wed, Nov 20, 2013 at 5:22 AM, Harjot Mann wrote: > To test my django app I got unittest module in Django but what I am > notiing that it needs to create tests for the functions in views.py > file. So I need to do lot of coding. Is there any another way to do > testing

Re: How to test django app

2013-11-20 Thread Pepsodent Cola
I'm interested in this topic too. On Wednesday, November 20, 2013 6:22:04 AM UTC+1, Harjot Mann wrote: > > To test my django app I got unittest module in Django but what I am > notiing that it needs to create tests for the functions in views.py > file. So I need to do lot of coding. Is there