Dmitry
Dmitry

Reputation: 570

uWSGI return old data

I have the REST application (django+tastypie). Some resources must return data related by current time. For example:

I'd get the banner list from url /api/banners

My API return only banners active for current time (date_active_start__lte=datetime.now(), date_active_end__gte=datetime.now()) When one banner must be showed or hidden, result data doesn't change until uwsgi restart

#mysite_uwsgi.ini
[uwsgi]
chdir           = /var/www/project
module          = mysite.wsgi:application
home            = /var/www/python
master          = true
processes       = 5
socket          = /var/www/mysite.sock
chmod-socket    = 666
uid             = www-data
gid             = www-data
vacuum          = true
# touch-reload    = /var/www/mysite_uwsgi.ini
pidfile         = /var/www/pid.file

Upvotes: 2

Views: 100

Answers (1)

silviomoreto
silviomoreto

Reputation: 5897

It seems related to using a method instead of the bound method.

Try removing the method calling to: (date_active_start__lte=datetime.now, date_active_end__gte=datetime.now)

If you provide the full Resource I could take a deep look into it, but I had similar issues due to using the method where I should use the bound method.

Upvotes: 2

Related Questions