Re: Access request body in the django.request logger

2016-09-15 Thread Ben Whale
I should add that this difference in behavior occurs because the handlers array in the Logger class is different in the two cases. Specifically in the line "for hdlr in c.handlers:" in the file /logging/__init__.py the variable c.handlers is empty ([]) in the first case and is a

Re: Access request body in the django.request logger

2016-09-15 Thread Ben Whale
Thanks for a link to the blob, that is very helpful. You might be right, but the more I look at this the more I think it is a bug. The logging message is generated in django/utils/log.py in the ServerFormatter format() method. If the logging setting is LOGGING = {

Re: Import css in Django

2016-09-15 Thread Mike Dewhirst
On 16/09/2016 11:47 AM, Jonathan Cheng wrote: after importing announce,directories in settings.py | | ifDEBUG: Â Â Â Â announce(__name__,databases=DATABASES,backend="Postgres: 9.5",caches=CACHES) | | it said CACHES isn't defined when i running the server | python manage.py runserver |

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
after importing announce,directories in settings.py if DEBUG: announce(__name__, databases=DATABASES, backend="Postgres: 9.5", caches=CACHES) it said CACHES isn't defined when i running the server python manage.py runserver Mike Dewhirst於 2016年9月16日星期五 UTC+8上午8時43分17秒寫道: >

Re: ModelAdmin missing a couple of key features, or am I doing this wrong?

2016-09-15 Thread thauk
I just realized that get_form is already passed the model instance as obj, so that fixes getting he model instance (for this method at least -- hopefully I don't need to override another method that doesn't get obj). Still need a better way to customize how a form instance is initialized,

Re: ModelAdmin missing a couple of key features, or am I doing this wrong?

2016-09-15 Thread thauk
I'm having trouble finding any related tickets other than this one, which is 8 years old: https://code.djangoproject.com/ticket/10305 On Thursday, September 15, 2016 at 5:34:50 PM UTC-7, Tim Graham wrote: > > I think these ideas have been floated before. If you look through the Trac > tickets

Re: ModelAdmin missing a couple of key features, or am I doing this wrong?

2016-09-15 Thread thauk
Hi Tim, thanks for the reply :) It's not that I want to store the model instance on self.instance, it's just the solution I was able to come up with, given the problem "I need to get to the model instance for this HTTP request". If there's a better way to do it, I'm all ears! T On Thursday,

Re: Import css in Django

2016-09-15 Thread Mike Dewhirst
On 16/09/2016 1:10 AM, Jonathan Cheng wrote: thx your code,though i cant run it in cmd That is correct. It is designed to be imported and called from settings.py. I'll send you a screenshot off-line Mike -- You received this message because you are subscribed to the Google Groups "Django

Re: ModelAdmin missing a couple of key features, or am I doing this wrong?

2016-09-15 Thread Tim Graham
I think these ideas have been floated before. If you look through the Trac tickets you might find something related. However, your subclass where you store "self.instance" on ModelAdmin is a no no due to thread safety. See

Re: Access request body in the django.request logger

2016-09-15 Thread Tim Graham
The logging is coming from here: https://github.com/django/django/blob/43c471e81c27542e4dc392dfa2310c5a52db35d9/django/core/servers/basehttp.py#L103 where self.request is indeed a "socketobject" I'm not sure if the WSGIRequest object is available at that point, so possibly this just needs a

Re: Access request body in the django.request logger

2016-09-15 Thread Ben Whale
Well my last reply was preemptery. A minimal working example can be produced via the following commands. First navigate to a suitable directory then, # virtualenv venv --no-site-packages # source venv/bin/activate # pip install django # django-admin startproject mwe # vim mwe/mwe/settings.y and

ModelAdmin missing a couple of key features, or am I doing this wrong?

2016-09-15 Thread thauk
I have a ModelAdmin subclass (code at: ) and I need to do a couple of things, but the functionality seems to be missing: 1. I need to access the model instance to perform some initialization, but there's no instance member set. There are a few questions on Stack Overflow

Re: Access request body in the django.request logger

2016-09-15 Thread Ben Whale
Thanks for the reply Tim Some testing seems to indicate that it is an issue with django-rest-framework. When I contact the web server using urls managed by django rest the issues occurs, when I do the same via url managed by vanilla django the request variable in the context object is an

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx your code,though i cant run it in cmd Mike Dewhirst於 2016年9月12日星期一 UTC+8上午10時05分10秒寫道: > > Jonathan > > I use the attached announce.py to display exactly where all the > directories and URLs are. I had trouble in the beginning getting it > straight in my head but seeing it every time I

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx everyone,all bugs were fixed early. Jonathan Cheng於 2016年9月11日星期日 UTC+8下午10時59分56秒寫道: > > I use django1.10 > > i reference the official doc > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ > > my project name:mysite > > structure: > > - mysite- > >

Re: export html to pdf

2016-09-15 Thread Derek
There is a useful overview of different tools here: https://spapas.github.io/2015/11/27/pdf-in-django/ On Wednesday, 14 September 2016 16:46:57 UTC+2, Saeon Tao wrote: > > Hi guys, > > Does someone have a great suggestion for exporting an html div and save to > pdf? i have found many options,

[ANNOUNCE] djangoCMS 3.4 released

2016-09-15 Thread czpython
Hello all, The django CMS core team just released version 3.4. Our first LTS release. Download: https://github.com/divio/django-cms/archive/3.4.0.zip Documentation: http://docs.django-cms.org/en/latest/index.html Release notes: http://docs.django-cms.org/en/latest/upgrade/3.4.html Source:

Re: Access request body in the django.request logger

2016-09-15 Thread Tim Graham
If true, it does seem like a bug. Could you provide a test for Django's test suite or a sample project to reproduce it? On Thursday, September 15, 2016 at 6:53:55 AM UTC-4, Ben Whale wrote: > > Hi > > What I'd like to do is log the request body whenever the django.request > logger logs

Access request body in the django.request logger

2016-09-15 Thread Ben Whale
Hi What I'd like to do is log the request body whenever the django.request logger logs something. I had assumed that the extra context referred to as request in https://docs.djangoproject.com/en/1.10/topics/logging/#django-request was something like an HTTPRequest object. It is, however, an

Re: creating a loginpage

2016-09-15 Thread Shubham Aggarwal
I think Django documentation is well written On Wed, Sep 14, 2016 at 11:52 PM, Timothy Steele < steeletimothy2...@gmail.com> wrote: > Thanks Tim it has work this time but can any one help me with a beginner > book to learn Django please > > > > On Wednesday, September 14, 2016 at 4:44:14 PM

A public cloud with django backend

2016-09-15 Thread Rahul Doshi
Hi ,I want to setup a dropbox like server with django. So far i have achieved uploading files onto a location .I want these files to show up on browser which they do(while saving file to the location I indexed an entry in the Db so i just print the file names from the DB(POSTGRESQL).Now i want

Re: Custom Template Tag

2016-09-15 Thread 'Abraham Varricatt' via Django users
The idea of doing a POST request during template rendering seems weird. As others have mentioned - that's not the place for it. But perhaps you issue could be a matter of performing your POST operation on the client side, instead of the django server? In that case, it might be worth

Re: Abridged summary of django-users@googlegroups.com - 35 updates in 12 topics

2016-09-15 Thread Mandeep Tondak
Hey You can use AVTAR package for images upload On Thu, Sep 15, 2016 at 11:04 AM, Constantine Covtushenko < constantine.covtushe...@gmail.com> wrote: > Hi Juliana, > > Did check this django doc > page? > It describes basics of