Re: OperationalError: no connection to the server using Django and gunicorn

2011-07-01 Thread Adrián Ribao Martínez
> > On May 27, 12:53 pm, Adrián Ribao wrote: > > I'm doing it manually because I'm just testing: > > > > ./manage.py run_gunicorn -c gunicorn.conf.py > > > > where gunicorn.conf.py > > > > # -*- coding: utf-8 -*- > > import multiproc

Re: OperationalError: no connection to the server using Django and gunicorn

2011-05-27 Thread Adrián Ribao
I'm doing it manually because I'm just testing: ./manage.py run_gunicorn -c gunicorn.conf.py where gunicorn.conf.py # -*- coding: utf-8 -*- import multiprocessing bind = "127.0.0.1:8000" workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' On 27 mayo, 02:23, Shawn Milochik w

OperationalError: no connection to the server using Django and gunicorn

2011-05-26 Thread Adrián Ribao
Hello, I'm testing gunicorn in the server, and I get this error in every request: Traceback (most recent call last): File "project/env/lib/python2.6/site-packages/gunicorn/workers/ async.py", line 62, in handle_request respiter = self.wsgi(environ, resp.start_response) File "project/env/l

Logging Handler AdminEmailHandler not working

2010-12-15 Thread Adrián Ribao
I get an error when using AdminEmailHandler. The error message is: __init__() takes at least 5 non-keyword arguments (2 given) is in django/django/utils/log.py in emit line 90: reporter = ExceptionReporter(request, is_email=True, *exc_info) where exc_info = () Is it a bug or I'm missing someth

Thread safety, transactions and best practices

2010-05-08 Thread Adrián Ribao
Hello, I have a question about transactions and thread safe applications. I have an invoice app, where I have a model like this: class Counter(models.Model): client = models.ForeignKey(Client) number = models.CharField(max_length=10, db_index=True) class Meta: unique_together =

Re: Big issue serving big files through a view

2009-11-23 Thread Adrián Ribao
e.write(buf) >    f.close() > > 2. You could, instead, let Apache serve the files in encrypted form, > and sell the > user a decryption key. > > On Mon, Nov 23, 2009 at 12:18 PM, Adrián Ribao wrote: > > Hello, > > > I have created a website where you can buy and d

Big issue serving big files through a view

2009-11-23 Thread Adrián Ribao
Hello, I have created a website where you can buy and download some files. For security reasons all the files are served through a view, where comprobations are made in order to assure that the user bought the product. The problem is that the files are at least 400Mb and some of them are nearly 1

NoReverseMatch raised after upgrading django to trunk

2009-11-03 Thread Adrián Ribao
Hello, I've just updated django to the las revision and suddenly I'm getting a NoReverseMatch when using the reverse funcion. This is the line of the code: return HttpResponseRedirect(reverse('app.views.info', args=[p.id,])) And this is the url: (r'^any-path-(?P\d)\.html$', 'info'), Does any

best approach for using email as username

2009-10-29 Thread Adrián Ribao
Hello, I need to use the email field as the username. I neet these: * Email must be unique * I should authenticate against the email * The admin should work I I should be able to create users with username = email address. I have a custom authentication method but I need more. I need to tell Dj

Avoid queryset caching

2009-10-01 Thread Adrián Ribao
Hello, I need to disable the queryset caching in two situations: * When I process a huge amount of rows, and for each one I have to perform a new queryset. The script memory increases very quick and the system run out of memory. * When I generate a form dinamically from a queryset. Is there an

[Internationalization] javascript catalog

2009-07-29 Thread Adrián Ribao
Hello, I'm trying to use the javascript catalog in a project. The documentation says: Those translation strings are taken from the application, project or Django core, according to what you specify in either the info_dict or the URL. Well, I need to load the strings from the project. I mean, Al

Cached forms when changing language- Is this a bug?

2009-07-17 Thread Adrián Ribao
Hello everybody, I have an multi language site with a form in the home. If I change the language of the site everything changes but the form takes a few minutes before I see it in the right language. If I reload the server the form is visualized ok, but this is not the right behaviour. The code

Re: PostgreSQL full text engine support

2009-06-10 Thread Adrián Ribao
I'm sorry! This messages was suppose to go to the haystack.org list. Please, dismiss this message. On 10 jun, 13:57, Adrián Ribao wrote: > I'd like to suggest the fulltext search engine of PostgreSQL as a > backend. > > PostgreSQL is the favourite ddbb of the dja

PostgreSQL full text engine support

2009-06-10 Thread Adrián Ribao
I'd like to suggest the fulltext search engine of PostgreSQL as a backend. PostgreSQL is the favourite ddbb of the django developers, and it includes full text search engine. http://www.postgresql.org/docs/8.3/static/textsearch.html It doesn't require extra software installation and it works gr

Database Error

2009-04-19 Thread Adrián Ribao
Hello, I have a model using extra fields in M2M relationships as described in: http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships When I try to do something I get this: "psycopg2.OperationalError: currval of the sequence «metodo_factorencadena_id_se

Re: Need help with models

2009-01-24 Thread Adrián Ribao
t fields from > that main table. > > The difference with yours is that I use: > >    lang = models.ForeignKey('Language') > > On 24 ene, 17:41, Adrián Ribao wrote: > > > Hello everybody, > > > I need to create dinamic content in several models

Need help with models

2009-01-24 Thread Adrián Ribao
Hello everybody, I need to create dinamic content in several models. I have 3 approaches: approach 1: class News(models.Model): date = ... visible = ... text = models.CharField(max_length=255) class NewsTrans(models.Model): news = models.ForeignKey(News) lang = models.CharF

login django using curl

2008-12-13 Thread Adrián Ribao
Hello, I'm writing a script and I'd like to login into a django webapp using pycurl or urllib. I've problems with the cookies, and every time the message is: "The session has expired" Does anybody know how can I make it? Thank you! --~--~-~--~~~---~--~~ You receiv

Re: Best practice to build a multilingual site

2008-10-13 Thread Adrián Ribao
I have the same question as you. Translation of dynamic content is not a feature for Django 1.1. I wonder if I can insert this feature in the wiki. I'd like to know the best approach for translating some fields of a model to different languages. Thank you. On 13 oct, 17:48, "Alex Rades" <[EMAIL

Re: GeoDjango question

2008-09-04 Thread Adrián Ribao
Thank you Ludwig! > Regarding your SRS questions you need to be aware that if you use different > SRS for different tables that unless you reproject to a common one distance > computations make no sense. So I guess I have to use the default srid in both models. Right? If I set the default srid,

GeoDjango question

2008-09-04 Thread Adrián Ribao
Hi, I've been checking geodjango and it looks very well, but I have some questions about it. If I have two models like: class UserProfile(models.Model): location = models.PointField(srid=2062) objects = models.GeoManager() class Places(models.Model):

Re: ANNOUNCE: Django 1.0 released

2008-09-04 Thread Adrián Ribao
Excelent work! Well done! --~--~-~--~~~---~--~~ 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 [EMAIL P

Re: Don't mix *args and **kwargs in call to reverse()!

2008-09-01 Thread Adrián Ribao
I'll write an example of the problem. All my urls are prepared following the best SEO rules, so in many places I have urls like: (r'^(.*)-f(?P\d+)\.html$','view_photo') this would make the url: my-photo-f2.html I get the url using: reverse('app.views.view_photo', args=[slugify(photo.title),], kw

Don't mix *args and **kwargs in call to reverse()!

2008-09-01 Thread Adrián Ribao
Change in rev:8760 introduced this exception: "Don't mix *args and **kwargs in call to reverse()!" -- django/trunk/django/core/urlresolvers.py -- ... def reverse(self, lookup_view, *args, **kwargs): if args and kwargs: raise ValueError("Don't mix *args and **kwargs in call to reverse(

SQL data not loaded in testing suite

2008-07-22 Thread Adrián Ribao
Hello, I'm writing a test suite, and when the database is created, everything seems ok, I can even see the: Installing custom SQL for but the data is not inserted in the db. Is it a bug? Thank you. --~--~-~--~~~---~--~~ You received this message because you

Roadmap to 1.0 and internationalization in db

2008-06-13 Thread Adrián Ribao
Hello, Here I'm again with the same subject, internationalization in db. I think this should be included in 1.0, it's not so hard, I have thought a way to make it work: We have a class like this: class Book(models.Model): name = models.CharField( max_length=255, i18n=True) And the followin

Re: Recursion in templates... again

2007-03-02 Thread Adrián Ribao Martínez
Sorry, I didn't find a perfect solution, but I think that it can be done. You can use the "unordered list" filter in the template and fill an array in the view using recursive methods. Then you pass the array to the filter and it's done. You can also create your own filter tag, is not difficult,