Re: Add your own template library

2012-10-01 Thread Ashish Jain
For reference, I have manage.py as: *#!/usr/bin/env python* *import os* *import sys* * * *# http://djangosnippets.org/snippets/342/* *def load_templatetags():* * from django.conf import settings* * from django.template import add_to_builtins* * * * try:* * for lib in settings.TEMP

Re: Tools - Slow in python django fw

2012-10-01 Thread Babatunde Akinyanmi
There are reasons why your app is slow but nobody would be able to tell you without viewing your sources. You can profile the app and pinpoint where exactly is slow and ask for advise from the list. You can install django-debug-toolbar to profile your database queries. On 10/1/12, siva <85s...@gm

Re: Django project and SVN loads older code versions

2012-10-01 Thread Gjorge Karakabakov
I've solved this problem by removing all .pyc files in all the folders. Here is the official answer to my question that worked on stackoverflow: http://stackoverflow.com/questions/12578602/django-project-and-svn-loads-older-code-versions On Tuesday, 25 September 2012 16:50:37 UTC+2, Joris wrote:

Re: Add your own template library

2012-10-01 Thread Tom Evans
On Mon, Oct 1, 2012 at 5:59 AM, Ashish Jain wrote: > Hi, > > Yes it do have __init__.py > > I have created a simple project of template tags and have installed it as a > python package with setup.py. > > After which I am referring it into my website. > > - Thanks for reply > You can only load tem

Re: Add your own template library

2012-10-01 Thread Ashish Jain
Thanks for the reply. Got the code working. It was my mistake the way I was using template in my html page. I had html page as: {%load repeat%} .. {% repeat data %} {% endrepeat %} I was not required to add "*{%load repeat%}*" line, which was resulting into error. Straightway the repea

Re: Tools - Slow in python django fw

2012-10-01 Thread Sergiy Khohlov
Have you disabled debug in setting.py ? 2012/10/1 Babatunde Akinyanmi : > There are reasons why your app is slow but nobody would be able to > tell you without viewing your sources. You can profile the app and > pinpoint where exactly is slow and ask for advise from the list. > > You can install d

Re: Tools - Slow in python django fw

2012-10-01 Thread Cal Leeming [Simplicity Media Ltd]
Yeah, you're going to need to give us much more information than that. Here is a great link to show the kind of information you'd need to give; https://code.djangoproject.com/wiki/UsingTheMailingList Once you've sent more information, I'm sure someone will be able to help :) Cal On Mon, Oct 1,

The view didn't return an HttpResponse object.

2012-10-01 Thread Satinderpal Singh
I made a model form and a view which accepts input as a form and display it in the html format. As when i refresh the html page or try to fill another entry in the form, it gives the following error: The view Automation.report.views.chemical_analysis didn't return an HttpResponse object. Here is

Re: The view didn't return an HttpResponse object.

2012-10-01 Thread Tom Evans
On Mon, Oct 1, 2012 at 11:36 AM, Satinderpal Singh wrote: > I made a model form and a view which accepts input as a form and > display it in the html format. As when i refresh the html page or try > to fill another entry in the form, it gives the following error: > > The view Automation.report.vie

Re: django and mysql versions

2012-10-01 Thread Tom Evans
On Sun, Sep 30, 2012 at 5:18 PM, Elizabeth Rachel Lemon wrote: > According to this page: > https://docs.djangoproject.com/en/dev/ref/databases/ > "Django supports MySQL 5.0.3 and higher." > > But the next section says that MySQLdb is required, and when you click the > link to MySQLdb from that pag

Re: The view didn't return an HttpResponse object.

2012-10-01 Thread Satinderpal Singh
On Mon, Oct 1, 2012 at 4:27 PM, Tom Evans wrote: > On Mon, Oct 1, 2012 at 11:36 AM, Satinderpal Singh > wrote: I add the following to my code, >> I made a model form and a view which accepts input as a form and >> display it in the html format. As when i refresh the html page or try >> to fill an

Re: The view didn't return an HttpResponse object.

2012-10-01 Thread Tom Evans
On Mon, Oct 1, 2012 at 12:11 PM, Satinderpal Singh wrote: > On Mon, Oct 1, 2012 at 4:27 PM, Tom Evans wrote: >> On Mon, Oct 1, 2012 at 11:36 AM, Satinderpal Singh >> wrote: > I add the following to my code, >>> I made a model form and a view which accepts input as a form and >>> display it in th

Re: The view didn't return an HttpResponse object.

2012-10-01 Thread Babatunde Akinyanmi
Its possible that when you refresh the form and the POST request gets submitted, the form doesn't pass the form.is_valid() if conditional. In your code, you didn't make any provision for when the form fails the is_valid() test and from your code, execution stops once is_valid() returns False so I *

Re: The view didn't return an HttpResponse object.

2012-10-01 Thread Babatunde Akinyanmi
Oooops. I see the question has already been answered. My phone didn't get the update on time. On 10/1/12, Babatunde Akinyanmi wrote: > Its possible that when you refresh the form and the POST request gets > submitted, the form doesn't pass the form.is_valid() if conditional. > In your code, you d

Re: The view didn't return an HttpResponse object.

2012-10-01 Thread Satinderpal Singh
On Mon, Oct 1, 2012 at 4:58 PM, Babatunde Akinyanmi wrote: > Oooops. I see the question has already been answered. My phone didn't > get the update on time. No worries, Thanks anyways > On 10/1/12, Babatunde Akinyanmi wrote: >> Its possible that when you refresh the form and the POST request get

Re: GeometryField in OSMGeoAdmin

2012-10-01 Thread geonition
Hi, It is really convenient for me to use GeometryField for saving arbitrary geometry types and thus I only had the problem with using the Django admin in viewing these geometries. I was able to solve this issue and like to post it here if anyone else sees some value in the solution, or on the

Re: Add your own template library

2012-10-01 Thread Javier Guerra Giraldez
On Sun, Sep 30, 2012 at 11:59 PM, Ashish Jain wrote: > After which I am referring it into my website. ... and on settings.py? -- Javier -- 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@googleg

Re: New Project 403 Forbidden Error

2012-10-01 Thread Bestrafung
Ok, I'm very new to all of this. I assumed following that guide would give me a basic working setup including some kind of "default" or starting pages/templates. If I understand correctly I have to create some kind of pages and/or templates still. I'm trying to figure that out now. On Thursday,

How to implement a form to update the quantity?

2012-10-01 Thread enemybass
Hi. How to implement a form to update the quantity Car? I have no idea how to do it. Thanks Code: http://dpaste.com/808558/ or here: class Car(models.Model): name = models.CharField(max_length=50) price = models.DecimalField() class GarageCar(models.Model):

Re: non-root SCRIPT_NAME, mod_wsgi and RewriteRule

2012-10-01 Thread m1chael
is it a problem with the trailing slash? On Sun, Sep 30, 2012 at 7:57 AM, Sebastiaan Snoeckx < sebastiaan.snoe...@gmail.com> wrote: > I have my Django website and my static files deployed under the same > directory (i.e. no separate 'static' directory), according to the following > Apache Rewrite

formfield_overrides causes all fields in admin to use the last marx_length in a model definition.

2012-10-01 Thread Paul Kenjora
I noticed this on several of my sites after adding formfield_overrides for Text fields in my admin. I set the size of all the admin fields. This caused all my fields to have the same length. Coincidentally the length is always the max_length for the last field defined for that model in my mod

Re: How to implement a form to update the quantity?

2012-10-01 Thread Anton Baklanov
Hi! You can use something like: {% for item in garage.garagecar_set.all %} Car: {{item.car.name}} Price:{{item.car.price}} Quantity: {{item.quantity}} ID: {{item.car.id}} {{form.q}}

Re: How to implement a form to update the quantity?

2012-10-01 Thread Anton Baklanov
it *is good idea* to submit... missed some words, lol On Mon, Oct 1, 2012 at 9:52 PM, Anton Baklanov wrote: > it to submit forms with ajax, to not reload entire page every time. > -- Regards, Anton Baklanov -- You received this message because you are subscribed to the Google Groups "Djan

Re: select_related and use_for_related_field

2012-10-01 Thread John Bazik
Does use_for_related_fields work with ManyToMany fields? From the source, it looks like it does not. Can anyone confirm that? -- 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/

Re: app for kickstarter-like goals

2012-10-01 Thread Kurtis Mullins
haha, I'm not sure of anything that already implements this but it shouldn't be too difficult to build yourself. On Sun, Sep 30, 2012 at 3:10 PM, Matteo Suppo wrote: > I'm developing a website for a non-profit organization. > > They want something similar to kickstarter, only based on people inst

Newbie question - setting a model form foriegn key

2012-10-01 Thread Keir Lawson
Sorry if this is a dumb question, just picking up Django. I've set up a payments form, to create payments associated with a contact (see payments model) however I'm having trouble figuring out how to save the payment with the relevant contact associated, as the contact isnt selected as part of

Re: app for kickstarter-like goals

2012-10-01 Thread Alec Taylor
What you are talking about are: "game mechanics" With those keywords you should be able to find something. But it doesn't look too difficult to build yourself. On Mon, Oct 1, 2012 at 5:10 AM, Matteo Suppo wrote: > I'm developing a website for a non-profit organization. > > They want something si

middleware not executed on 404

2012-10-01 Thread Larry Martell
We have middleware that records the last url the user has visited: class LastSiteUrl(object): def is_admin_url(self, url): if re.search('^(http:\/\/.*){0,1}\/admin\/', url) is None: return(False) else: return(True) def process_request(self, request): if self.is_a

send_mail on MAC OS X 10.7

2012-10-01 Thread Cheng
Hi, I am new to django. I am following The Definitive Guide to Django SECOND EDITION by Adrian Holovaty and Jacob Kaplan -Moss and I cannot get the contact form to send mail. First the eg did not work at all until I added the @csrf-exempt decorator. Keeps getting Error 61 Connection Failure af

Re: Newbie question - setting a model form foriegn key

2012-10-01 Thread Laxmikant Gurnalkar
def payments_view(request, contact_id): payment = Payment() payment.contact = contact[0] rctx = RequestContext(request,{ > 'contact': contact, 'payments': payments, 'form' : PaymentForm() > }) > return render_to_response('CRMSite/contact_payments.html',rctx) > On Tue,

Re: Newbie question - setting a model form foriegn key

2012-10-01 Thread Laxmikant Gurnalkar
Sorry, see again!! def payments_view(request, contact_id): payment = Payment() contact = contact.objects.filter(id=contact_id) if contact: payment.contact = contact[0] payment.save() I dont think you are looking for this kind of thing : cheers On Tue, Oct 2, 2012

Re: send_mail on MAC OS X 10.7

2012-10-01 Thread Laxmikant Gurnalkar
Comment the csrf from settings. It doesnt work when you want.I use session and own credentials to do that And just write a simple view to send mail. This will work without csrf or any of credentials & etc. *Cheers* Laxmikant On Tue, Oct 2, 2012 at 6:15 AM, Cheng wrote: > Hi, > > I am new to dj