AttributeError: 'TemplateResponse' object has no attribute '_reason_phrase'

2017-11-22 Thread Web Architect
Hi, We recently migrated from Django 1.8 to Django 1.11.7. We have an ecommerece site running on Django. When we are trying to access a page, following exception is occuring: Traceback (most recent call last): File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 85, in run self.res

Re: AttributeError: 'TemplateResponse' object has no attribute '_reason_phrase'

2017-11-24 Thread Web Architect
ge and came to > https://code.djangoproject.com/ticket/25964. Conclusion: try clearing > your cache. > > On Wednesday, November 22, 2017 at 3:29:42 AM UTC-5, Web Architect wrote: >> >> Hi, >> >> We recently migrated from Django 1.8 to Django 1.11.7. We have an >

Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
Hi, I am trying to optimise Django queries on my ecommerce website. One of the fundamental query is where I have no clue how to make efficient. It could be trivial and probably been known long time back. But I am new to Django and would appreciate any help. This is primarily for one to many or

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
do much more, since this is just a > DB and not a Django ORM question. > > > Am Freitag, 2. Februar 2018 14:47:45 UTC+1 schrieb Web Architect: >> >> Hi, >> >> I am trying to optimise Django queries on my ecommerce website. One of >> the fundamental query is wh

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
> How long? At first glance it doesn't look like a complex query or > something particularly inefficient for a DB. > > On Fri, Feb 2, 2018 at 11:31 AM, Andy > > wrote: > >> not that i know of >> >> >> Am Freitag, 2. Februar 2018 15:28:26 UTC+1 sc

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Web Architect
> Furbee > > On Fri, Feb 2, 2018 at 10:56 AM, Vijay Khemlani > wrote: > >> "with large of records in A and B, the above takes lot of time" >> >> How long? At first glance it doesn't look like a complex query or >> something particularl

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-06 Thread Web Architect
>> >> First I would try with a saner DB (Postgres) >> >> Also I don't think 300 ms is particularly bad, but in that case start >> looking into caching alternatives (e.g. memcached) or a search index (e.g. >> ElasticSearch) >> >> On Sat, Feb 3, 2018

A tricky query in one to many relationship - atleast for me:)

2016-08-29 Thread Web Architect
Hi, I am looking for an elegant and efficient mechanism to have a query filter or a solution for the following one to many relationship model. Please note the following is just an illustration of the models - hope it should provide what I am looking for: class A(models.Model): name = models.C

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-30 Thread Web Architect
56 PM UTC+5:30, Mike Dewhirst wrote: > > On 30/08/2016 4:33 PM, Web Architect wrote: > > Hi, > > > > I am looking for an elegant and efficient mechanism to have a query > > filter or a solution for the following one to many relationship model. > > Please note

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-30 Thread Web Architect
Hi Erik, Thanks for the solution. So, I understand we get all instances of B which are max (date created) or latest (date created) for each instance of A and then we check b.text == 'ABCD' and select the corresponding instance of A. Can't we add additional filter to check if text='ABCD' inste

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-30 Thread Web Architect
Thanks Erik. Will try out the solution you mentioned. On Tuesday, August 30, 2016 at 3:59:20 PM UTC+5:30, Erik Cederstrand wrote: > > > > Den 30. aug. 2016 kl. 11.20 skrev Erik Cederstrand < > erik+...@cederstrand.dk >: > > > > I'm not even sure that's possible to express in SQL, but it would >

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-30 Thread Web Architect
Hi Erik, I tried your solution but there are some issues: .filter(date_created=Max('a__b__date_created')) - this is throwing error saying not proper use of group function. If I remove the above, the result isn't correct where when I go through each 'a' in the result, associated latest B.text

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-31 Thread Web Architect
d. Thanks. On Wednesday, August 31, 2016 at 1:48:38 PM UTC+5:30, Michal Petrucha wrote: > > On Tue, Aug 30, 2016 at 11:46:14PM -0700, Web Architect wrote: > > Hi Erik, > > > > I tried your solution but there are some issues: > > > > .filter(da

Cache-Control header for Flat Pages

2016-09-28 Thread Web Architect
Hi, We are using Django Flat pages for some static pages like About us, privacy policy etc. We are using Web Accelerator (like Varnish) in front of Django. Hence, would like to set the Cache-Control Header to cache the flat pages. I am not able to figure how to do that for flat pages. Tried us

Re: Cache-Control header for Flat Pages

2016-09-29 Thread Web Architect
gt; Many thanks, > > Serge > > > +380 636150445 > skype: skhohlov > > On Thu, Sep 29, 2016 at 7:30 AM, Web Architect > wrote: > >> Hi, >> >> We are using Django Flat pages for some static pages like About us, >> privacy policy etc. We are usin

Re: Cache-Control header for Flat Pages

2016-09-29 Thread Web Architect
: > > On Thu, Sep 29, 2016 at 03:47:11AM -0700, Web Architect wrote: > > Hi Serge, > > > > Thanks for your response. > > > > We do not have any Views implemented for flatpages. I think they are > Django > > internal stuff for static html co

Minify HTML in Django

2016-10-31 Thread Web Architect
Hi, Is there an optimal and efficient way to minify HTML in Django? I tried using django-htmlmin but it's affecting the performance. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: Minify HTML in Django

2016-11-03 Thread Web Architect
Will go through Django Compressor. On Tuesday, November 1, 2016 at 3:22:56 PM UTC+5:30, somecallitblues wrote: > > Take a look at Django Compressor. > > On Tuesday, 1 November 2016, Web Architect > wrote: > >> Hi, >> >> Is there an optimal and efficient w

Re: Minify HTML in Django

2016-11-03 Thread Web Architect
Will go through Django Compressor. Thanks. On Tuesday, November 1, 2016 at 3:22:56 PM UTC+5:30, somecallitblues wrote: > > Take a look at Django Compressor. > > On Tuesday, 1 November 2016, Web Architect > wrote: > >> Hi, >> >> Is there an optimal and ef

Local variable dump on exception in production environment (DEBUG=False)

2019-02-01 Thread Web Architect
Hi, In our production environment, we receive mail whenever an exception happens in our django application. But it contains only the function traces. The log will be helpful it also contains data dump or the local variable dump for each function trace. The exception trace on the browser in our

Re: Local variable dump on exception in production environment (DEBUG=False)

2019-02-01 Thread Web Architect
rting. > > regards > Vineeth > > On Feb 1, 2019 3:41 PM, "Web Architect" > > wrote: > >> Hi, >> >> In our production environment, we receive mail whenever an exception >> happens in our django application. But it contains only the function

Re: Local variable dump on exception in production environment (DEBUG=False)

2019-02-03 Thread Web Architect
EBUG=True is enabled in development > environment. > > Cheers, > Simon > > [0] https://github.com/Qix-/better-exceptions > [1] > https://docs.djangoproject.com/en/2.1/topics/logging/#django.utils.log.AdminEmailHandler > > Le vendredi 1 février 2019 05:11:47 UTC-5, Web Arch

DB queries in django scripts

2019-04-09 Thread Web Architect
Hi, We have a Django 1.11 based ecommerce web site. We use django management scripts and django extension of runscript heavily for DB operations - running under cron. There's a tool - django-debugtoolbar to check the DB queries on the web. But is there a tool to monitor/check the DB queries

Re: DB queries in django scripts

2019-04-15 Thread Web Architect
ps://grafana.com/docs/features/datasources/postgres/ > > > On Wednesday, 10 April 2019 07:57:51 UTC+2, Web Architect wrote: >> >> Hi, >> >> We have a Django 1.11 based ecommerce web site. >> >> We use django management scripts and django extension of runscrip

Logging CSRF errors and other HTTP errors by Django

2017-03-08 Thread Web Architect
Hi, Is there a way to log CSRF errors? Like whenever an user visits my site and faces a CSRF error, I would like Django to log it in a file. I would like to know if my users are facing CSRF errors. Also, Can Django log HTTP error codes like 4xx or 5xx in a file? We are using Django 1.8.3 with

Re: Logging CSRF errors and other HTTP errors by Django

2017-03-08 Thread Web Architect
Thanks for your response. We do use logging but missed the part of django.request. Thanks for pointing it. On Wednesday, March 8, 2017 at 9:31:21 PM UTC+5:30, Melvyn Sopacua wrote: > > On Wednesday 08 March 2017 06:15:42 Web Architect wrote: > > > > > Is there a way to

Django queryset High CPU Usage

2017-03-09 Thread Web Architect
Hi, I am a bit perplexed by this and not sure what the solution is. Following is the scenario: There is a Model A with 1 records. Just a simple queryset - A.objects.all() is resulting in CPU hitting almost 100%. Is there a way to optimize this? But why would such a query result in high CPU

Re: Django queryset High CPU Usage

2017-03-09 Thread Web Architect
Would like to further add - the python CPU Usage is hitting almost 100 %. When I run a Select * query on Mysql, its quite fast and CPU is normal. I am not sure if anything more needs to be done in Django. On Friday, March 10, 2017 at 10:55:51 AM UTC+5:30, Web Architect wrote: > > Hi, &g

Re: Django queryset High CPU Usage

2017-03-10 Thread Web Architect
> > On Mar 9, 2017 9:37 PM, "Web Architect" > > wrote: > > Would like to further add - the python CPU Usage is hitting almost 100 %. > When I run a Select * query on Mysql, its quite fast and CPU is normal. I > am not sure if anything more needs to be done in Djan

Re: Django queryset High CPU Usage

2017-03-10 Thread Web Architect
them around in-memory, and look at server-side cursors as an > option > * If you're fetching related data, make sure you're eager-loading the > relations to avoid N+1 problems. > > > On Fri, Mar 10, 2017 at 3:06 AM, Web Architect > wrote: > >> Hi James, >

Re: Django queryset High CPU Usage

2017-03-10 Thread Web Architect
like ORM is a bottle-neck. I agree it's prudent to have the reporting on a separate HW. Would consider it. Thanks. On Friday, March 10, 2017 at 5:25:39 PM UTC+5:30, Melvyn Sopacua wrote: > > On Friday 10 March 2017 03:06:12 Web Architect wrote: > > > Hi James, > >

Re: Django queryset High CPU Usage

2017-03-10 Thread Web Architect
stantiate model objects, use the iterator() method to > > avoid keeping them around in-memory, and look at server-side cursors as > an > > option > > * If you're fetching related data, make sure you're eager-loading the > > relations to avoid N+1 problems.

Re: Django queryset High CPU Usage

2017-03-13 Thread Web Architect
Hi Vjiay, My apologies if the scenario is not clear. Following are the details: Lets say there is a Model A (with fields, foreignkeys and ManyToMany relationships with other models). There are 10k records for A. Lets say following is the pseudo code for the report: As = A.objects.all() for a

Re: Django queryset High CPU Usage

2017-03-13 Thread Web Architect
On Sunday, March 12, 2017 at 4:53:25 AM UTC+5:30, James Schneider wrote: > > > > On Mar 11, 2017 12:01 PM, "Vijay Khemlani" > wrote: > > Am I the only one who thinks that generating a report over a set of > just 10.000 records could be done in 10 - 20 secs unless there are > some serious computa

Re: Django queryset High CPU Usage

2017-03-13 Thread Web Architect
Hi Camilo, Thanks for your suggestion. Would certainly look for solutions outside Django if Django cannot suffice. But was trying to find something with Django since the web part was in Django and for easy of development. We are already using Celery Extensively but then high Resource Usage is n

Re: Django queryset High CPU Usage

2017-03-13 Thread Web Architect
to easily export data in > various formats. > > Hope that helps, > Daniel Hepper > https://consideratecode.com > > On Friday, March 10, 2017 at 12:06:13 PM UTC+1, Web Architect wrote: >> >> Hi James, >> >> Thanks for your response. Melvyn also pose

Questions on Django queryset iterator - wrt select_related and prefetch_related and how it works

2017-03-16 Thread Web Architect
Hi, Could someone please let me know what the implications of Django queryset iterator on select_related and prefetch_related? Also, I am still not quite clear on the concept of iterator which I understand returns a Generator. Whenever a for loop is run on the Generator, the DB is queried for

Re: Questions on Django queryset iterator - wrt select_related and prefetch_related and how it works

2017-03-17 Thread Web Architect
Hi, Thanks for your response. But I have observed the following: Without Iterator: It takes a bit of a time before the for loop is executed and also the CPU spikes up during that period and so does the Memory - which implies the DB is accessed to fetch all the results. With iterator: The for l

Strange issue in CSRF

2017-04-09 Thread Web Architect
Hi, We are seeing a strange issue with CSRF in Django. We are using Django 1.8.4. Ours is an ecommerce site which has been up since an year. We have been observing 403 CSRF errors now and then for form posts. But the issue is intermittent and suddenly pops up. I mean the form posts work fine

Django queryset returning corrupted value

2017-10-06 Thread Web Architect
Hi, We have running an ecommerce site using Django 1.8.13. It has been running fine for a year. But suddenly the django querysets are returning corrupted values. I am completely clueless why this is happening. Like a model field is of type SlugField but queryset is returning long. Would reall

Re: Django queryset returning corrupted value

2017-10-07 Thread Web Architect
traceback (if available), > and the version of your OS and RDBMS? > > It doesn't matter if the problem is more general; let's focus on one > specific manifestation of it. > > Regards, > > Antonis > > On October 6, 2017 8:16:20 PM GMT+03:00, Web Architect > wr

Re: Django queryset returning corrupted value

2017-10-09 Thread Web Architect
), remove > and recreate the virtualenv, and restart Django. Also check the disk space > in the machine. > > Regards, > > Antonis > > Antonis Christofideshttp://djangodeployment.com > > On 2017-10-07 11:40, Web Architect wrote: > > Hi Antonis, > > Thank

Error while customising Django User

2015-12-18 Thread Web Architect
Hi, I am new to Django and still under the process of learning. We are using an open source ecommerce platform - Oscar - for our online store. Oscar is based on Django. I was trying to customise the Django User model by extending with some few extra fields/columns: # file: your-project/apps/u

Re: Error while customising Django User

2015-12-19 Thread Web Architect
e.djangoproject.com/ticket/25313. > > On Friday, December 18, 2015 at 6:55:16 AM UTC-5, Web Architect wrote: >> >> Hi, >> >> I am new to Django and still under the process of learning. We are using >> an open source ecommerce platform - Oscar - for our online sto

Re: Error while customising Django User

2015-12-21 Thread Web Architect
stomizing/#extending-the-existing-user-model > > On Saturday, December 19, 2015 at 5:12:52 AM UTC-5, Web Architect wrote: >> >> Hi Tim, >> >> Thanks for your response and the details. >> >> In that case, what would be the best approach to have additional >&

Re: Error while customising Django User

2015-12-21 Thread Web Architect
ill look like this. > > User.add_to_class('user_type', model.IntergerField()) > > Le vendredi 18 décembre 2015 11:55:16 UTC, Web Architect a écrit : >> >> Hi, >> >> I am new to Django and still under the process of learning. We are using >> an open source ec

Django debug= false throwing 503 error

2015-12-28 Thread Web Architect
Hi, I have set the following in settings.py for our production system: DEBUG=False ALLOWED_HOSTS = ['*'] (in fact any value is not working) The server is throwing "HTTPError = 503". There are no logs and I am clueless about the reason for the error. I tried searching the net and looking into

Re: Django debug= false throwing 503 error

2015-12-28 Thread Web Architect
ver, its on the console. Thanks. On Monday, December 28, 2015 at 3:01:39 PM UTC+5:30, aRkadeFR wrote: > > Hello, > > How do you run your server in production? > Where do you see the server throwing the 503 error? > > Thanks, > > On 12/28/2015 09:46 AM, Web Architect wrote

Re: Django debug= false throwing 503 error

2015-12-28 Thread Web Architect
onnection. > > When you face similar things you should test them locally (with manage.py > runserver) with the exact same configuration for django to show you the > error message.​ > You have not explained too much so we can not help you more. > > > 2015-12-28 8:46 GMT+00:00 Web

Re: Django debug= false throwing 503 error

2015-12-28 Thread Web Architect
here were a "print" in the code. > > So please confirm you can use "runserver" > * If so, try to put more data on your production stack (web server, > wsgi gateway, etc.) > * If no you'll probably have much more data to fix the problem. > > Regards, >

Debugging Django with Debug set to False

2016-01-04 Thread Web Architect
Hi, Is there a way to debug Django when DEBUG is set to False in settings.py (for example on production)? The reason for asking the above is if we face any issue with DEBUG set to False and if we need to debug. We are new to Django and we are building an ecommerce platform based on Django.

Re: Debugging Django with Debug set to False

2016-01-05 Thread Web Architect
when DEBUG=False. It took some time to figure this out. Had there been a log or some mechanism, debugging would have been lot easier and quicker. On Monday, January 4, 2016 at 11:03:26 PM UTC+5:30, Web Architect wrote: > > Hi, > > Is there a way to debug Django when DEBUG is set t

Debugging DJango app on production for High CPU Usage

2016-02-23 Thread Web Architect
Hi, We have an ecommerce platform based on Django. We are using uwsgi to run the app. The issue the CPU usage is hitting the roof (sometimes going beyond 100%) for some scenarios. I would like to debug the platform on Production to see where the CPU consumption is happening. We have used Cache

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Web Architect
is running and one is spiking beyond 100% cpu usage. Thanks, Pinakee On Wednesday, February 24, 2016 at 5:48:17 PM UTC+5:30, Asif Saifuddin wrote: > > What is your server configuration and system usage statistics? > > On Wednesday, February 24, 2016 at 10:59:28 AM UTC+6, Web Arc

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Web Architect
de is the one that does't run > > Avraham > > > On Wed, Feb 24, 2016 at 9:10 AM, Asif Saifuddin > wrote: > >> What is your server configuration and system usage statistics? >> >> On Wednesday, February 24, 2016 at 10:59:28 AM UTC+6, Web Architect wrote:

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Web Architect
Hi Javier, I am new to uwsgi. The CPU usage is what top is reporting. Is there a way to optimise uwsgi? Thanks. On Wednesday, February 24, 2016 at 7:06:34 PM UTC+5:30, Javier Guerra wrote: > > On 24 February 2016 at 13:18, Avraham Serour > wrote: > >> sometimes going beyond 100% > > > > ho

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Web Architect
:10:22 PM UTC+5:30, Will Harris wrote: > > Hey Web Architect, I guess you never got that DB dump running in > development? ;-) > > Why don't you run some profiling middleware to see if you can some traces > of the production system? Or how about New Relic or some such? T

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Web Architect
Stevenson-Molnar wrote: > > Just to be clear: is is the uwsgi process(es) consuming the CPU? I ask > because you mention DB queries, which wouldn't impact the CPU of uwsgi > (you'd see that reflected in the database process). > > On Tuesday, February 23, 2016 at 8:59:28 P

Re: Debugging DJango app on production for High CPU Usage

2016-02-25 Thread Web Architect
? Also, how's your memory usage? Do the > spikes in CPU correlate with load? I.e., does the CPU use increase/decrease > consistently with the number of users? > > On Wednesday, February 24, 2016 at 10:17:24 PM UTC-8, Web Architect wrote: >> >> Hi Nikolas, >>

Re: Debugging DJango app on production for High CPU Usage

2016-02-29 Thread Web Architect
ing into a hardware limitation and need to scale? > > On Thursday, February 25, 2016 at 9:29:22 PM UTC-8, Web Architect wrote: >> >> Hi Nikolas, >> >> Cache backend is Redis. The CPU usage is directly proportional to the >> load (increases with the increas

Re: Debugging DJango app on production for High CPU Usage

2016-03-02 Thread Web Architect
Hi James, Thanks for the detailed explanation. Certainly helps and I would embed logging to debug the CPU usage. Please find my comments inline: On Monday, February 29, 2016 at 2:45:41 PM UTC+5:30, James Schneider wrote: > > > On Tue, Feb 23, 2016 at 8:59 PM, Web Architect > wr

Re: Debugging DJango app on production for High CPU Usage

2016-03-02 Thread Web Architect
Integrated new Relic and seems to be good. Thanks for the suggestion. On Monday, February 29, 2016 at 3:20:43 PM UTC+5:30, Lloyd Dube wrote: > > New Relic. > > On Wed, Feb 24, 2016 at 6:59 AM, Web Architect > wrote: > >> Hi, >> >> We have an ecommerce pl

Django, uwsgi, gevent, Pymongo

2016-03-24 Thread Web Architect
Hi, We have a live site running on Django and uwsgi. Pymongo is being used in the application for MonogoDB. uwsgi is being used to run the Django application. As per Pymongo docs, it has been suggested to use Gevent monkey patching: https://api.mongodb.org/python/current/examples/gevent.html

How to delete least recently used not expired django sessions?

2018-08-17 Thread Web Architect
Hi, We are using persistent django sessions for our website where in the session information is stored in MySQL. Over last couple of years, the session data has grown to a huge number and we were planning to clean it up. I know that there is a django management command 'clearsessions' and we are

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Web Architect
ike 3 months. We can force out the users who aren't active since last 3 months. Is there a way to do that in django? Thanks. On Saturday, August 18, 2018 at 5:11:23 AM UTC+5:30, Mike Dewhirst wrote: > > On 17/08/2018 10:44 PM, Web Architect wrote: > > Hi, > > > > We ar

Re: How to delete least recently used not expired django sessions?

2018-08-19 Thread Web Architect
Hi Hemendra, Thanks for the workaround. Would look at it's feasibility in our existing scenario. Thanks. On Saturday, August 18, 2018 at 3:58:10 PM UTC+5:30, HEMENDRA SINGH HADA wrote: > > Hi, > > I can suggest one thing it might be useful for you. For this you need to > create one more att

Re: How to delete least recently used not expired django sessions?

2018-08-19 Thread Web Architect
Hi Jason, Thanks for your response. As mentioned in my earlier post...I have a long expiry date for the sessions (and hence, the cookies) as we want our users to be always logged in or in session (till they clear their cookies). And that's what is causing the issue. The goal is to keep the

Re: How to delete least recently used not expired django sessions?

2018-08-22 Thread Web Architect
as an option for SESSION_EXPIRE_AFTER_LAST_ACTIVITY > > > maybe this could also be useful for you: > https://django-session-security.readthedocs.io/en/latest/ > > > > On Mon, Aug 20, 2018 at 8:34 AM Web Architect > wrote: > >> Hi Jason, >> >> Thanks

Re: How to delete least recently used not expired django sessions?

2018-08-22 Thread Web Architect
ug 17, 2018 at 05:44:22AM -0700, Web Architect wrote: > > Hi, > > > > We are using persistent django sessions for our website where in the > > session information is stored in MySQL. Over last couple of years, the > > session data has grown to a huge number and we

Customise Session Engine to distribute session data storage

2018-08-27 Thread Web Architect
Hi, Right now we are using the Django cache_db session engine for persistent sessions and also for some speed. Is it possible to customise this where I can store some session data in cache and some in DB? For example, I want to store all login sessions in DB and rest like some user specific dat

Re: Customise Session Engine to distribute session data storage

2018-08-27 Thread Web Architect
regular db, even a well tuned mysql/postgres instance > > https://github.com/martinrusev/django-redis-sessions > > On Monday, August 27, 2018 at 3:52:06 AM UTC-4, Web Architect wrote: >> >> Hi, >> >> Right now we are using the Django cache_db session engine for

Re: Customise Session Engine to distribute session data storage

2018-08-30 Thread Web Architect
s. and if you use cached_db instead > of cache, that data will persist in redis and survive restarts. > > On Tuesday, August 28, 2018 at 1:40:38 AM UTC-4, Web Architect wrote: >> >> Hi Jason, >> >> Thanks for the response. Why not use Django's cache backe

Re: Customise Session Engine to distribute session data storage

2018-09-03 Thread Web Architect
Thanks. This seems to be quite helpful. Will look into it. On Thursday, August 30, 2018 at 6:23:10 PM UTC+5:30, Jason wrote: > > https://github.com/adw0rd/django-multi-sessions > > that's a non-working project but might give you some clues how to route > sessions to different backends. > -- Yo

db_index=True not creating indexes

2018-10-05 Thread Web Architect
Hi, We are using django for our ecommerce website. I am facing a strange issue. I was trying to index a field in a table and hence, set db_index=True in the field declaration. I ran migrations but when I checked the indexes for the table, the index for the field wasn't there. There were also

Re: db_index=True not creating indexes

2018-10-05 Thread Web Architect
erations/#runsql > > > > Good luck! > > > > *From:* django...@googlegroups.com [mailto: > django...@googlegroups.com ] *On Behalf Of *Web Architect > *Sent:* Friday, October 5, 2018 7:14 AM > *To:* Django users > *Subject:* db_index=True not creating indexes > > &g

Form Code getting executed during django project startup

2018-10-12 Thread Web Architect
Hi, We are using Django for our ecommerce site. I have some confusion on when the code gets executed in Django. I have a django form with a choice field in module m1.py: class SomeForm(forms.Form): field = forms.ChoiceField(choices=get_choices()) def get_choices(): return some choice

Re: Form Code getting executed during django project startup

2018-10-12 Thread Web Architect
Hi Michal, Thanks a lot. That was an eye-opener and a big help :) Thanks. On Friday, October 12, 2018 at 1:39:38 PM UTC+5:30, Michal Petrucha wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On Fri, Oct 12, 2018 at 12:52:31AM -0700, Web Architect wrote: >

Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Web Architect
Hi, We are using django 1.11 for our ecommerce site. We are facing an issue with modelform and many to many field in it as follows: Lets say there are two models: class A(models.Model): c = models.CharField() class B(models.Model): a = models.ManyToManyField('A') Now if I defin

Re: Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Web Architect
Would also add that the server CPU usage was hitting 100% due to the template loading issue. On Monday, October 29, 2018 at 4:48:54 PM UTC+5:30, Web Architect wrote: > > Hi, > > We are using django 1.11 for our ecommerce site. > > We are facing an issue with modelform and man

Re: Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Web Architect
gt; Hope that helps, > Sanjay > On Mon, Oct 29, 2018 at 5:01 PM Web Architect > wrote: > > > > Would also add that the server CPU usage was hitting 100% due to the > template loading issue. > > > > On Monday, October 29, 2018 at 4:48:54 PM UTC+5:30

Django unit test - response context is None

2018-10-31 Thread Web Architect
Hi, We are using django 1.11 for our ecommerce site. We are developing unit tests for our views using django testing framework. We are facing issue with a simple implementation: import unittest from django.urls import reverse from django.test import Client class ViewTests(unittest.TestCase

Re: Django unit test - response context is None

2018-10-31 Thread Web Architect
Hi Jason, Thanks for your prompt response. I was using Django TestCase but it wasn't working then. Hence, I resorted to unittest as shown in Django 1.11 documentation. Also, the attribute was working fine in django shell. Please refer to the documentation here: https://docs.djangoproject.com