Re: New Password Validators

2018-08-31 Thread Dan Davis
Mehmet, If you need such complexity validators, then they are easy to add as package. I think the reason why Django doesn't include more is that many use Oauth2 or other corporate authentication to validate. You can see how this is done in one case by looking at

rlwrap and manage.py dbshell

2018-06-28 Thread Dan Davis
After some work, I've modified django.db.backends.oracle.client in my virtual environment so that it will invoke Oracle's sqlplus within the excellent utility rlwrap. In my shell, I have * alias sqlplus='rlwrap --histsize 2000 sqlplus' However, it is not secure for a project like Django to

Re: rlwrap and manage.py dbshell

2018-06-28 Thread Dan Davis
est trying it in the third party backend first. Also the history > size probably doesn't need an easy way to specify, you could just give it > sensible default on a class level attribute on the DatabaseClient class so > if it *really* needs specifying, projects can subclass their own back

Re: Widening participation (Thoughts from DjangoCon)

2018-10-26 Thread Dan Davis
Thanks. Although I don't solve the demographic problem, I should respond to the call for broader participation. I should make myself put aside time to contribute - and I should force my boss to let me ;) On Fri, Oct 26, 2018 at 9:44 AM Carlton Gibson wrote: > Hi All. > > OK, so last week I

Re: Widening participation (Thoughts from DjangoCon)

2018-10-28 Thread Dan Davis
Trac can be made easier to search with Apache Solr - https://www.pycon.it/conference/talks/full-text-search-for-trac-with-apache-solr On Sunday, October 28, 2018 at 6:04:12 PM UTC-4, Josh Smeaton wrote: > > I strongly dislike Trac in nearly every way. It's hard to search and the > filters are

Re: Ticket/Issue Tracker

2018-10-27 Thread Dan Davis
Collin, Are you using an inverted index (search engine) behind that for relevance ranking, better word segmentation/stemming/synonyms, and peirformance? I think that something like that is really needed when the problem is finding stuff. On Friday, October 26, 2018 at 9:50:43 PM UTC-4, Collin

Re: Introspection of querysets

2018-11-03 Thread Dan Davis
ease. > > See code in/around > > https://github.com/adamchainz/django-mysql/blob/master/django_mysql/models/query.py > > On Sat, 3 Nov 2018 at 22:22, Dan Davis > > wrote: > >> I was thinking of providing a package containing a couple of DRF >> renderers that

Re: Requiring sqlparse for sqlite introspection

2018-11-03 Thread Dan Davis
I just joined as a contributor, but I've shipped an appliance install running using rpms, anaconda (the other one), and pungi. Depending on sqlparse doesn't seem to me a big deal. It already gets invoked for me during migrations. I cannot recall what caused it to be installed. One thing we

Re: Introspection of querysets

2018-11-03 Thread Dan Davis
not a public interface. On Friday, November 2, 2018 at 1:34:07 PM UTC-4, Tim Graham wrote:. > Could you explain the use case for the code that needs to handle the > different types of iterators? list > > On Friday, November 2, 2018 at 11:18:34 AM UTC-4, Dan Davis wrote: >> &g

backend specific tests

2018-11-03 Thread Dan Davis
So, the contributor guidelines page about unit tests mentions running database specific tests: https://docs.djangoproject.com/en/2.1/internals/contributing/writing-code/unit-tests/#testing-other-python-versions-and-database-backends I am working on ticket 29984, and it seems to me that since

Introspection of querysets

2018-11-02 Thread Dan Davis
I'm wondering two things: - Is there any non-internals way to know what sort of iterable a queryset is set to do? Should there be? Background - users should not write code to look at isinstance(queryset._iterable_class, FubarIterator) because that is a private interface (and it

Re: backend specific tests

2018-11-06 Thread Dan Davis
ast > non-critical > PostgreSQL cluster anyway I don't think requiring superuser privileges is > an > issue. > > Simon > > Le mardi 6 novembre 2018 18:43:47 UTC-5, Dan Davis a écrit : >> >> So, a developer using PostgreSQL doesn't need superuser privileges, but

Re: CharField with Oracle Backend Null Behaviour

2018-11-08 Thread Dan Davis
Part of the reason to use Django is to assure some level of database portability. I use Oracle exclusively at work, although there are some plans to move towards PostgreSQL. I think blank=True should govern whether the field may be null or not. So, from my perspective, we should limit ourselves

Re: Pluggable secret key backend

2018-11-10 Thread Dan Davis
Maybe a LoFi way to accomplish this is just to make sure that the SECRET_KEY is cast to bytes() before use. That way, a non-bytes object placed there during settings will be asked to convert it to bytes before use. I use the same trick with an internal module that retrieves database passwords

django.utils.timezone.make_aware confusion

2018-11-05 Thread Dan Davis
Working on ticket #29984, I noticed that the following raises: from datetime import datetime import pytz from django.utils.timezone import make_aware euberlin = pytz.timezone('Europe/Berlin')s a dt1 = datetime(2018, 10, 24, tzinfo=euberlin) dt2 = make_aware(datetime(2018, 10, 24)) assert dt1 ==

Re: backend specific tests

2018-11-06 Thread Dan Davis
nsions the test suite uses, but > https://docs.djangoproject.com/en/2.1/ref/contrib/postgres/operations/ > would be close to a full set I'd imagine. > > On Sunday, 4 November 2018 14:43:23 UTC+11, Dan Davis wrote: >> >> So, the contributor guidelines page about unit tests mentions

Re: backend specific tests

2018-11-07 Thread Dan Davis
ocalhost:5432 > > Mysql can be done in the same way: > > docker run -p 3306:3306 -e MYSQL_PASSWORD=django mysql:5.7 > > Hope this helps, > > Tom > > > > > On 7 November 2018 at 03:51:47, Dan Davis (dansm...@gmail.com) wrote: > > What about mysql? I have 5.7 in

Re: A faster paginator for django

2018-12-23 Thread Dan Davis
To be honest, I just entered it as a word, and the client made it a URL because it ends with a top-level domain, and looks like a domain name. On Sun, Dec 23, 2018 at 7:15 PM Dan Davis wrote: > Yes, https://datatables.net/, often miscalled jquery datatables, it is > more like php data

Re: A faster paginator for django

2018-12-23 Thread Dan Davis
Also, it can be worse than one count query. When interacting with datables.net serverSide, you will need multiple count queries. On Sat, Dec 15, 2018, 10:32 AM Kye Russell It might also be worth looking at the alternative pagination methods > offered by Django REST Framework as a source of

Re: A faster paginator for django

2018-12-23 Thread Dan Davis
Yes, https://datatables.net/, often miscalled jquery datatables, it is more like php datatables in its CGI parameters ;) On Sun, Dec 23, 2018 at 2:51 PM Adam Johnson wrote: > (I think you meant https://datatables.net/ ? ) :) > > On Sun, 23 Dec 2018 at 19:25, Dan Davis wrote: > >

Re: Widening participation (Thoughts from DjangoCon)

2018-12-10 Thread Dan Davis
> I strongly dislike Trac in nearly every way. It's hard to search and the filters are next to useless, and the categorisation features we use are not very useful. > I believe the better way to search Trac is to use google and site: code.djangoproject.com which is a red flag itself. Is there a

Re: Widening participation (Thoughts from DjangoCon)

2018-12-10 Thread Dan Davis
nly relevant results, and only the most relevant results. The limits on word segmentation provided by RDBMS-backed full-text search often makes both recall and precision worse. On Mon, Dec 10, 2018 at 11:14 AM Dan Davis wrote: > > I strongly dislike Trac in nearly every way. It's hard t

Re: Widening participation (Thoughts from DjangoCon)

2018-12-10 Thread Dan Davis
And there might be no need to develop code for this, only configuration: https://github.com/dnephin/TracAdvancedSearchPlugin On Mon, Dec 10, 2018 at 11:22 AM Dan Davis wrote: > I think that TracSearch could use improvement. As an expert in > Information Retrieval, I would be happy t

Re: Removing Oracle from Django core in 3.0

2018-11-25 Thread Dan Davis
My employer is an Oracle shop. I would dedicate myself to Oracle specific bugs to prevent removing Oracle from core. That said, we'll probably be off Oracle and onto the cloud and Postgresql by 3.0. On Sun, Nov 25, 2018 at 1:36 PM Adam Johnson wrote: > Interestingly, I didn't receive your

Re: Removing Oracle from Django core in 3.0

2018-11-26 Thread Dan Davis
Another related question - https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#testing-other-python-versions-and-database-backends provides some terse advice for running the unit tests with different backends. Is that essentially what is happening with a

Re: Moving database backends out of the core

2018-11-26 Thread Dan Davis
I think this would only work if most database specific backends were maintained by the djangoproject itself, allowing for integration tests that test compatibility. To my mind, a strong ORM to backend API is a great thing, but we also need stronger backend integration tests. -- You received

Re: Removing Oracle from Django core in 3.0

2018-11-26 Thread Dan Davis
Related question - how would I search for Oracle specific issues. I found this query: https://code.djangoproject.com/query?status=assigned=new=~oracle=Database+layer+(models%2C+ORM)=id=summary=status=component=owner=type=version=1=id However, I'm not sure how much I can rely on the keywords.

Re: Proposal: Track used headers and use that information to automatically populate Vary header.

2019-01-25 Thread Dan Davis
On Fri, Jan 25, 2019 at 8:27 PM James Bennett wrote: > My immediate thought here is: if people already aren't taking the time to > patch using the existing mechanism, they also aren't going to take the time > to opt out of patching. So what you're proposing is effectively still "any > accessed

Test database, --keepdb parameter, and migrations

2019-02-25 Thread Dan Davis
There are a cluster of issues that I find difficult to resolve as a user, and as a Django developer, I think there is potential to make them easier through features in Django itself. I'm interested in hearing better work-arounds than I use now, but I'm more interested in helping clarify how

Re: Django 2.2 and the watchman reloader

2019-02-21 Thread Dan Davis
Claude, I've tested a Django based application on 2.2b1 without watchman on Windows, it does tell you about watchman, but it doesn't fail to run. Apparently, it falls back to the old way of reloading. Is this not the behavior on Debian/Ubuntu? On Thu, Feb 21, 2019 at 12:28 PM Claude Paroz

Re: Will Django ever CompositePrimaryKeys?

2019-02-26 Thread Dan Davis
ur own. Look over the previous attempts and DEPs, and then document your > way forward either by editing the DEP, and by initiating a thread on this > list. > > Cheers > > On Wednesday, 20 February 2019 04:29:41 UTC+11, Dan Davis wrote: >> >> James, >> >> As a Djang

Re: Extend FAQ with "How do I get Django and my JS framework to work together?"

2019-02-06 Thread Dan Davis
The problem with ModelForm is translating validation to something front-end, like jquery Validator. Here, DRF does better, because swagger spec includes something like jsonschema (neither are a standard as I used to know them, in the WSDL/SOAP days), and so you can use jsonschema validation to

Re: CharField with Oracle Backend Null Behaviour

2019-02-13 Thread Dan Davis
This very issue of a not-null constraint causes a problem with django-silk. I'm not sure this matters in practice, because the usage of django silk is usually for development; I just added an sqlite3 database alias and a router for django-silk. However, it validates the problem of the

Re: Will Django ever CompositePrimaryKeys?

2019-02-19 Thread Dan Davis
James, As a Django user I've had this problem often. My best practice ways to handle this is as follows: - If the table is read-only, then create a database-level view that manufactures a primary key by concatenating the primary key columns together. Lie to Django and say this

Re: Add an defer=True option for model fields

2019-02-19 Thread Dan Davis
Tue, Feb 19, 2019 at 12:43 PM Dan Davis wrote: > I have a developer who stores the binary copy of a file in his table. In > ColdFusion, this was acceptable, because he was writing every query by > hand, and could simply exclude that field. However, with the Django ORM it > is a b

Add an defer=True option for model fields

2019-02-19 Thread Dan Davis
I have a developer who stores the binary copy of a file in his table. In ColdFusion, this was acceptable, because he was writing every query by hand, and could simply exclude that field. However, with the Django ORM it is a bit of a problem. The primary table he uses is just for the file,

Re: Adding a database-agnostic JSONField into Django

2019-02-19 Thread Dan Davis
I'm for this. My only advice is that only some versions of Oracle have a native JSON type. The oracle backend should probably use some query to determine whether the Oracle instance supports JSON field, or there could be a flag in OPTIONS about tihs. On Tuesday, February 19, 2019 at 7:44:40

Re: revisiting the Python version support policy

2019-01-25 Thread Dan Davis
My employer is still using CPython 3.4.6 on the servers, and CPython 3.5.1 on the desktop. I've been instrumental in developing a plan to move forward. I know of one established company and one start-up, by name, where they are still using CPython 2.7 (and a horrendously old version of Django),

Re: Begninner

2019-01-24 Thread Dan Davis
George, If you are an experienced programmer in some other language, I recommend Fluent Python. It is not a good book for someone new to programming. On Thu, Jan 24, 2019 at 7:19 AM george ngugi wrote: > hey, > > Am new in python programming, can kindly can someone help me on which is > the

Re: Extend FAQ with "How do I get Django and my JS framework to work together?"

2019-02-04 Thread Dan Davis
I kind of disagree that saying it works with DRF is enough. One issue that needs to be addressed is matching any possible path with re_path, so that an SPA that takes over the browser history API will work with bookmarks. Django is opinionated. The winning strategy for npm frameworks is to let

Re: Proposal: Track used headers and use that information to automatically populate Vary header.

2019-01-25 Thread Dan Davis
I would like this - Django is a framework with batteries, and my development group tells me "Django is too hard". This is because they don't understand HTTP; mostly they understand HTML/CSS and SQL, with maybe some easy jquery level of SQL. So, this kind of solution would fit well for my

Re: 2020 Authentication Initiativ

2019-04-11 Thread Dan Davis
Focus is the biggest thing - with so many other packages such as python-social-auth and django-cas-ng and django-warrant providing some sort of Federated Login, I don't think it makes sense to try to incorporate social login. However, it would be nice if out of the box could do a register, verify

Re: Should django.contrib.auth.authenticate check is_active?

2019-04-11 Thread Dan Davis
So, federated login systems such as often handle only user identity authentication, which is what the AuthBackend does. Sometimes, users can self-register, and systems such as django-cas-ng (for CAS, not Oauth2). Oauth2, although actually granting authorization to the identity provider's platform

Re: Proposal to format Django using black

2019-04-16 Thread Dan Davis
+1 isort -1 black I think that codestyle checkers are better, because you teach yourself proper style for python. On Tue, Apr 16, 2019 at 8:17 PM Josh Smeaton wrote: > We aren't talking about code minifiers though, are we? We're talking about > a very specific tool with very specific rules. No

Re: Support for unittest -k option

2019-03-11 Thread Dan Davis
I personally don't think a short-hand is needed. On Mon, Mar 11, 2019 at 10:41 AM Tim Graham wrote: > -kdb could be a suitable short option. > > On Monday, March 11, 2019 at 9:20:37 AM UTC-4, Tobias McNulty wrote: >> >> Agreed it's probably better to make the switch now, and I'd be fine >>

New external package - is there any duplication

2019-05-17 Thread Dan Davis
I am planning an external package to assist my developers in getting their special-purpose DDL out of the database and into git. Some teams can handle it, but some teams could use help making sure that they use operations.RunSQL well and wisely. My biggest questions about what I'm doing

Re: [Feature Request][Model, ORM] Disabling a field before removal to support continuous delivery

2019-06-24 Thread Dan Davis
I'd agree that it is a definite use case. In the dev-ops world, it is evidently called a "blue torquoise green deployment". It could be done as long as the code is not adding a table/field/etc. My discussion on django-users, https://groups.google.com/forum/#!topic/django-users/QCmy9reH8cI,

Re: [Feature Request][Model, ORM] Disabling a field before removal to support continuous delivery

2019-06-24 Thread Dan Davis
ove to hear what more experienced hands have to say about it. On Mon, Jun 24, 2019 at 11:28 PM Ryan Hiebert wrote: > > > On Mon, Jun 24, 2019, 21:29 Dan Davis wrote: > >> >> Some questions: >> >>- How does the "safe" field of migrations work wit

Re: Faster Migrations! But at what cost?

2019-05-21 Thread Dan Davis
Migrations are very slow, so I don't run them during test runs, and run tests with --keepdb even in CI/CD. This is required for my environment anyway, because we use Oracle heavily, a "schema" is the same thing as a "user", and is what I used to think of as a "database" coming from MySQL and

Re: New external package - is there any duplication

2019-05-21 Thread Dan Davis
proach a couple times for things like > stored procedures, though I'd prefer to use vanilla RunSQL in a migration > myself. At least one can avoid yet another easily forgotten management > command. > > Thanks, > > Adam > > > > On Fri, 17 May 2019 at 19:08, Dan Davis w

Re: injecting settings

2019-05-07 Thread Dan Davis
Christian, I do this in my internal and private module that depends on django-cas-ng. django-cas-ng provides default settings in an __init__.py file that predates app.py and ready. My strategy is that if you wish to depend on another app in this way, it is best to shadow it entirely. For

Re: injecting settings

2019-05-08 Thread Dan Davis
> Another thing to possibly consider, what should happen if multiple > packages try to provide different defaults for the same setting? I > mean, of course, this has kind of been floated in this thread already, > but it would add one more item to the list of things affected by the > order of

Re: Migrations in Django 1.7 make unit testing models harder

2019-09-14 Thread Dan Davis
There is no such flag, at least not in 1.11. I wrote my own "migratetest" and "cleandb" commands because my DBAs don't let me drop and recreate databases. It is a simple matter if you use the testsuite, but it would probably be better development to call create_test_db manually and such. On

Re: Google Patch Rewards program

2019-12-31 Thread Dan Davis
Taymon Beal writes: > First-class integration with one or more secrets management systems, both to generally contain secrets better and more specifically > so people aren't so tempted to check SECRET_KEYs and database passwords into source control. (I think this was mentioned in the list of GSoC

Re: Google Patch Rewards program

2019-12-31 Thread Dan Davis
private and limited to RDS PostgreSQL and AWS Secrets Manager. On Tue, Dec 31, 2019 at 11:25 AM Dan Davis wrote: > Taymon Beal writes: > > First-class integration with one or more secrets management systems, > both to generally contain secrets better and more specifically > > s

Re: Generate JWTs with Django

2020-05-11 Thread Dan Davis
The place where JWT begins to get useful and important is when federated login capabilities end-up in your app. That sort of thing seems more the domain of python-social-auth packages like social-auth-core and social-auth-app-django. Generating an authentication cookie doesn't require JWT -

Re: Proposal: django project name

2020-05-14 Thread Dan Davis
> > Wherever you place the template, users can already override it by creating > one in their project with the same name, in an app that appears first in > INSTALLED_APPS. There's a documentation page on this topic: > https://docs.djangoproject.com/en/3.0/howto/overriding-templates/ >

Re: Making startproject's settings more 12-factor-y

2020-06-24 Thread Dan Davis
tMost of the world is not as seamless as heroku. My DevOps won't give me any more than a handful of environment variables. I wanted something like DATABASE_URL, but all I have is DJANGO_LOG_DIR and DJANGO_SETTINGS_MODULE, and so I need many, many settings files. I think that happens a lot, and

Re: f-strings again.

2020-07-21 Thread Dan Davis
+1 iff flake8 can validate f-srings as well as PyCharm does f-strings! I think flake8 would mean that SublimeText and Atom can highlight errors. Background - Arguments based on readability are so subjective. If I am using Pycharm, f-strings are very readable, and it will check whether a keyword

Re: Improving MSSQL and Azure SQL support on Django

2020-11-27 Thread Dan Davis
I'd suggest someone talk with professional DBAs for MSSQL. In my work, which is Federal government, the DBA told me that disconnecting from PSQL as "appuser" and attempting to connect to database "postgres" in order to create the test database violated FISMA. I had to subclass my own postgresql

Re: GSOC Proposal: Adding Redis Cache Backend To Django Core.

2021-04-01 Thread Dan Davis
Since REDIS is already usable as a cache for Django using 3rd party code, I would rather see a circuit breaker pattern applied to the cache, across all backends. I'm not that active in maintaining Django right now, but a cache may not be fully redundant, and it also can fail. If the cache is

Re: GSOC Proposal: Adding Redis Cache Backend To Django Core.

2021-04-04 Thread Dan Davis
cache coherence can be a problem, but I am thinking more about what happens when the cache, which is supposed to make things faster, is not available due to error. Django ends up waiting for it. Each request waits for the cache, and this is a hard problem because there is no common shared place

Re: Revisiting MSSQL and Azure SQL Support in Django

2022-04-02 Thread Dan Davis
Warren, We all know support for an RDBMS matters a lot in enterprise corporate environments. I think having this support in the https://github.com/microsoft organization is probably better for MSSQL users. Coordinating support between a support organization, open source components, and Django is

Re: MFA (2FA)

2022-04-09 Thread Dan Davis
My intuition is that Webauthn will be hard to support because of the varieties of ways to secure the private key (Yubikey, HIDGlobal, etc.) and the complexities of managing key pairs without devices. PGP/GnuPG followed a trajectory where we had ways to secure email, but it was too complicated to

Re: Generated Field

2022-04-13 Thread Dan Davis
+1 On Wed, Apr 13, 2022 at 7:01 AM 'Adam Johnson' via Django developers (Contributions to Django itself) wrote: > I'd be interested in seeing this. Generated columns are a useful SQL > feature that are missing from Django. > > Nice initial research on backend coverage - it looks like they're