Re: SystemError from django.conf.settings

2011-05-30 Thread Cameron
Yeah no worries, I will gather as much evidence as I can and post the details tonight. FYI I am running python 2.5.2 which comes with debian lenny, I did not compile it myself. And yes you are right that the wsgi server plays such a small part in the processing of a django page. The majority of my

Re: Serving static file on Windows

2011-05-30 Thread Alagu Madhu
Hi, sample/ static/ js/jquery.1.6.1.min.js css/ settings.py APP_DIR = os.path.abspath(os.path.dirname(__file__)) STATIC_ROOT = os.path.join(APP_DIR, 'static/') STATIC_URL = '/static/' INSTALLED_APPS = ( 'django.contrib.auth', 'djan

Re: Serving static file on Windows

2011-05-30 Thread Praveen Krishna R
*could you dump your urls.py ? * On Mon, May 30, 2011 at 12:19 PM, Alagu Madhu wrote: > Hi, > > sample/ > static/ >js/jquery.1.6.1.min.js > css/ > > settings.py > > APP_DIR = os.path.abspath(os.path.dirname(__file__)) > STATIC_ROOT = os.path

Odp: Re: Synchronize method or model field access

2011-05-30 Thread Etam
Thanks! Celery provides a queue you could use: > > http://ask.github.com/celery/getting-started/introduction.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-users@googlegroups.com. To unsubscri

Re: Serving static file on Windows

2011-05-30 Thread Alagu Madhu
urls.py from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', (r'^$', 'hydra.views.index'), ) On May 30, 12:28 pm, Praveen Krishna R wrote: > *could you dump your urls.py ? > * > > > > > > > > > > On Mon, May 30, 2011 at 12:19 PM, Alagu Madhu wro

setlang using AJAX

2011-05-30 Thread Luca Casagrande
Hello everybody, I'd like to use an AJAX request without any form to change the language of my site. My problem is that I haven't found a way to avoid the csrf_token error.. How can I generate the token without any form? The other way it to use setlang with a GET request but, according to docs, th

Re: Django model manager "live" object issues

2011-05-30 Thread James Hargreaves
Hi Kirill, Thanks for your response and sorry for my tardiness in replying! I think you are right - my queryset is cached in the view, as my urls.py looks like this: from django.conf.urls.defaults import * from django.views.generic.simple import redirect_to from django.views.generic.list_detail

Re: Django model manager "live" object issues

2011-05-30 Thread James Hargreaves
Indeed, I have just updated this to use class-based generic-views and it appears to be working as designed: from django.conf.urls.defaults import * from django.views.generic import ListView, RedirectView from application.news.models import Article, Category urlpatterns = patterns('', (r'^$'

Re: Is there an HTML editor that's Django-aware

2011-05-30 Thread BobX
Again, thanks to everyone who took the time out of their schedules to jot down a quick reply to my question. I'll go away and try some of the apps suggested. :D If anyone from the Django Project itself is listening then can I (very humbly) suggest that some editor recommendations would make a real

Re: setlang using AJAX

2011-05-30 Thread urukay
hi, but you have to reload the whole page anyway or you want only part of the page to be translated? There's a way to change language without form. R. On 30. Máj, 13:07 h., Luca Casagrande wrote: > Hello everybody, > I'd like to use an AJAX request without any form to change the > language of m

Re: Is there an HTML editor that's Django-aware

2011-05-30 Thread Jacob Kaplan-Moss
On Monday, May 30, 2011, BobX wrote: > If anyone from the Django Project itself is listening then can I (very > humbly) suggest that some editor recommendations would make a real > fine addition to the info on the site (useful to n00b's like me > anyway). That's a good idea - thanks! Where do yo

python code works in command line but not in django

2011-05-30 Thread Kann
Dear all, I tried using python to execute some external java program in my code. My problem is the os.system(cmd) was not working properly when the code was included into some view in views.py. However, executing the code from terminal worked just fine. I am not sure what is wrong here. this

Re: setlang using AJAX

2011-05-30 Thread Luca Casagrande
Hi Radovan, this code should go on a web page before the real application. Basically I'd like to have the user click on a flag representing the language and load the real site with the appropriate language. Thanks L. On 30 Mag, 15:30, urukay wrote: > hi, > > but you have to reload the whole page

Specifying a database for a specific app

2011-05-30 Thread Philip Zeyliger
Hi there, I have several installed applications within my Hue environment. I'd like to use the multiple database support to route all database requests associated with apptwo.models into a database called "apptwo", while keeping everything else in the default database. Is this possible? It seem

Re: setlang using AJAX

2011-05-30 Thread Kirill Spitsin
On Mon, May 30, 2011 at 08:03:46AM -0700, Luca Casagrande wrote: > Thank you very much, for your help and your code. > The problem is that the POST request is missing the csrf_token and so > I have got a 403 Error. https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#ajax -- Kirill Spitsin -

Re: Specifying a database for a specific app

2011-05-30 Thread Jacob Kaplan-Moss
On Mon, May 30, 2011 at 10:00 AM, Philip Zeyliger wrote: > I have several installed applications within my Hue environment.  I'd like > to use the multiple database support to route all database requests > associated with apptwo.models into a database called "apptwo", while keeping > everything el

Re: Odp: Re: signals pre_save vs model's save()

2011-05-30 Thread Alexander Schepanovski
> Because I am writing CRM, and my end users are non-technical ladies :} > And each one of them inputs data in different format (id numbers, phone > numbers, dates, names [upper cased, capitalized, lower cased]) > Therefore I have to normalize an input to store, and then print contract > agreements

Odp: Re: Synchronize method or model field access

2011-05-30 Thread Etam
Is there a way to run Django (mod_wsgi) in threaded mode? > I would push the atomic updates to the database or use a queue with a > single worker. Thread level locking doesn't scale across processes or > servers. > > -- You received this message because you are subscribed to the Google Groups

How to get user object from RequestContext?

2011-05-30 Thread Thomas Weholt
How do I get the user related to the current request in templatetag? Using RequestContext? @register.tag(name='sometag') def sometag(parser, token): try: tagname, model_inst = token.split_contents() except ValueError: raise template.TemplateSyntaxError, "%r tag requires exa

Re: Disable debug logging for django.db.backends?

2011-05-30 Thread Nathan Duthoit
It's more of a hack than a clean solution but it works. Add the following to your settings file: import logging logging.getLogger('django.db.backends').setLevel(logging.ERROR) On May 24, 12:32 am, diafygi wrote: > Howdy all, > > I have DEBUG=True in my settings.py, and I have several log

Re: How to get user object from RequestContext?

2011-05-30 Thread Daniel Roseman
On Monday, 30 May 2011 18:07:16 UTC+1, MrMuffin wrote: > > How do I get the user related to the current request in templatetag? > Using RequestContext? > > @register.tag(name='sometag') > def sometag(parser, token): > try: > tagname, model_inst = token.split_contents() > except Va

python threads and django views

2011-05-30 Thread rahul jain
All, I would like to know how to do this? For example, in my views I have to visit 10,000 websites (make url connection). Each of those connections are independent connections. I would like to hit them as quickly as possible. Then return an http-response with some results. I have few questions

View with form?

2011-05-30 Thread mmm
Hi, I'm a DJango newb and need to make sure I approach initial issues correctly: I have a couple of models: Items, and subItems which have a ForeignKey to Items. I have a detail page for Items that displays all its subItems. I want to add a form to allow addition of up to 3 extra subItems on

Learning Django: Approach / Advice / Resources

2011-05-30 Thread Robin
A little while ago, I was approached about building a basic web site for a small store. The requirements were pretty typical and read like a menu of web development tutorials. This was to be a data driven site that any decent web developer could build. I, however, am not a web developer, decent

Re: Learning Django: Approach / Advice / Resources

2011-05-30 Thread Mike Dewhirst
Robin Don't worry - your mother is probably right. Here are my "rules" ... 1. Dive into Python 3 rocks 2. Read "Practical Django Projects"(*) or if you decide against that get yourself a small-ish concrete target and avoid extraneous functionality like the plague. Then when it is working loo

Re: Is there an HTML editor that's Django-aware

2011-05-30 Thread AJ
If I can give my $0.02, the content can live anywhere, but how about at least a link to the content within the initial "setting up django environment' section? This way those who are just beginning programming and Django can know what do they need to do and what are the pros and cons of an editor/

admin site search field

2011-05-30 Thread podio
Hi, I'm new and I'm trying to make an app that have a field, pointing to a record of the same object class. How can a make django has a search form and show the record of the class on a popup window like http://demoweb.cibernatural.com/admin/gestion/presupuesto/add/ (user and password demo:demo) bu

Re: Is there an HTML editor that's Django-aware

2011-05-30 Thread Mike Dewhirst
On 30/05/2011 11:41pm, Jacob Kaplan-Moss wrote: On Monday, May 30, 2011, BobX wrote: If anyone from the Django Project itself is listening then can I (very humbly) suggest that some editor recommendations would make a real fine addition to the info on the site (useful to n00b's like me anyway).

how to implement a data grid? (or populate inlineformset with initial data)

2011-05-30 Thread snfctech
I want to display a list of records that have some editable fields and some readonly fields, as well as asynchronously add new records to the list. I thought the way to start would be with an InlineFormSet - but I can't figure out how to populate my formset with initial data. E.g. MyInlineFormset

No style sheets with DEBUG = False?

2011-05-30 Thread Roy Smith
If I set: DEBUG = False in my settings.py file, my site runs and produces the correct HTML, but there's no style sheets loaded. Even stranger, if I save the HTML generated each way into files and compare them, they're identical! Any clue what might be causing the style sheets not to load with D

Re: No style sheets with DEBUG = False?

2011-05-30 Thread Karen Tracey
On Mon, May 30, 2011 at 9:56 PM, Roy Smith wrote: > > Any clue what might be causing the style sheets not to load with DEBUG > = False? > > https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/#static-file-development-view Karen -- http://tracey.org/kmt/ -- You received this message

Re: admin site search field

2011-05-30 Thread Anoop Thomas Mathew
Hi, Did you notice you are missing closing quote ' in the search fields??? Regards, Anoop On 31 May 2011 04:54, "podio" wrote: > Hi, I'm new and I'm trying to make an app that have a field, pointing > to a record of the same object class. How can a make django has a > search form and show the rec

Can I perform an "alter table" to remove a "not null" constraint?

2011-05-30 Thread Gchorn
It seems as though the default in Django when creating tables is to place a constraint that doesn't allow null values (contrary to what I've learned is the default for SQL in general). I have a model which has a date attribute, and which I now want to be able to hold null values, but when I tried

SEND_BROKEN_LINK_EMAILS = True not sending email

2011-05-30 Thread Addy Yeow
Is SEND_BROKEN_LINK_EMAILS = True working for you guys? I am using Django 1.2.5. I have view function that raise Http404 when object is not found but I am not receiving the email despite SEND_BROKEN_LINK_EMAILS = True in my settings.py. I do receive email for HTTP500 though. -- http://www.dazzle

Re: SystemError from django.conf.settings

2011-05-30 Thread Ian Clelland
On Sat, May 28, 2011 at 10:50 PM, Cameron wrote: > So I have this stack trace on my production server. I can't reproduce > it locally and it doesn't occur with an older version of the same site > deployed on the same server. > > Traceback (most recent call last): > File "./dependencies/django/cor

Re: Serving static file on Windows

2011-05-30 Thread Praveen Krishna R
*Pasting one of my earlier replies to the same question* *** * *Please check django official docs to find out how static files are served on production and development server. in the dev server include a similiar snippet into your projects urls.py, urlpatterns: (r'^site_media/(?P.*)$', 'django.vi

Re: python threads and django views

2011-05-30 Thread Subhranath Chunder
Using the web-server to make such a request to open 10,000 odd URLs seems unrealistic approach. Rather make a separate process to do the same. Thanks, Subhranath Chunder. On Mon, May 30, 2011 at 11:29 PM, rahul jain wrote: > All, > > I would like to know how to do this? > > For example, in my vi