Re: Any way to force Django to commit a write so another process can read the correct data from DB?

2016-07-28 Thread epoolanny32


On Wednesday, July 27, 2016 at 10:27:34 AM UTC-4, Stodge wrote:
>
> My website uses a combination of Django + Java apps to function. For this 
> particular problem, a record is deleted from the DB via a TastyPie resource 
> DELETE operation. A Django signal post_delete handleris invoked, which 
> submits a DELETE request to Jetty running in the Java app. The Java app 
> then performs a query using Hibernate.
>
> What appears to be happening is that Django thinks the record was deleted:
>
> DynamicVolume.objects.filter(user=instance.user).count()
>
> Returns ZERO.
>
> However, the Java app thinks the record still exists unless I make it 
> sleep for several seconds before asking Hibernate to query the DB.
>
> I've tried forcing Hibernate to clear its cache with no success. Is there 
> a way to force Django to commit the deletion (flush the cache)?
>
> Thanks
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5bbda116-71eb-4043-884f-4af1ba1d59f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any way to force Django to commit a write so another process can read the correct data from DB?

2016-07-28 Thread Constantine Covtushenko
Hi Mike,

It is not a bug.
It is just how it works.

Regards

On Thu, Jul 28, 2016 at 3:53 AM, Mike Dewhirst 
wrote:

> On 28/07/2016 5:46 AM, Constantine Covtushenko wrote:
>
>> Hi Stodge,
>>
>> As said in Django current version of documentation
>> ,
>> 'post_delete' signal is sent after record is deleted. This means also
>> that transaction is closed at that moment. And DB should not has deleted
>> instance any more.
>>
>> I have double checked the Django code and can say that Django send that
>> signal just before transaction is committed.
>>
>
> Is this a Django bug?
>
> Is it the same for post_save?
>
> Mike
>
> So technically instance should be inside DB for Hibernate processing.
>>
>> I can suggest you to create a custom signal and send it after
>> transaction closed.
>> That should solve your problem.
>>
>> Regards,
>>
>> On Wed, Jul 27, 2016 at 5:27 PM, Stodge > > wrote:
>>
>> My website uses a combination of Django + Java apps to function. For
>> this particular problem, a record is deleted from the DB via a
>> TastyPie resource DELETE operation. A Django signal post_delete
>> handleris invoked, which submits a DELETE request to Jetty running
>> in the Java app. The Java app then performs a query using Hibernate.
>>
>> What appears to be happening is that Django thinks the record was
>> deleted:
>>
>> DynamicVolume.objects.filter(user=instance.user).count()
>>
>> Returns ZERO.
>>
>> However, the Java app thinks the record still exists unless I make
>> it sleep for several seconds before asking Hibernate to query the DB.
>>
>> I've tried forcing Hibernate to clear its cache with no success. Is
>> there a way to force Django to commit the deletion (flush the cache)?
>>
>> Thanks
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>>
>> https://groups.google.com/d/msgid/django-users/e76d5cfa-f4bc-41db-a322-0d44aa0719dd%40googlegroups.com
>> <
>> https://groups.google.com/d/msgid/django-users/e76d5cfa-f4bc-41db-a322-0d44aa0719dd%40googlegroups.com?utm_medium=email_source=footer
>> >.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>>
>> https://groups.google.com/d/msgid/django-users/CAK52boWeFYGOhk0CL%2BoEimreb2k%2BgFwL2rBb0imoPbmfpwo5Yw%40mail.gmail.com
>> <
>> https://groups.google.com/d/msgid/django-users/CAK52boWeFYGOhk0CL%2BoEimreb2k%2BgFwL2rBb0imoPbmfpwo5Yw%40mail.gmail.com?utm_medium=email_source=footer
>> >.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/450c40f7-8997-6669-b307-b39825d00adb%40dewhirst.com.au
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK52boUd%3D1-QiYBhA-284%3D-J-VZCiGKcnsmRs9Kpk%2BYtaff8ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installation

2016-07-28 Thread Luis Zárate
Take a look this
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor


El miércoles, 27 de julio de 2016, Sergiy Khohlov 
escribió:
> Take a look at
https://jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/
this is perfect doc related to your situation s.
>
> 27 лип. 2016 12:04 "Its Eternity"  пише:
>
> Hey, a friend recently wrote my a web-app for me to use however I am not
sure how I deploy the web app onto my VPS. I've looked at the tutorials on
Django but it says that  I can only use it for development. Is there a
method for me to get Django for public use?
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/95e91756-b960-4021-8603-e3ee21c3b4b9%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CADTRxJMBN2Voi0pqOoc7iY_rjzbwX9e99kSktsWqXjN3GrRQPQ%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyMH2dRnL7-tv8vm4F7C5yzqdNFM-dFhkA%2B9_U6%3DkjWA3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add logo to django header

2016-07-28 Thread ludovic coues
You are suggesting to alter the django library directly. This as two
immediate bad effect.

First, it make upgrading to newer and more secure version of django
harder as the change will be overwritten by the upgrade.

Second, if you want to keep your track of your change, using git for
exemple, you will need to add the whole django directory. This take a
lot of space.

2016-07-28 15:04 GMT+02:00 Volodymyr Kirichinets :
> If You want to change background of the header, Try this
> open  :
> /you/path/to/python2.7/site-packages/django/contrib/admin/static/admin/css/base.css
> add
> h1 {
> .
> 
> background:url("path/to/you/static/images/youlogo.png");
> }
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e23f6d97-b751-4e94-afc8-249c9741ae83%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTbwU5PZzQX9kkBSDxs9JgjoX2gjKyE%3D1OmJbVF-dSsDTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add logo to django header

2016-07-28 Thread Volodymyr Kirichinets
If You want to change background of the header, Try this
open  :   
/you/path/to/python2.7/site-packages/django/contrib/admin/static/admin/css/base.css
add
h1 {
.

background:url("path/to/you/static/images/youlogo.png");
} 

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e23f6d97-b751-4e94-afc8-249c9741ae83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add logo to django header

2016-07-28 Thread Volodymyr Kirichinets
This if You want to change icon.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20d67c28-3cb9-43c5-89c9-025d3e1e9962%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add logo to django header

2016-07-28 Thread Volodymyr Kirichinets
Hi,
open 
/your/path/to/python2.7/site-packages/django/contrib/admin/templates/admin/base.html
  
file
add  to top of file :
And You get a logo!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eddf4ee8-eca8-4593-b011-1a8702d78112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add logo to django header

2016-07-28 Thread Siddharth Ghumre
Hi,

Please follow the documentation on
https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#overriding-vs-replacing-an-admin-template

The file you are looking for is base_site.html which you need to override
to change the default 'Django Administrator' heading to your company logo.

Hope this helps.

-Sid

On Thu, Jul 28, 2016 at 2:04 PM, Gauri Shirsath <
gauri.shirs...@inspiritvision.com> wrote:

> Hi,
>
> I want to show company logo instead of 'Django Administrator' heading.
> Can someone please guide me.
>
> Regards,
> Gauri
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/991a1cf4-8a32-4941-ae43-e7a3f46916af%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANtEdp5R9XcYcNBYKWwB%2BT%3DjrGr-O2aBdjHqEO%2Bgw0FFfe-bJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add logo to django header

2016-07-28 Thread Constantine Covtushenko
Hi Gauri,

One of approach is would be to override admin base template used as a
parent for all admin pages.
Please see that documentation link

about how to do that.

Regards,

On Thu, Jul 28, 2016 at 9:04 AM, Gauri Shirsath <
gauri.shirs...@inspiritvision.com> wrote:

> Hi,
>
> I want to show company logo instead of 'Django Administrator' heading.
> Can someone please guide me.
>
> Regards,
> Gauri
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/991a1cf4-8a32-4941-ae43-e7a3f46916af%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK52boWCWBDXyFJ%3D1SvJhbAjKPgrY6w3N2_GkDBfO5X%3D-xd_VA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to add logo to django header

2016-07-28 Thread Gauri Shirsath
Hi,

I want to show company logo instead of 'Django Administrator' heading.
Can someone please guide me.

Regards,
Gauri

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/991a1cf4-8a32-4941-ae43-e7a3f46916af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.