Re: Static Code analysis and Security Scanning tools for Django Web Applications

2022-07-13 Thread Paul Tiplady
I also use safety to scan for package vulnerabilities in the pipeline. This is similar to a repo-scanning app like Dependabot or Snyk. Prospector is decent, although I found it preferable to use pre-commit to wire up individual tools

Using activate() to set the timezone in Model Admin

2022-07-13 Thread Paul Tiplady
I'd like to have my Admin site use a different default timezone than the rest of my django app. I prefer the backend and API to operate in UTC, because this is a general good practice for geographically distributed teams. However admin users (based in a specific timezone) find this confusing,

Re: Where are you deploying Django App? How much does it cost for a hobby project

2021-10-04 Thread Paul Tiplady
You can deploy to Heroku, there's a free tier and it's very low maintenance. https://devcenter.heroku.com/articles/deploying-python I've had a free Django app running there that I set up almost 10 years ago without any work required to keep it up since then. Heroku is somewhat expensive if you

Handling multiple timezones in Django Admin

2018-10-02 Thread Paul Tiplady
Timezone handling in the Django admin is quite confusing when there are users in multiple timezones -- does anyone have a good way of handling this? I'm using USE_TZ=True, TIME_ZONE='UTC', USE_I18N, USE_L10N. I have admin users in US/Pacific and US/Eastern. When viewing a datetime field, users

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Paul Tiplady
:57 PM, Mike Dewhirst <mi...@dewhirst.com.au> wrote: > On 3/02/2018 5:23 AM, Paul Tiplady wrote: > >> Currently it's simple to configure a filter on a foreign key in the admin: >> >> `list_filter = ['theforeignkeyfield']` >> >> However in practice thi

Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Paul Tiplady
That's a pretty inflexible solution though; what if I want to filter on multiple foreign keys, e.g. Tenant=Foo(id=1), Customer=Bar(id=200)? On Fri, Feb 2, 2018 at 12:57 PM, Andy wrote: > You should rather use search_fields instead of filtering together with the > sorting

Re: Newbie - Microservice in Django - Best place to start learning

2018-02-02 Thread Paul Tiplady
Assuming you're trying to build a REST API and not a HTML website, you should look at http://www.django-rest-framework.org/ as it provides a lot of djangonic convenience methods for building REST APIs with the Django ORM. On Thursday, February 1, 2018 at 9:16:47 AM UTC-8, pratibha sharma wrote:

In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Paul Tiplady
Currently it's simple to configure a filter on a foreign key in the admin: `list_filter = ['theforeignkeyfield']` However in practice this is barely usable in most cases that I've encountered, since the admin uses RelatedFieldListFilter, which fetches the full list of objects from the DB and

Re: Automatic reverse migrations

2017-04-18 Thread Paul Tiplady
I think it's possible to do better than the current status quo with a bit more metadata, and without changing the current flow for users that don't want/need more -- essentially all I'm looking for is a way to record which migrations were applied in a given run of `./manage.py migrate`, so that I