How to sync database and/or discard/disable cache?

2013-08-21 Thread Dig
Hi,

  I'm going to deploy my Django application to Amazon Web Service (AWS), 
and found some strange with AWS RDS (Relational Database Service, I choose 
MySQL 5.5 with InnoDB Engine).

My application is running in Django 1.5, and Python 2.6,

I found following behavior:
Case A:
  Request 1: Delete record A in database, and query record A (it does not 
exist)
  Request 2: Query record A, (it does not exist), and insert record B
*  Request 3: Query record A, (it EXISTS), Query record B, (it does not 
exist),*
  Request 4: Query record A, (it does not exist), Query record B, (it 
exists),

Case B:
  Request 1: Delete record A, and query record A, (it does not exist),
*  Request 2: Query record A, (it EXISTS)*
  Request 3: Query record A, (it does not exist)



These 2 situation not 100% happened (but > 30%), I guess it caused some 
cache (django cache or mysql cache).
Can anyone tell me how to disable Django cache?

Thank you.

Regards,
Dig

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Prefork vs threaded when I want to spawn my own threads

2013-09-03 Thread Dig
I have a similar need. And I implement this feature with uwsgi.

My django application is host in uwsgi, which is support timer(interval).
So I insert my task parameters into database and execute tasks in timer
handler.

Regards,
Dig
On Sep 3, 2013 9:26 PM, "Russell Keith-Magee" 
wrote:

>
> On Tue, Sep 3, 2013 at 9:50 PM,  wrote:
>
>> In my Django application I need to schedule some tasks to run in future.
>> Celery is not an option here because some crucial options - mainly, the
>> ability to revoke() a task - are only available with fully-featured MQ
>> backend and I only have a limited shared hosting where I can't install this
>> kind of software. After some reading, I've found that supposedly "right"
>> way to do that in Python is to spawn a subprocess and call sleep().
>> However, spawning a process does have an overhead, especially considering a
>> rather simple nature of tasks I want to defer (retrieval and conditional
>> deletion of one object).
>>
>> Then I decided to use threads instead. They have little to no overhead,
>> share memory and Python has a nice little threading.Timer class which is
>> exactly what I need. My code looks like this:
>>
>> http://pastebin.com/K6RukAX9
>>
>> Here's when my questions come in. I admit my knowledge of threading is
>> somewhat low and Python operates on high-level too, so nuances are not
>> easily noticeable. From what I've learned, threads (can?) share memory with
>> main thread/process. My primary concern here is that, as far as I
>> understand, method=prefork (the default) creates a pool of processes
>> waiting for work. It seems possible that it may impact my scheduler
>> somehow, i.e. if process that spawned it sits idle (sleeps?) when countdown
>> ends.
>>
>> On the other hand, threaded mode is supposedly more efficient because,
>> being free from overhead of process forking, it can create child threads at
>> will. In my mind this raises a similar concern to above: what if framework
>> decides to destroy a thread that happens to be the one where Timer has been
>> previously spawned?
>>
>> It is entirely possible that my concerns are completely baseless and both
>> methods have nothing to do with my scheduler. I'm asking for input from
>> smarter people than me :)
>>
>
> Lets back up a bit here.
>
> Web servers aren't designed to do the sort of thing you're describing. Web
> requests are not designed to be long lived, and web servers are tuned with
> this in mind. If you try to make them long lived, you're going to hit all
> sorts of problems with thread/process lifecycle management.
>
> The solution here isn't to try and make a web server do something it
> wasn't designed to do. The solution is to work out how to get a task queue
> working on your hardware setup.
>
> You say you can't install a fully-fledged MQ service. Ok - that's fine --
> but don't throw out the baby with the bathwater. There are other ways to
> back Celery -- if need be, you can use a database as your data store.
>
> Or, you could consider using an entirely different task queue. If your
> service provider will give you access to Redis, look into RQ. It's
> lightweight, but
>
> Or, if neither of those are viable, you can do a "ghetto queue" -- a
> combination of cron and a database can be used to implement task queue-like
> behaviour, without any need for celery.
>
> It's difficult to give more specific advice without knowing the specifics
> of your problem domain and your deployment options -- but I implore you --
> don't keep down the path you're on. That way leads to madness :-)
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-cms + Wymeditor + Heroku + AWS s3 + Cors

2013-09-08 Thread Dig
I don't think it's a django question. For security reasons, HTTP browser
will block access resources in a different site(domain) by AJAX request.
You should add Access-Control-Allow-Origin and Access-Control-Allow-Methods
headers (response for OPTION request) to declar your willings.
On Sep 8, 2013 6:29 AM, "Zach Frank"  wrote:

> Having same problem.. did you figure anything out?
>
> Z
>
> On Thursday, October 11, 2012 12:57:30 PM UTC-5, Matteo Suppo wrote:
>>
>> I found this: http://comments.gmane.**org/gmane.comp.python.django.**
>> django-cms/1202
>>
>> and I decided to use tinymce for now. It's not solved though. I will do
>> something, maybe.
>>
>> On Thursday, October 11, 2012 7:25:19 PM UTC+2, Matteo Suppo wrote:
>>>
>>> Ok, here's a fun one.
>>>
>>> I set up a django installation on Heroku, added the django-cms app,
>>> deployed on heroku, and collected the static files on AWS.
>>>
>>> The problem is Django-CMS tries to load the js file for the wymeditor
>>> but AWS says:
>>>
>>> MLHttpRequest cannot load https://s3.amazonaws.com/[...]**
>>> /cms/js/wymeditor/skins/**django/skin.js.
>>> Origin [...] is not allowed by Access-Control-Allow-Origin.
>>>
>>> I actually searched a lot, and discovered this: http://docs.**
>>> amazonwebservices.com/**AmazonS3/latest/dev/cors.html
>>>
>>> Seems like a solution, but even if I activated it, nothing works.
>>>
>>> I'm at loss. It should work but it doesn't. Am I missing something here?
>>> Maybe it doesn't work the way I thought? Should I ask AWS directly?
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANNOUNCE] Security releases issued -- vulnerability in the wild

2013-09-15 Thread Dig
And how about 1.5.3 which is announced a few days ago?
On Sep 15, 2013 5:14 PM, "Rahul Gaur"  wrote:

> Hi ,
>  I am using django==1.4.8 for my project , these new fixes are available
> with pip  yet or we need to install the latest build manually ?
>
> Regards,
> Rahul
>
>
> On Sun, Sep 15, 2013 at 12:18 PM, James Bennett wrote:
>
>> Earlier today a message posted to the django-developers mailing list
>> publicly disclosed what was later determined to be an exploitable security
>> issue in Django.
>>
>> As such, we have short-circuited our normal one-week process and moved to
>> immediately issuing new releases to remedy the problem.
>>
>> Full details are available from the blog:
>>
>> https://www.djangoproject.com/weblog/2013/sep/15/security/
>>
>> All users of Django are urged to upgrade immediately.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
>
> ---
> Rahul Gaur
> irc : iamaregee2
> Web: http://www.rahulgaur.info
> Github: https://github.com/aregee
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [django-announce] [ANNOUNCE] Security releases issued -- vulnerability in the wild

2013-09-15 Thread Dig
Hi Russell,

  Got it, and thanks. We will update to 1.5.4 in this week.

Regards,
Dig
On Sep 15, 2013 8:51 PM, "Russell Keith-Magee" 
wrote:

> Hi Dig
>
> I'm not sure I understand your question. Both releases are security
> releases; both are available on pip. If you code is based on the 1.5
> release of Django, you should now be running 1.5.4.
>
> Yours,
> Russ Magee %-)
>
> On Sunday, September 15, 2013, Dig wrote:
>
>> And how about 1.5.3 which is announced a few days ago?
>> On Sep 15, 2013 5:14 PM, "Rahul Gaur"  wrote:
>>
>>> Hi ,
>>>  I am using django==1.4.8 for my project , these new fixes are available
>>> with pip  yet or we need to install the latest build manually ?
>>>
>>> Regards,
>>> Rahul
>>>
>>>
>>> On Sun, Sep 15, 2013 at 12:18 PM, James Bennett 
>>> wrote:
>>>
>>>> Earlier today a message posted to the django-developers mailing list
>>>> publicly disclosed what was later determined to be an exploitable security
>>>> issue in Django.
>>>>
>>>> As such, we have short-circuited our normal one-week process and moved
>>>> to immediately issuing new releases to remedy the problem.
>>>>
>>>> Full details are available from the blog:
>>>>
>>>> https://www.djangoproject.com/weblog/2013/sep/15/security/
>>>>
>>>> All users of Django are urged to upgrade immediately.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> ---
>>> Rahul Gaur
>>> irc : iamaregee2
>>> Web: http://www.rahulgaur.info
>>> Github: https://github.com/aregee
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-18 Thread Dig
Hi,

  Do you means some thing like this?

os.environ.get('SOME_VARIABLE', 'default_value')

Regards,
Dig
On Sep 19, 2013 1:37 PM, "Victor Hooi"  wrote:

> Hi,
>
> I have several settings in my Django settings.py file that are specific
>
> Currently, I'm grabbing these from environment variables in settings.py:
>
> import os
>> ...
>> # TODO - We need to gracefully catch if these aren't set.
>> SOME_VARIABLE = os.environ['SOME_VARIABLE']
>
>
> This includes things like API keys, database IPs, database
> username/passwords, static file locations etc.
>
> I then set these in the virtualenv activate script.
>
> Is this a good practice in Django?
>
> Also, is there a graceful way of catching when these aren't set?
> Currently, I'm using some of those settings variables in models.py, and
> it's failing silently. Should I put each os.environ call in a try/except
> block, or is there a more Pythonic way?
>
> Cheers,
> Victor
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


How to share model/data cross django project

2013-09-20 Thread Dig
Hi,

  There are about 20 views in a django project (with a django app).
Recently, a new requirement occurred, someone want to split current views
into 2 site but the database is unique. That means 2 subdomain, 2 views
sets, 2 deployment scripts, but only one database.

Can I implement this feature by writing 2 setting.py files?

Environment:
  Django 1.5.4
  Nginx + uwsgi
  MySQL

Thanks,
Dig

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to share model/data cross django project

2013-09-24 Thread Dig
Hi,

  Please let me repeat my question shortly, I want to access the same
database from 2 different django project/app. Can anyone help me? Thanks.

Regards,
Dig
On Sep 20, 2013 9:13 PM, "Dig"  wrote:

> Hi,
>
>   There are about 20 views in a django project (with a django app).
> Recently, a new requirement occurred, someone want to split current views
> into 2 site but the database is unique. That means 2 subdomain, 2 views
> sets, 2 deployment scripts, but only one database.
>
> Can I implement this feature by writing 2 setting.py files?
>
> Environment:
>   Django 1.5.4
>   Nginx + uwsgi
>   MySQL
>
> Thanks,
> Dig
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to share model/data cross django project

2013-09-24 Thread Dig
Hi,

 Thanks for your reply.
I want to separate internal user and external user.
External user can use a http connection to see a few pages. (http only)
Internal user use a https connection to do some staff only operations.
(https only)
This site are deployed on AWS, and we want to leverage Security Group
(IPfirewall) to takes the restrict,
So I have to do build 2 different app for external user and internal user.

I know that I can implement this feature in app layer, but it will waste
more CPU.

Regards,
Dig


Regards,
Dig Ge


On Tue, Sep 24, 2013 at 10:21 PM, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> Sure, just have the DATABASES entry in the settings.py files point to the
> same server/database, or to the same server and different databases.
>
> François
>
> On Sep 24, 2013, at 10:12 AM, Dig  wrote:
>
> > Hi,
> >
> >   Please let me repeat my question shortly, I want to access the same
> database from 2 different django project/app. Can anyone help me? Thanks.
> >
> > Regards,
> > Dig
> >
> > On Sep 20, 2013 9:13 PM, "Dig"  wrote:
> > Hi,
> >
> >   There are about 20 views in a django project (with a django app).
> Recently, a new requirement occurred, someone want to split current views
> into 2 site but the database is unique. That means 2 subdomain, 2 views
> sets, 2 deployment scripts, but only one database.
> >
> > Can I implement this feature by writing 2 setting.py files?
> >
> > Environment:
> >   Django 1.5.4
> >   Nginx + uwsgi
> >   MySQL
> >
> > Thanks,
> > Dig
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to share model/data cross django project

2013-09-24 Thread Dig
Hi,

  And how about models.py? Makes a copy?

Thanks.

Regards,
Dig


Regards,
Dig Ge


On Tue, Sep 24, 2013 at 11:51 PM, Rafael E. Ferrero <
rafael.ferr...@gmail.com> wrote:

> seems to me that you can setup the same database in the two settings.py of
> your two projects.
>
>
>
>
> 2013/9/24 Dig 
>
>> Hi,
>>
>>  Thanks for your reply.
>> I want to separate internal user and external user.
>> External user can use a http connection to see a few pages. (http only)
>> Internal user use a https connection to do some staff only operations.
>> (https only)
>> This site are deployed on AWS, and we want to leverage Security Group 
>> (IPfirewall) to takes the restrict,
>> So I have to do build 2 different app for external user and internal user.
>>
>> I know that I can implement this feature in app layer, but it will waste
>> more CPU.
>>
>> Regards,
>> Dig
>>
>>
>> Regards,
>> Dig Ge
>>
>>
>> On Tue, Sep 24, 2013 at 10:21 PM, François Schiettecatte <
>> fschietteca...@gmail.com> wrote:
>>
>>> Sure, just have the DATABASES entry in the settings.py files point to
>>> the same server/database, or to the same server and different databases.
>>>
>>> François
>>>
>>> On Sep 24, 2013, at 10:12 AM, Dig  wrote:
>>>
>>> > Hi,
>>> >
>>> >   Please let me repeat my question shortly, I want to access the same
>>> database from 2 different django project/app. Can anyone help me? Thanks.
>>> >
>>> > Regards,
>>> > Dig
>>> >
>>> > On Sep 20, 2013 9:13 PM, "Dig"  wrote:
>>> > Hi,
>>> >
>>> >   There are about 20 views in a django project (with a django app).
>>> Recently, a new requirement occurred, someone want to split current views
>>> into 2 site but the database is unique. That means 2 subdomain, 2 views
>>> sets, 2 deployment scripts, but only one database.
>>> >
>>> > Can I implement this feature by writing 2 setting.py files?
>>> >
>>> > Environment:
>>> >   Django 1.5.4
>>> >   Nginx + uwsgi
>>> >   MySQL
>>> >
>>> > Thanks,
>>> > Dig
>>> >
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> > To post to this group, send email to django-users@googlegroups.com.
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Rafael E. Ferrero
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to share model/data cross django project

2013-09-24 Thread Dig
Hi Frank,

  Thank you for your reply. I can implement this feature in app layer, but
I won't do it to waste CPU. It can be done in IP firewall, so I prefer
laverge it.

Regards,
Dig
On Sep 25, 2013 12:21 AM, "Frank Bieniek" 
wrote:

>  Hi Dig,
> you want to have different permissions actions depending on the user, that
> accesses the data,
> but it is the the same data - correct? if so you are speaking about one
> app not two.
> One App, as it is the same data, but different views, related to the
> context you are accessing it.
>
> Do you have investigated django guardian - object level permissions?
>
> Thanks
> Frank
>
>
>
>
>
>
>
>
> Am 24.09.2013 16:12, schrieb Dig:
>
> Hi,
>
>   Please let me repeat my question shortly, I want to access the same
> database from 2 different django project/app. Can anyone help me? Thanks.
>
> Regards,
> Dig
> On Sep 20, 2013 9:13 PM, "Dig"  wrote:
>
>> Hi,
>>
>>   There are about 20 views in a django project (with a django app).
>> Recently, a new requirement occurred, someone want to split current views
>> into 2 site but the database is unique. That means 2 subdomain, 2 views
>> sets, 2 deployment scripts, but only one database.
>>
>> Can I implement this feature by writing 2 setting.py files?
>>
>> Environment:
>>   Django 1.5.4
>>   Nginx + uwsgi
>>   MySQL
>>
>> Thanks,
>> Dig
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Which Real Time Communications Protocol

2013-12-21 Thread Dig
Hi Serge,

  May I know the capacity of your system with telnet/xmlrpc?

I'm intresting in this topic, and the next project could have a push
scenario.

Thanks.

Regards,
Dig
On Dec 21, 2013 1:01 AM, "Sergiy Khohlov"  wrote:

> telnet and xmlrpc is a good choice.  I'm working on the similar project
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
>
> On Fri, Dec 20, 2013 at 6:58 PM, Mario Osorio 
> wrote:
> > My app will have to communicate different customers (Linux devices,
> Windoze
> > devices, iOS devices and Android devices at least).
> >
> > Overall, any of these customer devices will start one of many processes
> and
> > some of the other devices are required to respond by letting their users
> > know about the just initialized event. The original event might in turn
> > start related events with more or less the same behavior.
> >
> > I will be using email and SMS as 'secondary weapons', but I need some
> sort
> > of real time communications protocol as primary so whatever devices that
> are
> > connected and need, will be notified immediately. (I'm not sure I'm
> making
> > much sense at this point)
> >
> > What communications protocol can I use so that it:
> >
> > offers real time response
> > is as simple as possible
> > works in as many different customers as possible
> >
> > Thanks a lot in advanced!
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/17ffdba6-041f-49b8-b688-aa5cdb4a7130%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADTRxJP7Dfj0mt3cRvrJvy08e6hYBjSfa7cKkzEQ10TVcd%3DRrQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAObE2pHEkqa4%2BgAEpatuRYBgBMB2rcg7HGeWjOpP9SoE%2BOiM%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Which Real Time Communications Protocol

2013-12-21 Thread Dig
Hi Bill,

  Is there any django project support websocket? Thanks.

Regards,
Dig
On Dec 21, 2013 1:50 AM, "Bill Freeman"  wrote:

> WebSockets runs over standard HTTP or HTTPS connections, getting past
> firewalls and other restrictions (e.g.; the hotel WiFi will let you web
> browse, but not use other ports).  Since WebSockets is standard HTML5,
> libraries for it will become more and more common.  There are also older
> "push" technologies (COMET, long poll, etc.).
>
> You can also ad hoc something on these ports.
>
>
> On Fri, Dec 20, 2013 at 12:10 PM, Mario R. Osorio wrote:
>
>> Thanks a lot Serge!
>>
>>
>> Dtb/Gby
>> ===
>> Mario R. Osorio
>>
>> "If I had asked people what they wanted, they would have said faster
>> horses."
>>  -- Henry Ford
>>
>> http://www.google.com/profiles/nimbiotics
>>
>>
>> On Fri, Dec 20, 2013 at 12:01 PM, Sergiy Khohlov wrote:
>>
>>> telnet and xmlrpc is a good choice.  I'm working on the similar project
>>> Many thanks,
>>>
>>> Serge
>>>
>>>
>>> +380 636150445
>>> skype: skhohlov
>>>
>>>
>>> On Fri, Dec 20, 2013 at 6:58 PM, Mario Osorio 
>>> wrote:
>>> > My app will have to communicate different customers (Linux devices,
>>> Windoze
>>> > devices, iOS devices and Android devices at least).
>>> >
>>> > Overall, any of these customer devices will start one of many
>>> processes and
>>> > some of the other devices are required to respond by letting their
>>> users
>>> > know about the just initialized event. The original event might in turn
>>> > start related events with more or less the same behavior.
>>> >
>>> > I will be using email and SMS as 'secondary weapons', but I need some
>>> sort
>>> > of real time communications protocol as primary so whatever devices
>>> that are
>>> > connected and need, will be notified immediately. (I'm not sure I'm
>>> making
>>> > much sense at this point)
>>> >
>>> > What communications protocol can I use so that it:
>>> >
>>> > offers real time response
>>> > is as simple as possible
>>> > works in as many different customers as possible
>>> >
>>> > Thanks a lot in advanced!
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Django users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> > email to django-users+unsubscr...@googlegroups.com.
>>> > To post to this group, send email to django-users@googlegroups.com.
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/17ffdba6-041f-49b8-b688-aa5cdb4a7130%40googlegroups.com
>>> .
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/vZQ3C4DS73g/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-users+unsubscr...@googlegroups.com.
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CADTRxJP7Dfj0mt3cRvrJvy08e6hYBjSfa7cKkzEQ10TVcd%3DRrQ%40mail.gmail.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAO2PNV6N-gJ%3DW-PxqnrWj8D6JMqJPnLgshUV3

Re: Question about django-boto and S3

2013-12-24 Thread Dig
Hi Xu,

There are 2 solutions in my opinion:
1. makes your key public, you can do it in S3 admin console or by a CLI/API,
2. use generate_url() method  on a boto.s3.key.Key object. please
refer to *http://boto.readthedocs.org/en/latest/ref/s3.html
<http://boto.readthedocs.org/en/latest/ref/s3.html> to get more detail.*

*Regards,*
*Dig*



Regards,
Dig Ge


On Tue, Dec 24, 2013 at 11:42 PM, Chen Xu  wrote:

> I have a private folder under a bucket, which stores all the images, and
> when I try to access to the image on the web for example:
>
> https://s3.amazonaws.com/bucket/folder/img.jpg";> it does not
> display, and gives my access denied error, I am wondering if there is a way
> using boto to generate a public accessible URL based on the private URL,
> and display it?
>
> Thanks in advance
>
> --
> ⚡ Chen Xu ⚡
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACac-qZat%3DmA61Ci4W8yf3AsGF1Y84wVTBgGQ5x0Vx75CQXp7w%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAObE2pETLsAB38FTAMFd8vyQkEe6K73DHZceN89VAixjMd9HTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Showing which users are viewing a given page

2014-03-04 Thread Dig
my opinion,

frontend:
setup a ping api, and refresh every 30 seconds, pass in a current page url
from javascript, and return current page viewers.

backup:
a table has 3 main column (user id, page id, last_ping). update the page_id
and last_ping when receiving a ping request. and return users list who are
on the same page and last_ping within 60 seconds.

30 or 60 seconds are sample data.

Regards,
Dig
2014-3-4 下午8:30于 "Some Developer" 写道:

> Hopefully someone here will be able to point me in the right direction.
>
> Basically I want to be able to view which users are viewing a page at any
> given time and I want to be able to update it in real time using JavaScript
> but I'm at a loss as to how to track which users are viewing any given page
> in Django.
>
> So for instance if I had mydomain.com/page/ I'd like a little box on the
> top of the page saying "Page being viewed by users: xxx and yyy" and then
> when one of those users navigates away from the page the box updates to
> remove that user from the list.
>
> I'm not sure if I have described what I want clearly enough so if you need
> any more information let me know. Any help is appreciated :).
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/5315C6F8.10701%40googlemail.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAObE2pED60iprTzivr--LQv_yVPcverJurnJ8EPE9MEpXOq1MQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.