Scaling/Parallel patterns for a View executing complex database transaction

2015-05-14 Thread Me Sulphur
Stack: Django 1.7 + Postgres 9.3 + Linux (No caching) Our application has a view which is called/executed very frequently. The view receives, parses and responds a JSON. In between request and response, there are about 3-5 inserts and around 1200-5000 look ups depending upon some if..else busines

Re: Scaling/Parallel patterns for a View executing complex database transaction

2015-05-14 Thread Me Sulphur
2015 06:06:57 UTC+5:30, Russell Keith-Magee wrote: > > > On Thu, May 14, 2015 at 6:03 PM, Me Sulphur > wrote: > >> Stack: Django 1.7 + Postgres 9.3 + Linux (No caching) >> >> Our application has a view which is called/executed very frequently. The >> vi

m2m_changed (How to get only the affected/changed fields in pk_set)

2014-01-30 Thread Me Sulphur
The docs say (for the param *pk_set* in m2m_changed signal) For the pre_add, post_add, pre_remove and post_remove actions, this is a set of primary key values that have been added to or removed from the relation. But it seems, that pk_set contains all values and not only the affected/changed on

Re: Password reset not working.

2014-01-30 Thread Me Sulphur
url(r'^password/reset/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.password_reset_confirm, name='password_reset_confirm'), Try setting 'name' for the above url block as 'auth_password_reset_confirm' On Thursday, 30 January 2014 18:39:12 UTC+5:30, he

Re: Password reset not working.

2014-01-30 Thread Me Sulphur
On an alternative note, it is always good to follow some kind of consistent conventions for things like naming. You might also want to prefix 'password_change_done' and 'password_reset_done' with 'auth_' for the sake of consistency. -- You received this message because you are subscribed to th

Re: Proxy problem (permissions denied)

2014-01-30 Thread Me Sulphur
Hopefully you have included the csrfmiddleware token in your POST request payload or data. Overlooking same is usually one of the frequent causes of 403 in development. Read here: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ BTW, you can also consider using GeoDjango

Re: Django with Ubuntu Cloud

2014-01-30 Thread Me Sulphur
Django is a fairly flexible web framework. See read more about STATIC and MEDIA files in Django. The Ubuntu cloud API is documented here https://one.ubuntu.com/developer/files/store_files/cloud, you can interact with it using libraries like requests. https://docs.djangoproject.com/en/dev/howto/

Re: Django with Ubuntu Cloud

2014-01-31 Thread Me Sulphur
So - I can use Ubuntu One ( which seems to be like Drop box if I understand it correctly ) as a media file storage? Indeed you UO is like DB and you can use their APIs to programatically PUT and/or GET files on their system. -- You received this message because you are subscribed to the Google G

Re: Question About South And Migrating to Production

2014-02-01 Thread Me Sulphur
We have used South for staging and production for a while now (what good otherwise it is?). Our deployment flow is something on the lines of: (Note: Tasks are automated using Fabric) 1. Have a production_settings.py file in the git repo 2. Migrations are also commited to the repo 3. When changes

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: Model field's verbose_name from database?

2014-02-05 Thread Me Sulphur
You could easily convert mappings to JSON and store it in a model like: Class VerboseNameMaps(models.Model): map = models.TextField() user = models.ForeignKey(User) When you wish to use the same, you could: map_obj = VerboseNameMaps.objects.get(user=request.user) mapping = json.loads(m

Integrate with an ADFS Server for Login

2014-02-25 Thread Me Sulphur
Hi, For one of our new deployments we need to replace our authentication (django's default) with the client's Single Sign On (SSO). The client uses ADFS 2.0 for SSO. None of us have ever worked on .NET/Windows techologies; we tried to look up at many places but no leads on where to start. Possi

Re: Integrate with an ADFS Server for Login

2014-02-26 Thread Me Sulphur
anks & Regards On 25 February 2014 18:17, Tom Evans wrote: > On Tue, Feb 25, 2014 at 10:44 AM, Me Sulphur wrote: > > Hi, > > > > For one of our new deployments we need to replace our authentication > > (django's default) with the client's Single Sign On

Re: Proxy problem (permissions denied)

2014-05-26 Thread Me Sulphur
you use it? > > please help me!! > Sincerely, > Ram Shrestha > > On Saturday, February 1, 2014 9:17:27 PM UTC+5:45, Gkpetrak wrote: >> >> Hi Me Sulphur, >> >> Thank you so much my friend ! >> A two weeks problem solved !! >> The problem was the

Adding LocaleMiddleware does not show pretty error pages

2014-08-10 Thread Me Sulphur
Django usually renders prettified error pages when DEBUG and TEMPLATE_DEBUG are True in settings.py. However, when I add the LocaleMiddleware, The template only outputs: 'A server error occurred. Please contact the administrator.' and prints the traceback in the runserver terminal instead. *Stack

Re: 1.7: module has no attribute

2014-08-10 Thread Me Sulphur
It is SlugField (F is capital) and not Slugfield Refer: https://docs.djangoproject.com/en/dev/ref/models/fields/#slugfield On Monday, 11 August 2014 10:06:20 UTC+5:30, Malik Rumi wrote: > > I am trying to make my first django project using 1.7. When I try to run > python manage.py * (runserver

Re: A question of signals and ATOMIC_REQUESTS

2018-01-31 Thread Me Sulphur
Wednesday, January 31, 2018 at 12:54:29 AM UTC-5, Me Sulphur wrote: >> >> When ATOMIC_REQUESTS=True is set, are ORM signals - post_save and >> pre_save - also executed within the transaction? Per my inference, they >> seem be to a part of the transaction. >>