Re: Model-level validation

2022-09-29 Thread Curtis Maloney
On Thu, 29 Sep 2022, at 14:29, Aaron Smith wrote: > Why doesn't Django validate Models on save()? The short answer is: backwards compatibility. Model level validation hasn't always been a thing, with Django initially depending primarily on Form validation. Since it hadn't _always_ been there, i

Re: Model-level validation

2022-10-05 Thread Curtis Maloney
FWIW +1 from me! -- C On Thu, 6 Oct 2022, at 14:11, Aaron Smith wrote: > It sounds like there is little support for this being the default. But I'd > like to propose something that might satisfy the different concerns: > > 1) A `validate` kwarg for `save()`, defaulted to `False`. This maintain

Re: Integrate dj-database-url into Django

2022-11-28 Thread Curtis Maloney
I recently did a bit of an audit of "settings types" whilst preparing for an overhaul of django-classy-settings. I found you could cover a majority of the common config types if you could somehow parse from an environ string the following (which closely aligns with django-environ): + str + int

Re: ticket 5929

2023-01-08 Thread Curtis Maloney
On Sun, 8 Jan 2023, at 23:29, Barhamou Hama wrote: > Hi all, I came across this ticket here > opened 15 years ago that doesn't > seem to have been resolved. I decided to work on it. But in 15 years a lot > can happen. Is it still relevant? Has there b

Re: create database view from another table

2023-02-06 Thread Curtis Maloney
Hi Mike, this is not really the correct list for your question - this list is about development _of_ Django, not _with_ Django. That said: did you consider adding an index for each of the derived values you wanted? This can act as an efficient way to keep, effectively, a "cache" of values deri

Re: Drop CSRF middleware from the settings template

2023-04-16 Thread Curtis Maloney
On Mon, 17 Apr 2023, at 04:25, 'Ryan Hiebert' via Django developers (Contributions to Django itself) wrote: > I've recently been working with other new frameworks, particularly Remix. > Coming from Django, which has had excellent CSRF for many years, one of my > first questions was how to handl

Re: Can we move the activity on this list to the Forum now?

2023-05-03 Thread Curtis Maloney
Does the Forum allow me to get email notifications / summaries? If not, it will mean I disconnect with that part of the community. -- Curtis On Thu, 4 May 2023, at 15:19, Arthur Rio wrote: > Yes please! > > > > On May 3, 2023 at 11:19:12 PM, jure.erznoz...@gmail.com > (jure.erznoz...@gmail.c

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-03 Thread Curtis Maloney
Hi Mike, On Fri, 4 Aug 2023, at 06:03, Ryan Gartin wrote: > I came across this issue calling the following and FK fields with _id are > ignored: > serialize('json', , fields=['title', 'state_id']). I think the problem you've run into here is "state_id" is not a Field on your model; it's wh

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-05 Thread Curtis Maloney
I think if you give it an afternoon's digging you could add an option to the django core serializers to list non-field attributes to include. -- Curtis > > On Thursday, August 3, 2023 at 9:46:27 PM UTC-4 Curtis Maloney wrote: >> __ >> Hi Mike, >> >> On Fri, 4 A

Re: Cookies with Django

2024-08-08 Thread Curtis Maloney
{I am not a lawyer. None of this is legal advice, of course.} Django itself does nothing to tell your users authentication uses cookies. If and how you choose to do that is up to you; also, there are some 3rd party apps to try to make this easier. However, I find this paragraph from https://gdp

Re: Please add exists subquery to queryset api

2014-11-10 Thread Curtis Maloney
If you want to know the SQL generated for any particular queryset, you can just: print str(qs.query) On 11 November 2014 11:39, George Ma wrote: > For simplicity, let's assume we have a model A and model B. > > class A(models.Model): > name = models.CharField(max_length=200) > > class B

Re: Please add exists subquery to queryset api

2014-11-10 Thread Curtis Maloney
actual sql is very close to this one. But I just feel this > approach is like a hack. Because I always have to reverse the logic first > and then reverse again. Not as natural as exists subquery. > > On Monday, November 10, 2014 5:53:47 PM UTC-7, Curtis Maloney wrote: >> >> If

Re: Template render performance

2014-11-18 Thread Curtis Maloney
It's been on my TODO list for some time to deep dive into DTL and find where I can to remove excess work. There's a LOT of defensive coding in there to ensure things are what we expect, and to handle cases "just in case", and I've a gut feeling [nothing more] that we can remove some of these safet

Re: Status of #15619: logout via POST, but not GET

2014-12-03 Thread Curtis Maloney
Wasn't there a PR to turn all the auth views to CBV? That would implicitly enforce the behaviour to POST-only, I would hope. -- Curtis On 4 December 2014 at 09:52, Tim Graham wrote: > Hi Tim, > > There's an open pull request , > but it was opened ov

Re: Overriding Class-based View Form Validation

2014-12-11 Thread Curtis Maloney
Firstly, I think this query really belongs in django-users ... this list is about development _of_ django, not _with_ django. Secondly, why not override get_form_kwargs [1] to add the user into creating the form class? But yes, validation all belongs inside the form class, ideally. [1] https://

Re: intended security model for templates

2014-12-24 Thread Curtis Maloney
Personally I feel it's exposing too much implementation to the template authors. Whilst I can understand the appeal of allowing namespacing of template libs, I think exposing full python paths is the wrong approach. Perhaps allowing a "app_label:libname" approach to being more specific? -- Curti

Re: intended security model for templates

2014-12-28 Thread Curtis Maloney
I certainly like the idea of making public the API to load your tag lib by default for your project. It's there, it's clean, and it's been stable for a looong time. Of course, the multi-template-engine work may change this. Also, I agree that "explicit is better than implicit", and thus reducing

Re: resurrecting an old friend, whitespace in forms, #6362

2015-02-04 Thread Curtis Maloney
I'm certainly leaning on the side of "strip by default" because, like many others, I feel it's the expected default -- users just don't get it -- and have been bitten by it before. I think I'll have a PR for this later tonight... -- Curtis On 5 February 2015 at 14:23, charettes wrote: > Like

Re: Possible bug: makemigrations caching prior migrations after deletion

2015-02-08 Thread Curtis Maloney
Could you provide details about what sort of field you added, please? I have seen cases where migrations will create two separate migrations for an initial. -- Curtis On 9 February 2015 at 10:11, Yo-Yo Ma wrote: > Using Python 3.4.2 and Django @stable/1.8.x (installed just moments before > thi

Re: new to django... looking to contribute to learn more

2015-02-08 Thread Curtis Maloney
Certainly sounds useful, and the research seems to suggest all (most?) of the major backends support it. -- C On 9 February 2015 at 11:26, Bob Remeika wrote: > Hi, > > I'm new to django and python in general but I've been a programmer for a > while now. > > I was interested in trying to contri

Re: new to django... looking to contribute to learn more

2015-02-08 Thread Curtis Maloney
ary 2015 at 13:21, Bob Remeika wrote: > Yeah I think so although I don't know enough about it to know for sure. > I'm hoping to come up with something rough and then get a little help from > people that know better. > > On Sunday, February 8, 2015 at 5:24:28 PM UTC-8, Curti

Re: discontinue shipping tests with contrib apps?

2015-02-09 Thread Curtis Maloney
Just to shine a light on another perspective- I frequently tell people to look at contrib for "best practices", and including tests within a 3rd party app would fall under that. -- Curtis On 10 Feb 2015 03:34, "Marc Tamlyn" wrote: > +1 to removing tests from contrib itself, so long as they remai

Re: discontinue shipping tests with contrib apps?

2015-02-09 Thread Curtis Maloney
uot; directory. Or did I misunderstand what you meant? > > - Django REST framework > - django-nap > - the apps that split out from contrib (formtools, comments, localflavor) > > On Monday, February 9, 2015 at 5:28:22 PM UTC-5, Curtis Maloney wrote: >> >> Just to shine a lig

JsonResponse and list values

2015-02-16 Thread Curtis Maloney
Ran into this bug this morning... what's the rationale behind JsonResponse only accepting dict types unless you set safe=False to allow _any_ type? Surely list/tuple should also be permitted? There's a test explicitly ensuring lists fail. I'm not comfortable turning off ALL type safe-guards just

Re: JsonResponse and list values

2015-02-16 Thread Curtis Maloney
Cheers for the quick reply... well, you learn more about how shit JS is every day :P -- C On 17 February 2015 at 10:41, Florian Apolloner wrote: > > > On Tuesday, February 17, 2015 at 12:30:25 AM UTC+1, Curtis Maloney wrote: >> >> Ran into this bug this morning... what&#

Re: Drop the TEMPLATE_DEBUG setting

2015-02-18 Thread Curtis Maloney
Just to chip in here... when TEMPLATE_DEBUG=True the template engine uses a substantially different Lexer, based on re.finditer() instead of re.split(). There are about 10 hooks in the Parser class, too, that exist almost exclusively to allow the DebugParser to change behavior. If we always store

Re: Adding context to docs

2015-02-19 Thread Curtis Maloney
In all cases in Django, if your code imports the class, you can put it wherever you like - so long as Python can find it. It's only things that are "discovered" by Django [admin, models, etc] that must be in a specific module. By convention, forms are put into forms.py ... but that's so _humans_

Re: Adding context to docs

2015-02-19 Thread Curtis Maloney
On 20 February 2015 at 11:49, Diana Probst wrote: > Never done either of those things, and I'm completely not set up to do > them. I will if creating this subject has made me the owner of it, but > it's a lot more work for me than it would be for someone else. I'd start > with the Writing your

Re: Extending the URL Dispatcher (GSoC 2015 proposal)

2015-03-02 Thread Curtis Maloney
On 3 March 2015 at 03:57, Marten Kenbeek wrote: > Hey all, > > I'm working on a proposal to extend the URL dispatcher. Here, I'd like to > provide a quick overview of the features I propose. > > I'd like to: > - Allow matching based on request attributes such as the subdomain or > protocol, and b

Re: Django Admin new look

2015-03-04 Thread Curtis Maloney
Looks pretty slick, but brings with it all the hassles of the past attempts to re-skin admin: it breaks legacy custom pages. I wish we could standardise a theming layer for admin... allow legacy templates, or switching to new, clean, themable templates... Perhaps this could be integrated with the

Re: Composite fields

2015-03-04 Thread Curtis Maloney
Have you reviewed all the existing works on trying to add composite fields? I know several managed to reach a level of maturity that was almost merge quality, and am sure I heard some of the recent ORM changes would ease support. On 5 March 2015 at 11:42, Thomas Stephenson wrote: > OK, no need

Re: GSoC 2015: Template engine optimisation

2015-03-12 Thread Curtis Maloney
I have convinced my self [with absolutely no hard evidence, just familiarity with the code] that the template engine is overly cautious when it comes to ensuring values are strings and are escaped properly. After a while I believe layers and layers of caution have accrued, and nobody is sure any m

Re: About Class Based views

2015-03-17 Thread Curtis Maloney
I found when taking the CBGV session in MelbDjango School, it was best to approach teaching CBV as an exercise in Interfaces. Once the students were familiar with writing basic views, and the patterns therein, much of CBGV became "obvious", and the lesson focused more on the power of interfaces.

Re: About Class Based views

2015-03-17 Thread Curtis Maloney
help many people more readily grasp how all the pieces fit together, and where to hook in to get the results they want. -- C On 18 March 2015 at 10:19, Russell Keith-Magee wrote: > > On Wed, Mar 18, 2015 at 5:38 AM, Curtis Maloney < > cur...@acommoncreative.com> wrote: > >

Re: Composite fields

2015-03-18 Thread Curtis Maloney
Dev discussions typically happen on #django-dev on the Freenode IRC network. -- C On 18 March 2015 at 19:54, Thomas Stephenson wrote: > IRC discussion sounds fine with me, but I'd like to be involved. What's > the channel? > > Thomas > > On 18 March 2015 at 15:47, Asif Saifuddin wrote: > >> b

Re: URL matching problem

2015-03-23 Thread Curtis Maloney
Firstly, this is really a question for django-users ... this mailing list is for discussion of the development _of_ Django, not _with_ Django. On 24 March 2015 at 13:16, Ma Yuping wrote: > django V1.6.8 > > Let URL be: > > url(r'^blog/(?P\d+)/$', views.index, name='index'), > > url(r'^blog/(?P\d

Re: GSOC: Turn contrib.admin into a customizable management interface

2015-03-24 Thread Curtis Maloney
Let's not get bogged down in minutiae just yet :) How to implement a grid and what level of browser support is something that can be threshed out in the process. I love the idea of a Dashboard with custom Widgets. Allowing the existing "App list" widgets, along with new custom non-model widgets

Re: Using AbstractBaseUser without django.contrib.auth

2015-04-01 Thread Curtis Maloney
Does your model inherit from PermissionsMixin? If you're using Admin, or any of Django's permissions machinery, you will need django.contrib.auth in there to use the Group and Permission models. -- Curtis On 2 April 2015 at 13:47, Dan Watson wrote: > While trying out Django 1.8 with one of my

Re: Wsgi Traceback on Django 1.8

2015-04-08 Thread Curtis Maloney
At a guess, one of your views is returning a string instead of a HttpResponse object. This is the wrong forum for this question. This list is for discussing the development _of_ django, not _with_ django. Your question belongs in django-users. On 9 April 2015 at 14:56, wrote: > > Error on Dja

Re: Unneeded index created with unique=True and db_index=False in TextField

2015-04-14 Thread Curtis Maloney
Was the OP referring to the unique index, or the index created for the LIKE lookups? I was involved in a discussion recently [was there something on list too?] wanting to be able to opt-out of the second index because they knew they didn't need it, and it was _huge_ on their database. -- C On 1

Re: Improving Test Speed for Projects that use django.contrib.postgres

2015-05-04 Thread Curtis Maloney
I looked into using UNLOGGED some time ago, but the create table method was misnamed, and the actual create table function was inflexible. Now the code is much cleaner, and each DB can specify how to enact create table and friends. Which leaves us with the question -- is it possible to alter the

Re: templates: override inner nested block

2015-05-24 Thread Curtis Maloney
Could you provide a solid, minimal example of how you get this case? I have seen duplicate rendering of nested blocks happen in the past, and it was because in the resulting template, two blocks wind up with the child defined in them [this actually lead to me writing a {% reuse %} tag to take adv

Re: Why can't templates access properties

2015-05-26 Thread Curtis Maloney
Feel free to open a ticket, as it will give a place to retain the discussion. Perhaps start with the use case for having additional properties on a QuerySet :) -- Curtis On 27 May 2015 at 07:14, Ram Rachum wrote: > I found the cause of my problem: `django.db.models.Manager.from_queryset` > cop

Re: Feature: Support Server-Sent Events

2015-05-31 Thread Curtis Maloney
I think the real questions are: 1. What is stopping a 3rd party product from providing the features you want? If there is something Django can do to make it easier, point it out, and I'll gladly champion a good feature. 2. Why should your solution be the "blessed" solution? The discussion clear

Re: Using `SECRET_KEY` in password hashers

2015-06-08 Thread Curtis Maloney
I think it'd royally screw you over if you ever had to change your secret key [due to suspected leak, for example] as now all your passwords are invalid. -- Curtis On 9 June 2015 at 15:16, Ram Rachum wrote: > Hi, > > What do you think about using the project's `SECRET_KEY` as an additional > s

Re: Using `SECRET_KEY` in password hashers

2015-06-08 Thread Curtis Maloney
the current > implementation. So isn't this an improvement? > > On Tue, Jun 9, 2015 at 8:55 AM, Shai Berger wrote: > >> On Tuesday 09 June 2015 08:23:03 Ram Rachum wrote: >> > On Tue, Jun 9, 2015 at 8:22 AM, Curtis Maloney < >> cur...@acommoncreative.com>

Re: Feature: Template Components

2015-06-09 Thread Curtis Maloney
This sounds a bit like combining django-sniplates with django-amn, and going a bit further... Fragments of templates, list of JS/CSS dependencies, and a way to collect it all together and ensure your page has everything you need... Sounds interesting to me... I'd be happy to collaborate on it wi

Re: Django urls and Angular ui-router

2015-07-01 Thread Curtis Maloney
This question really belongs on django-users ... this list is for discussion about the development _of_ Django, not _with_ django. That said, it's quite specific in Django that URLs do not map to Templates - they map to View functions. So, depending on your case you should easily be able to have

Re: Allauth user fields and userProfile fields save in one registrationform

2015-07-08 Thread Curtis Maloney
This is a list for discussion of the development _of_ Django, not development _with_ Django. This question is better suited to the django-users list. In general, if you need to edit two models in one form submission, you use two ModelForms... I have a blog post on this topic: http://musings.tinbr

Re: Support for UNLOGGED tables in PostgreSQL

2015-07-12 Thread Curtis Maloney
>From http://www.postgresql.org/docs/9.4/static/sql-createtable.html UNLOGGED If specified, the table is created as an unlogged table. Data written to unlogged tables is not written to the write-ahead log (see Chapter 29), which makes them considerably faster than ordinary tables. However

Re: Proposal: deprecate and remove egg template loader

2015-07-13 Thread Curtis Maloney
so _that's_ why I've been adding zip_safe=False to all my setups for years :P +1 to encouraging the world to move forward :) -- Curtis On 14 July 2015 at 10:40, Russell Keith-Magee wrote: > > On Mon, Jul 13, 2015 at 11:00 PM, Donald Stufft wrote: >> >> I’m fine with this, but just be warne

Re: Support for UNLOGGED tables in PostgreSQL

2015-07-15 Thread Curtis Maloney
On 16 July 2015 at 05:01, Shai Berger wrote: > This is a shot in the dark: Could it be that rolling back transactions > involving unlogged tables is harder? The idea does make sense, and running the > test suite does an extremely untypical amount of rollbacks. I thought at some point I read that

Re: Support for UNLOGGED tables in PostgreSQL

2015-07-19 Thread Curtis Maloney
I second what Aymeric say rather than take on the burden of maintaining correct warnings, let's point at the people whose responsibility it really is :) -- Curtis On 20 July 2015 at 06:44, Aymeric Augustin wrote: > I agree with pointing to the relevant section of the PostgreSQL > documentat

Re: Speedy Mail 2.0 - a new webmail platform in Python and Django

2015-07-21 Thread Curtis Maloney
Guess I should sign up on django-users so I can throw my hat in for this... I've yearned for a Python-based webmail that has a featureful UI :) So far there's only Modoboa, excellent as it is. Competition is healthy, so... -- Curtis On 22 July 2015 at 05:20, Shai Berger wrote: > Hi Uri, > > O

Re: Ticket #25236: Remove ifequal from the template language

2015-08-06 Thread Curtis Maloney
Let me open by saying I am in no way averse to the removal of these two tags... and this reminds me I need to also re-work my "remove the 'x as y' argument syntax" patch again... On 7 August 2015 at 07:08, Marc Tamlyn wrote: > However, as with all technical debt, it has a cost. It's additional co

Re: #25227 Add utility method `get_updated_model()` to `ModelForm`

2015-08-06 Thread Curtis Maloney
Just my $0.02... I quite like the idea of adding update_instance and commit, with save calling both... To me, this provides a clean and obvious place to customise updating the instance before saving... as well as a clear place to get an updated instance without saving. -- Curtis On 7 August 20

Re: Ticket #25236: Remove ifequal from the template language

2015-08-06 Thread Curtis Maloney
Given the [currently] low burden, I agree with a more gradual deprecation... document against their use to help encourage people to move away from them, then we're in a better position to more painlessly remove them in the future. -- Curtis On 7 August 2015 at 11:43, Karen Tracey wrote: > Believ

Re: Ticket #25236: Remove ifequal from the template language

2015-08-06 Thread Curtis Maloney
I'd probably go with updating the documentation to say they're legacy tags, you're better off using {% if %} now, and warn they may be removed in a later release. This way (a) people are warned off it, and (b) we're confusing people who find it and want to check what it does [even though it's quit

Deprecating old keyword syntax in DTL

2015-08-08 Thread Curtis Maloney
Long ago, the keyword syntax in Django templates was: expr as name but was changed to look more like Python as: name=expr However, the facility to parse the old syntax is still there, but will silently fail unless you pass "support_legacy" to token_kwargs. In fact, it is enabled for "wi

Re: Deprecating old keyword syntax in DTL

2015-08-08 Thread Curtis Maloney
For reference, the old PR is here : https://github.com/django/django/pull/1619/files Unfortunately, it doesn't rebase cleanly onto master... some very odd stuff shows up... but it wouldn't take much to regenerate this work. -- Curtis On Saturday, 8 August 2015 21:33:22 UTC+10, Curt

CSRF middleware conflicts with request.upload_handlers

2015-11-15 Thread Curtis Maloney
So I recently ran into the csrf/upload_handlers conflict as mentioned in the not https://docs.djangoproject.com/en/1.8/topics/http/file-uploads/#id1 I'd like to propose an additional option to solve this -- a decorator to mark a view as "ajax-only" ... so the CSRF middleware will _only_ check

Re: CSRF middleware conflicts with request.upload_handlers

2015-11-19 Thread Curtis Maloney
:51:18 AM UTC-5, Curtis Maloney wrote: >> >> >> So I recently ran into the csrf/upload_handlers conflict as mentioned in >> the not >> https://docs.djangoproject.com/en/1.8/topics/http/file-uploads/#id1 >> >> I'd like to propose an additional option

Re: MOSS Award to Django

2015-12-15 Thread Curtis Maloney
On 16/12/15 12:05, Ben Liyanage wrote: And, beyond that, there are plenty of non-critical tasks that applications could easily offload until after a response has been sent - like saving things into a cache or thumbnailing newly-uploaded images. http://channels.readthedocs.org/en/

Re: Decoupling the ORM

2015-12-17 Thread Curtis Maloney
I've identified one new "issue". There is an implicit assumption that primary keys are useful for ordering by the current QuerySet API methods `.first()` and `.last()`. I believe the case here is that first and last are meaningless without an ordering, so in lieu of any programmer supplied orde

Re: A community Poll

2015-12-23 Thread Curtis Maloney
To clarify a few points: In general, I'm in favour of removing string references for things... however, when it comes to relation fields, I'm on the side of "alway lazy". Also, I don't want this discussion to be about my specific issue with contenttypes... more a general "community opinion of b

Re: delegating our static file serving

2016-01-01 Thread Curtis Maloney
On 01/01/16 15:49, Fabio Caritas Barrionuevo da Luz wrote: A question: are there any plans to also improve MEDIA files (user uploaded files) in any foreseeable future? Perhaps this is outside the scope of Django, but I believe Django could provide by default, any option to get a little more cont

Re: Adding a OneToMany Relationship to Django

2013-07-10 Thread Curtis Maloney
I've seen enough people in #django suffering because they need a FKey on a table they simply can't alter -- be it because it's in a 3rd party app, or simply a table their DBA won't permit them to alter, or what have you. In the end they wind up having to create the equivalent of a m2m through t

Re: Proposal: make Model __unicode__() default to self.name

2013-07-10 Thread Curtis Maloney
Luke beat me to it... We have a couple of abstract models which will fall through a small list of field names, trying to guess a useful default for __str__ ... but it makes me feel dirty every time I see it. Beyond "blessing" a particular (set of?) field names as default str names... this also ad

Re: Deprecate FCGI support in Django 1.7

2013-07-14 Thread Curtis Maloney
gt; WSGI library built that supports Django, we're just closing the door on this avenue... [I say this despite my personal loathing of HostGator... :)] -- Curtis Maloney On 15 July 2013 11:35, gilberto dos santos alves wrote: > i start 2 months ago using fcgi inside an shared hos

Re: Hybrid Property request

2013-07-17 Thread Curtis Maloney
On 17 July 2013 21:18, Jonathan Slenders wrote: > This is really nice. Both have their use cases, but I'm prefering the > second when possible, because it's much more flexible and preserves > database consistency. > With the same efford you can make the following work: > > ProductEntry.objects.fil

Re: Deprecate FCGI support in Django 1.7

2013-07-18 Thread Curtis Maloney
tainable. And by "help", it could just be as much as feature requests, documentation, or testing [always testing! :)] -- Curtis Maloney On 19 July 2013 08:53, Javier Guerra Giraldez wrote: > On Thu, Jul 18, 2013 at 5:30 PM, Juan Luis Boya wrote: > > uWSGI + FastCGI: We shoul

Re: Deprecate FCGI support in Django 1.7

2013-07-20 Thread Curtis Maloney
I'm more or less building atop flup as it is, however I plan to shed anything not related to FastCGI. For me it's a chance to get down and dirty with raw protocols again... I do agree there is a shorter path to just applying Django's "fixes" to a fork of flup. -- Curtis On 19 July 2013 22:14,

Re: Deprecate FCGI support in Django 1.7

2013-07-20 Thread Curtis Maloney
Juan, technically Django isn't a server at all... whether it's sync, async, multi-threaded, multi-process, or a mix of any of them is up to the wsgi publisher used. Take, for example, gunicorn, which can be any of the above, with options to plug in others when they're thought up. -- Curtis On

Re: Deprecate FCGI support in Django 1.7

2013-07-20 Thread Curtis Maloney
On 21 July 2013 02:30, Some Developer wrote: > On 20/07/2013 14:02, Curtis Maloney wrote: > >> I'm more or less building atop flup as it is, however I plan to shed >> anything not related to FastCGI. >> >> For me it's a chance to get down and dirty with ra

Re: Deprecate FCGI support in Django 1.7

2013-07-21 Thread Curtis Maloney
My understanding was Django is a WSGI application, and as such its role is to process requests handed to it. It isn't the server as such. It's the role of a WSGI publisher to accept requests and pass them on to an appropriate handler. So, uWSGI, gunicorn, flup and mod_wsgi as the Publishers we m

Re: Deprecate FCGI support in Django 1.7

2013-07-22 Thread Curtis Maloney
Well, having started looking over the flup source, I can see a lot of useful code to crib, as well as a few critical path bits that can be optimised [without even reducing readability!] So, if you feel like helping out with django-fastcgi ... I'm happy for the help :) -- Curtis On 23 July 2013

Re: Deprecate FCGI support in Django 1.7

2013-07-23 Thread Curtis Maloney
-fastcgi"? I think it > should most likely be a generic wsgi to fastcgi binding, right? Or is this > project mainly the django management commands? > On Jul 22, 2013 8:07 PM, "Curtis Maloney" > wrote: > >> Well, having started looking over the flup source, I can see a

Re: Streaming sitemaps

2013-07-25 Thread Curtis Maloney
inx/apache layer would also mitigate the problem. -- Curtis Maloney On 25 July 2013 23:51, Benjamin Wohlwend wrote: > Hi Julian, > > after having a site almost taken down by an over-eager spider downloading > the sitemaps dozens of times in parallel, I learned the lesson that large &

Re: Streaming sitemaps

2013-07-25 Thread Curtis Maloney
#x27;d got. The issues I've had with generator responses in the past is when there's an error in rendering, they tend to just stop. However, in the case of generating a stream of XML snippets, it's fairly reliable. -- Curtis > - Roger > > [1] https://code.djangopro

Re: Security Advisory: BREACH and Django

2013-08-07 Thread Curtis Maloney
an be retrieved by simply xoring it with the salt. The salt is changed every request. -- Curtis Maloney On 7 August 2013 16:56, simonb wrote: > How about requiring that if csrfmiddlewaretoken is set, no matter what > http method (GET, POST...), it is correct otherwise 403 response

Re: django.utils.functional.cached_property

2013-08-07 Thread Curtis Maloney
On 8 August 2013 09:31, Russell Keith-Magee wrote: > On Wed, Aug 7, 2013 at 8:10 PM, Daniele Procida wrote: > >> On Wed, Aug 7, 2013, Aymeric Augustin >> wrote: >> >> >The main drawback of the current implementation is that it's impossible >> to >> >clear the cached value. That should be mentio

Re: Usage and documentation of F()

2013-08-17 Thread Curtis Maloney
If, at the same time, perhaps ExpressionNode got a mention too, that could really open up some opportunities :) On 17 August 2013 21:17, Some Developer wrote: > On 14/08/13 10:05, Marc Tamlyn wrote: > >> (Disclaimer: I didn't write any of this code, I'm just working from my >> own possibly flaw

Re: Usage and documentation of F()

2013-08-19 Thread Curtis Maloney
;t. Now, how many other handy "SQL Standard" functions/expressions are there that people would love to use? -- Curtis On 20 August 2013 02:40, Andre Terra wrote: > > On Sat, Aug 17, 2013 at 10:22 PM, Curtis Maloney < > cur...@acommoncreative.com> wrote: > >>

More input on #20945

2013-08-21 Thread Curtis Maloney
Was just after some more eyes and opinions on https://code.djangoproject.com/ticket/20945 Current PR is at: https://github.com/django/django/pull/1490 This patch does two things: 1) it allows specifying on a {% cache %} tag which cache to use {% cache . using="cachename" %} 2) it makes the

Re: get_cache and multiple caches

2013-08-30 Thread Curtis Maloney
As a simple short-term solution, why not cache calls to get_cache that don't pass additional arguments? That is, ones that only get pre-configured caches. -- Curtis On 25 August 2013 23:26, Florian Apolloner wrote: > Hi, > > so when reviewing https://github.com/django/django/pull/1490/ I onc

Re: get_cache and multiple caches

2013-08-31 Thread Curtis Maloney
I've a possible solution - https://github.com/funkybob/django/compare/simple_caches Basically, the existing API and behaviours are still available through get_cache, but you can avoid duplicate instances of caches using django.core.cache.caches[name] -- Curtis On 31 August 2013 15:44, C

Re: Circular dependency in forms+views+models

2013-09-01 Thread Curtis Maloney
Given both the docs for get_absolute_url and reverse demonstrate using string references only, I think adding in clarification of why it's preferred is worthwhile. I still find it surprising how often I need to tell people on #django to not import models just to reference them in relation fields..

Re: get_cache and multiple caches

2013-09-01 Thread Curtis Maloney
; > > On Sunday, September 1, 2013 4:34:54 AM UTC+2, Curtis Maloney wrote: >> >> I've a possible solution - https://github.com/funkybob/** >> django/compare/simple_caches<https://github.com/funkybob/django/compare/simple_caches> >> >> Basically, the

Re: Support POST of application/json content type

2013-09-03 Thread Curtis Maloney
What do people think of an extensible registration approach to handling request content types? Something along the lines of ('POST', [list of content types], class to handle it) This would mean adding a request.JSON would be simple for the projects that want it, and even overriding how the existi

Re: Support POST of application/json content type

2013-09-03 Thread Curtis Maloney
Someone remind me never to post to list before I've had my second coffee? :) Of course the above would trivially be handled using middleware. -- C On 4 September 2013 10:05, Curtis Maloney wrote: > What do people think of an extensible registration approach to handling > request co

Re: Support POST of application/json content type

2013-09-04 Thread Curtis Maloney
To weight in from an author of a different API tool In django-nap there's a simple "get_request_data" method which, essentially, determines how to parse the request according to the content type. However, currently each API only supports a single serialiser format [and HTTP Form encoding] so

Re: Thinking about NoSQL support

2013-09-05 Thread Curtis Maloney
Well, there was the django-nonrel project, for trying to wrap non-relational stores [such as Mongo] in a faux relational layer, so they could then be wrapped in the ORM. Always felt like a tremendous waste of resources to me -- why use a non-relational store just to pretend it _is_ one? My view i

Re: Thinking about NoSQL support

2013-09-05 Thread Curtis Maloney
> > > > I wish people would stop abusing the term "NoSQL". Your target concept > is > > Non-Relational data stores, not SQL itself. There's a whole bunch of > > relational stores that don't use SQL, one of them is even called NoSQL!) > > > > to me, "Non-Relational data stores" still sounds as p

Re: Support POST of application/json content type

2013-09-09 Thread Curtis Maloney
On 9 September 2013 19:50, S Berder wrote: > Gents, > to sum it up, arguments made and details of how I see the > implementation of a response/request encode/decode framework: > > * need a pluggable interface so current content-types are supported > (`application/x-www-form-urlencoded`, `multipar

Re: Benchmarking 1.5 vs 1.6

2013-09-14 Thread Curtis Maloney
Hey, thanks for that! It would be nice to have something that would chart this over time... something like some people have set up for GCC. I've never been able to get djangobench to give meaningful results, otherwise I'd do it. Mmm... perhaps I've just found a use for my odroid :) -- Curtis

Re: Idea about authentication

2013-09-15 Thread Curtis Maloney
Actually, you'd just speed up their attack, since most failed attempts would be quicker than others. If you look in the crypto utils, you'll see a "constant time compare" ... this is a common thing in crypto circles to avoid leaking "how close" the guess was by how quickly the mismatch was found.

Re: Benchmarking 1.5 vs 1.6

2013-09-15 Thread Curtis Maloney
Kääriäinen wrote: > On Sunday, September 15, 2013 3:13:09 AM UTC+3, Curtis Maloney wrote: >> >> Hey, thanks for that! >> >> It would be nice to have something that would chart this over time... >> something like some people have set up for GCC. >> >&g

Re: get_cache and multiple caches

2013-09-18 Thread Curtis Maloney
red caches, and retain get_cache for the old, ad-hoc, non-shared caches. -- Curtis On 7 September 2013 22:32, Florian Apolloner wrote: > Hi, > > > On Monday, September 2, 2013 6:39:09 AM UTC+2, Curtis Maloney wrote: >> >> Whilst it's conceivable some cache backend will

Re: Is "transaction.atomic" in 1.6 supposed to work this way?

2013-09-19 Thread Curtis Maloney
I feel compelled to comment here... On 20 September 2013 09:32, Richard Ward wrote: > > I don't think that what I was trying to do (continue using a transaction > after an insert failed) was too outlandish. I'm not demanding that Django > should allow me to do it (tho that would be nice), but I

Re: get_cache and multiple caches

2013-09-19 Thread Curtis Maloney
On 19 September 2013 01:33, Florian Apolloner wrote: > Hi, > > > On Wednesday, September 18, 2013 1:29:25 PM UTC+2, Curtis Maloney wrote: >> >> 1) Can we share "ad-hoc" caches -- that is, ones created by passing more >> than just the CACHES alias. >>

  1   2   3   >