Django 1.6.1 not cooperating too well with Gevent

2014-02-04 Thread André Cruz
Hello. I have been using Django 1.5.2 + uWSGI + Gevent with no problems for quite some time. I monkey patch my application as soon as I can and the greenlets cooperate with no problems since all the work is network-bound. I have recently tried to switch to Django 1.6.1, but I found that my gre

Re: Weird deletions in Django

2014-02-04 Thread heidi
On Tuesday, February 4, 2014 6:37:55 AM UTC, Avraham Serour wrote: > > Sending an email can be faulty, I would use a logger and write the > stacktrace > Also, is it possible that something other than you django application it's > agreeing the database? > I have a forum accessing the database but

Django - MongoDb failover options for a master-slave setup

2014-02-04 Thread Balkrishan Aggarwal
Hi All, I'm using MongoDB as back end for my Django web application. I am not sure how to setup an automatic django-mongodb failover mechanism. My requirement is that, when the Primary(master) node of MongoDB is down, the application should automatically switch to Secondary(Slave) node of MongoD

1.7a1 - Migration syntax error

2014-02-04 Thread Pradip Caulagi
I am using the following (simplified) model that doesn't migrate using the new migrations in Django 1.7a1 - $ $ pip freeze Django==1.7a1 argparse==1.2.1 distribute==0.6.34 wsgiref==0.1.2 $ $ cat blog/models.py from django.db import models from django.utils import timezone class Blog(models.Mode

Django tests namespace error

2014-02-04 Thread Danil Galeev
Hi guys, I have django 1.6.1 project which uses django rest framework and I work around building api. I covered api calls by unittests and I have one problem. Application name is 'api' and all tests are passed when I run tests using command: python manage.py test api But when I run all projec

Database update weirdness

2014-02-04 Thread heidi
I am developing a game in which the quantity of rebels updates after a turn change. Rebels are represented as integers from 0 to 100 in the (MySQL) database. When I save, this happens: print world.rebels>>> 0 rebstab = 0 world.rebels += rebstab world.save() print world.rebels>>> 0 However,

Re: Django 1.6.1 not cooperating too well with Gevent

2014-02-04 Thread André Cruz
On Tuesday, February 4, 2014 11:15:26 AM UTC, André Cruz wrote: > One was blocked on: > File > "/servers/python-environments/discosite/local/lib/python2.7/site-packages/gevent/greenlet.py", > > line 327, in run# > result = self._run(*self.args, **self.kwargs)# > File > "/servers/python-envir

Re: ec2 using bitnami djangostack: application never loads; browser just hangs

2014-02-04 Thread victoria
Hi, I'm sorry you are finding issues with the Bitnami image. I just saw this, sorry if it is too late. Which version are you using? Can you check if the django.conf file (apps/django/conf/django.conf) is overwriting your /static alias? Also did you give permission to the daemon user to read your p

Model field's verbose_name from database?

2014-02-04 Thread Jon Dufresne
Hi, I have a model with fields that allows the user to modify the user-facing names of these fields. Think "first name", "last name", "email", the user may prefer these be displayed as "given name", "surname", "email address". This is configured exactly once throughout the system. So in this examp

Re: How to count the amount of objects in a django joined table?

2014-02-04 Thread shmengie
This might be what you're looking for. One caveat, tho, the queryset should be .ordered_by('user') {% regroup object_list by user as user_list %} {% for user in userlist_list %} {{ user.user.id }} {{user.list|length}} {% for asset in user.list %} {{ ass

Re: Do I need an API?

2014-02-04 Thread BikerJim
Thanks for the responses, I have thought about a CMS and that's kind of what I thought I was building albeit a very small one. Mike, do you use heroku? I can't find a way to give ftp access to the templates, as I think its ethereal (not sure that's the right word!).. But I guess this means

Re: Opening up multiple database connections per request?

2014-02-04 Thread jeff do
Thank you Russ. Your solution to define multiple database sources to a single database was very straightforward On Tuesday, January 21, 2014 4:11:43 PM UTC-8, Russell Keith-Magee wrote: > > Hi Jeff, > > Correct - Django has one database connection per request. > > If you want to open multiple co

Re: Do I need an API?

2014-02-04 Thread m1chael
I think the point is: it's difficult for old-school tech people to work with Django because there is a learning curve, and it's hard to mimic exactly what they are used to, and it's difficult to persuade them this is the right way to do things. -- You received this message because you are subscri

Re: Do I need an API?

2014-02-04 Thread Doug Ballance
I'm not clear on your question. I can't tell if you are wanting to allow them to edit the site layout (templates) or content that happens to contain html? Either way, you might look into using the Ace javascript based code editor http://ace.c9.io/ If you are talking about letting them modify

Re: 1.7a1 - Migration syntax error

2014-02-04 Thread Russell Keith-Magee
Hi Pradip, On Tue, Feb 4, 2014 at 5:18 PM, Pradip Caulagi wrote: > I am using the following (simplified) model that doesn't migrate using the > new migrations in Django 1.7a1 - > > ... > File "/tmp/bar/blog/migrations/0001_initial.py", line 17 > ('created', models.DateTimeField(default=da

Re: Do I need an API?

2014-02-04 Thread Mark Phillips
I would second the idea for a full cms to solve your problem. Whether django, our some other cms. Mark On Feb 4, 2014 3:27 PM, "m1chael" wrote: > I think the point is: it's difficult for old-school tech people to > work with Django because there is a learning curve, and it's hard to > mimic exac

Many-to-many with inlineformset_factory - row for each possible value?

2014-02-04 Thread Miles Gard
Hi all, New to Django, I've scoured the Web to see if there's an answer to this particular problem - wondering if anyone could assist: I have two models related many-to-many through a third, e.g. class Site(models.Model): id = models.PositiveSmallIntegerField(primary_key=True) name = models.Cha

Re: Model field's verbose_name from database?

2014-02-04 Thread Me Sulphur
Why not use dictionary to Map user-level names to database-fields mapping = { 'My Name': first_name, 'Surname': last_name, 'Personal Email': email } u = User.objects.get(pk=1) key = 'My Name' try: val = getattr(u, mapping[key]) except AttributeError: val = '' -- You received

Re: Model field's verbose_name from database?

2014-02-04 Thread Me Sulphur
Correction: Values should also be strings mapping = { 'My Name': 'first_name', 'Surname': 'last_name', 'Personal Email': 'email' } -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving ema

Re: Do I need an API?

2014-02-04 Thread Avraham Serour
I think it is dangerous to let users edit the HTML directly, in my opinion you should let them edit the content and maybe some formating On Feb 5, 2014 12:27 AM, "m1chael" wrote: > I think the point is: it's difficult for old-school tech people to > work with Django because there is a learning cu

Re: 1.7a1 - Migration syntax error

2014-02-04 Thread Pradip Caulagi
On Wednesday 05 February 2014 04:49 AM, Russell Keith-Magee wrote: This is the 0001_initial migration - did you manually write or update this migration, or is this code entirely automatically generated? If it's manually written or edited, then fix what you wrote :-) If it's the result of automa