reusable App XOR custom user model?

2020-11-03 Thread guettli
Quoting the Docs : *> If you’re starting a new project, it’s highly recommended to set up a custom user model, even if the default User

Re: Recommended way for directory layout?

2020-10-26 Thread guettli
one -> https://cookiecutter-django.readthedocs.io/ > > This is pretty commonly used in many projects. > On 10/25/20 3:28 PM, guettli wrote: > > I want to maintain a very simple Django App at github. > > Is there an "officially" recommended way to structure the di

Recommended way for directory layout?

2020-10-25 Thread guettli
I want to maintain a very simple Django App at github. Is there an "officially" recommended way to structure the directory layout? There are several blog posts and article about this. Wouldn't it be nice if the django docs would contain a recommendation? Regards, Thomas -- You received this

Deployment to VM (full root access) with container or not?

2020-09-10 Thread guettli
I know this page: https://docs.djangoproject.com/en/3.1/howto/deployment/ And yes, I could help myself to get my django project running on a webserver. Nevertheless I would like to follow a common way instead of hacking it on my own. In the past I used this pattern: I created a linux user for e

Re: HTML Snippets instead of JSON-API

2020-08-28 Thread guettli
gt; for > Windows 10 > > > > *From: *guettli > *Sent: *28 August 2020 14:02 > *To: *Django users > *Subject: *HTML Snippets instead of JSON-API > > > > If you read the current articles about software development, > > you get the impression that you

HTML Snippets instead of JSON-API

2020-08-28 Thread guettli
If you read the current articles about software development, you get the impression that you must create a backend API returning JSON (maybe via Django RestFramework) and then create a GUI with React/Vue/Angular I am a backend geek. I like Python, Django, Linux, SQL, and try to avoid JavaScri

htmx: Has someone already tried this tiny JS library?

2020-08-27 Thread guettli
Today I found htmx a small JS library which helps you to make parts of the page easy to load/submit. I like it since, I would like to avoid the complicated http-API + React/Vue/... approach most people advertise these days. I am curious: Have you tried htmx yet, or how do you

Re: CSRF token still needed today?

2020-04-21 Thread guettli
Am Sonntag, 19. April 2020 23:11:59 UTC+2 schrieb Alex Heyden: > > Django supports samesite on session cookies now, and it's on (set to lax) > by default. Whether or not that completely covers your surface risk to CSRF > attacks is a somewhat different question. > > AFAIK they can not happen. B

Re: CSRF token still needed today?

2020-04-21 Thread guettli
add one specific command on all forms - > or you disable it in the view > > What do you want to accomplish by removing it? > > Regards, > > Andréas > > > Den sön 19 apr. 2020 kl 22:12 skrev guettli >: > >> iI look at this page: https://docs.djan

Re: CSRF token still needed today?

2020-04-21 Thread guettli
at 10:45 PM Andréas Kühne > wrote: > >> Why is it a problem to have? You add one specific command on all forms - >> or you disable it in the view >> >> What do you want to accomplish by removing it? >> >> Regards, >> >> Andréas >> >&

CSRF token still needed today?

2020-04-19 Thread guettli
iI look at this page: https://docs.djangoproject.com/en/3.0/ref/csrf/ ... and then I look at this page: https://scotthelme.co.uk/csrf-is-dead/ Is a CSRF token still needed today? All my users use a modern browser. It would be very nice if I could get rid of the CSRF token. Is there a safe way t

Re: Mobile friendly admin

2020-04-03 Thread guettli
that makes the interface mobile-friendly. It's part of Django > 2.0 and later. > > On Wednesday, April 1, 2020 at 4:02:57 AM UTC-4, guettli wrote: >> >> I know there a several third party packages which try to improve the >> great django admin: >> >&

Mobile friendly admin

2020-04-01 Thread guettli
I know there a several third party packages which try to improve the great django admin: See: https://djangopackages.org/grids/g/admin-interface/ A lot of packages are already outdated. AFAIK no sane and simple default package exists. I think the only solution to this would be an improvement w

Re: Class based views vs methods

2020-03-04 Thread guettli
. > > On Tue, Mar 3, 2020 at 12:59 AM guettli > wrote: > >> The django tutorial starts with method based views. >> >> What is the state of the art? >> >> If I am unsure: Do you suggest to use class-based or method-based views? >> >> Regards,

Re: Django Platform (not just Framework)

2020-03-03 Thread guettli
Arora: > > Hi, > > What plugins you would want to install ? if you are talking about pip > packages, you can use pycharm wrapper for the same. pycharm allows to > download pip packages using GUI. > > Cheers > Naveen Arora > > > On Monday, 2 March 2020 21:24:32 U

Re: Django Platform (not just Framework)

2020-03-03 Thread guettli
Am Dienstag, 3. März 2020 10:27:50 UTC+1 schrieb Naveen Arora: > > Hi, > > What plugins you would want to install ? if you are talking about pip > packages, you can use pycharm wrapper for the same. pycharm allows to > download pip packages using GUI. > > I am able to develop with python. I can

How to integrate QuillJS into Django?

2020-03-03 Thread guettli
I would like to integrate the WYSIWYG editor QuillJS into my application. First I was happy, since I found: https://github.com/muke5hy/django-quilljs But something does not work, and now I am unsure. The above github project is a fork. The project does not seem to be well maintained. Now I am

Class based views vs methods

2020-03-02 Thread guettli
The django tutorial starts with method based views. What is the state of the art? If I am unsure: Do you suggest to use class-based or method-based views? Regards, Thomas -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Django Platform (not just Framework)

2020-03-02 Thread guettli
I know the terms "Platform" and "Framework" are not well-defined. For me a platform allows you to install plugins without touching source code. For example, Nextcloud is a platform (for me). Is there already a third-party solution that provides a platform based on Django? This would be very v

WYSIWYG Editor with editable queryset (like Confluence)

2020-02-29 Thread guettli
Some days ago I worked with Confluence. This tool has a great feature: You can insert a paginated queryset in a page. Without coding, all WYSIWYG: Docs: https://confluence.atlassian.com/doc/page-properties-report-macro-186089616.html Is there a way to get this cool feature into django? Regard

How to call the Django-Admin style of providing much with less code

2019-12-19 Thread guettli
Just for the records, I asked at StackOverflow how to call this cool way of the django admin interface. It is a mixture of configuration and optionaly some coding sugar. See: https://stackoverflow.com/questions/59289596/how-to-call-the-django-admin-style-of-providing-much-with-less-code If som

Re: djangorestframework vs GraphQL

2019-11-14 Thread guettli
Thank you for the hint. Saleor looks very good. Am Mittwoch, 13. November 2019 11:35:17 UTC+1 schrieb DANIEL URBANO DE LA RUA: > > You have a good example on saleor eccomerce is on github > > On Wed, 13 Nov 2019, 09:15 guettli, > > wrote: > >> I never used GraphQL,

Re: djangorestframework vs GraphQL

2019-11-13 Thread guettli
ituations, I just haven't yet encountered a >> situation where it is. >> >> - Nick >> >> >> On Tue, Nov 12, 2019 at 9:14 AM guettli > >> wrote: >> >>> Hi, >>> >>> I am new to GraphQL, but I like the idea v

djangorestframework vs GraphQL

2019-11-12 Thread guettli
? Regards, Thomas Güttler PS: I am always looking for feedback for my guidelines: https://github.com/guettli/programming-guidelines -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Reading the timeout value for a django cache entry (for testing)

2019-11-11 Thread guettli
We had a bug in our production system. The timeout was set incorrectly. Now I want to write a test which checks, that the value of the timeout is correct. I look at the docs and don't see a way to **read** the timeout value of a particular cache-key: https://docs.djangoproject.com/en/2.2/topi

Re: OT: Exceptions in production. Local variables?

2019-08-16 Thread guettli
Am Donnerstag, 15. August 2019 10:36:10 UTC+2 schrieb mohammed habib: > > Definitely Sentry, they will show you the stack trace and a dump of local > variables for every crash, as well as other useful analytics > > It’s pretty easy to set up > > If your site is not so busy they have a free plan

OT: Exceptions in production. Local variables?

2019-08-15 Thread guettli
This is a bit off-topic. If I have an exception in the production environment, then up to now I only see the ascii stacktrace in the logs. Often this is enough to fix the issue, but sometimes I would like to see the local variables, too. Which tool could help here? How do you handle this? Re

Re: Which app for minio (s3) storage server?

2019-04-24 Thread guettli
just for the records. I took minio and it works fine since some weeks now the first weeks. Am Freitag, 22. März 2019 15:49:36 UTC+1 schrieb guettli: > > Up to now all my projects worked with the basic file storage. > > Now I want use a s3 like storage server for the first time. &g

Nameless FileField

2019-03-29 Thread guettli
I think the current FileField is nice for some use cases, but for other use cases it is too complicated. Example: class MyProfile(models.Model): picture = models.FileField() If profile of user "foo" uses "foo.jpg" as picture, and user "bar" uses "foo.jpg", too. Then the profile picture of "

Which app for minio (s3) storage server?

2019-03-22 Thread guettli
Up to now all my projects worked with the basic file storage. Now I want use a s3 like storage server for the first time. The server implementation will be minio (not aws) I see three apps: https://github.com/py-pa/django-minio-storage https://github.com/etianen/django-s3-storage https:

Re: Update of issue (Trac) rejected (SPAM ...)

2018-11-30 Thread guettli
s://docs.djangoproject.com/en/2.1/internals/contributing/bugs-and-features/#how-we-make-decisions > > Le jeudi 29 novembre 2018 11:01:56 UTC-5, guettli a écrit : >> >> How to get clear consensus? >> >> Am Mittwoch, 28. November 2018 15:31:24 UTC+1 schrieb Tim Grah

Re: Update of issue (Trac) rejected (SPAM ...)

2018-11-29 Thread guettli
gt; since there's not a clear consensus about how to proceed. > > On Wednesday, November 28, 2018 at 5:10:06 AM UTC-5, guettli wrote: >> >> I wanted to update this issue https://code.djangoproject.com/ticket/27936 >> >> it was not possible. Trac told me th

Update of issue (Trac) rejected (SPAM ...)

2018-11-28 Thread guettli
I wanted to update this issue https://code.djangoproject.com/ticket/27936 it was not possible. Trac told me this was Spam with this message: SpamBayes determined spam probability of 98.09% What can I do now? I wanted to add this text: {{{ I still think a visual help like the diagram I pain

Re: From old-school Post/Redirect/Get to modern web (2018)

2018-09-06 Thread guettli
Up to now your customers keep us busy with new ideas. We even hardly advertise our products :-) I was talking to a JS expert. He likes the react framework. Now there are four frameworks to evaluate ... Regards, Thomas Am Mittwoch, 5. September 2018 12:59:54 UTC+2 schrieb Jason: > > Yeah, I g

Re: From old-school Post/Redirect/Get to modern web (2018)

2018-09-05 Thread guettli
Hi Jason and other django users, thank you very much for your reply. I think this whole thing is more about feelings than about technical details. I love Python and my team mates like it. No one in my team loves JavaScript. We are lazy. We are doing Python and PostgreSQL since several years a

From old-school Post/Redirect/Get to modern web (2018)

2018-09-03 Thread guettli
I use Post/Redirect/Get since several years. I use simple HTML forms (via ModelForm) with a plain old submit-button. Above pattern works. But I think the web of the future works different. Up to now my web application sends html to the web clie

Re: Setting up a system for testing by users (tables are tables?)

2018-08-14 Thread guettli
Am Montag, 13. August 2018 18:12:03 UTC+2 schrieb Mikhailo Keda: > > 1. take a dump of production db > 2. remove/anonymize all sensitive or unneeded data (you can use django > admin or sql or python script) > 3. reduce amount of data if needed > 4. take a git branch with fixes > 5. make sure th

Re: Setting up a system for testing by users (tables are tables?)

2018-08-10 Thread guettli
I see: no reply. Why? Am Mittwoch, 18. Juli 2018 11:45:00 UTC+2 schrieb guettli: > > I have a task which looks simple at the first sight: > > Setting up a system for testing by users. > > In my case it is a custom issue tracking system. > > The users who should do

Setting up a system for testing by users (tables are tables?)

2018-07-18 Thread guettli
I have a task which looks simple at the first sight: Setting up a system for testing by users. In my case it is a custom issue tracking system. The users who should do the testing say "The new system should be like the production system." If this would be true, then dump+restore of the datab

Re: Crazy Idea: OOP for "Hyperlink"

2018-05-04 Thread guettli
d. > > -- > -- > Anthony Flury > email : *anthon...@btinternet.com * > Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>* > > On 30/04/18 08:24, guettli wrote: > > > > > > Am Donnerstag, 26. April 2018 15:54:31 UTC+2 schrieb Matthew Pava: > >

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-30 Thread guettli
Am Donnerstag, 26. April 2018 15:54:31 UTC+2 schrieb Matthew Pava: > > I’ve been thinking about your idea, and I wonder if there could instead be > some kind of widget for URL objects (or views). > > > A widget ... Let me think about it. A widget is a libray, is source code. The code needs so

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-26 Thread guettli
Am Mittwoch, 25. April 2018 17:29:36 UTC+2 schrieb Jani Tiainen: > > Hi. > > Most probably you get there by creating custom template tag and bunch of > other code. > > It would be easier to grasp your idea if you have some kind of an > implementation to reference. > > Or is there something that

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-26 Thread guettli
http://host/notification/aabbccddeeff > > It might be that we need to match multiple fields on a url - not > sure how we do this. > > I would happily contribute to an Django appropriate plugin etc - it > seems like there is a lot of commonality between the use cases

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-25 Thread guettli
ays. If someone likes this idea and implements it, please let me know. I am always curious. Regards, Thomas Am Montag, 23. April 2018 12:22:32 UTC+2 schrieb Adrien Cossa: > > Hi, > On 04/23/2018 10:59 AM, guettli wrote: > > I have a vague idea to use OOP for a hyperlink. > >

Crazy Idea: OOP for "Hyperlink"

2018-04-23 Thread guettli
I have a vague idea to use OOP for a hyperlink. A hyperlink has these attributes for me: - href - verbose name - Permission: Is the current user allowed to follow the link? - Preview (on-mouse-over tooltip) I like Django because it handles the "href" part very smart (via reverse()). My current

Re: Simple file uploading app

2018-01-10 Thread guettli
t;http://www.thregr.org/%7Ewavexx/software/dl/dl-wx.html> or straight from > the command line > <http://www.thregr.org/%7Ewavexx/software/dl/README.html#command-line-client-dl-cli> > for maximum convenience. > > > > > > > On 01/08/2018 04:16 AM, guettli wr

Re: Split API URLs to second project/settings/wsgi ?

2018-01-10 Thread guettli
, Thomas Güttler Am Donnerstag, 4. Januar 2018 16:54:38 UTC+1 schrieb guettli: > > > > Am Mittwoch, 3. Januar 2018 17:40:51 UTC+1 schrieb Jason: >> >> Sounds like this is a good use case to integrate DRF to solve multiple >> problems. >> >> >> > I

Re: Simple file uploading app

2018-01-08 Thread guettli
tober 2017 16:57:31 UTC+2 schrieb guettli: > > I need a simple file uploading app. > > Every user should be able to upload files to his own area. > > This is the basic feature. You could think of additional goodies, but the > first step is > above feature. > > I

Re: Split API URLs to second project/settings/wsgi ?

2018-01-04 Thread guettli
Am Mittwoch, 3. Januar 2018 17:40:51 UTC+1 schrieb Jason: > > Sounds like this is a good use case to integrate DRF to solve multiple > problems. > > > I am unsure. I would like to have auth solved by the framework. With framework I mean django. -- You received this message because you are sub

Re: Split API URLs to second project/settings/wsgi ?

2018-01-03 Thread guettli
Am Dienstag, 2. Januar 2018 13:47:40 UTC+1 schrieb Jason: > > What you can do is split the backend into a REST API using > http://www.django-rest-framework.org/ > > Refactor the views to share common logic, and you can have your template > renders bound to one view handler and an api call to an

Split API URLs to second project/settings/wsgi ?

2018-01-02 Thread guettli
In one small project all web requests were done by humans in the past. We used a login form and cookie bases sessions. Now an API gets created and automated processes access these new URLs. These processes use a different auth backend. Now I see two possible solutions: Solution1: Use one proj

custom permission strings: Avoid magic strings ...

2017-12-15 Thread guettli
Hi, We define the permission like in the docs: https://docs.djangoproject.com/en/1.11/topics/auth/customizing/#custom-permissions To avoid the magic string 'fooapp.fooperm' in the code which uses the permission very often, I choose this solution: {{{ # file models.py class FooModel(Model):

Re: WSGI Steps and Sequence ... django.setup() reduces latency?

2017-11-10 Thread guettli
85a8b7ecaf94c0e4c3785174aee43d72de2%2Flib%2Fnotmm%2Fcontrollers%2Fwsgi.pyx%3Fat%3D0.8-devel%26fileviewer%3Dfile-view-default&sa=D&sntz=1&usg=AFQjCNHYxgjPBcU31r96OObm4-IX-GtP0g> > > > I confess, I don't understand what you want to tell me with above link. How does dj

WSGI Steps and Sequence ... django.setup() reduces latency?

2017-11-07 Thread guettli
I guess wsgi uses these steps: 1. WSGI Process starts (Up to now no single request comes in) 2. HTTP Requests comes in. You can get this timestamp via X-Request-Start. See https://docs.newrelic.com/docs/apm/applications-menu/features/request-queue-server-configuration-examples 3. Django gets cal

Re: Simple file uploading app

2017-10-27 Thread guettli
I am unsure. I want to upload excel and pdf mostly, and there are no docs. Am Mittwoch, 25. Oktober 2017 17:16:35 UTC+2 schrieb Jani Tiainen: > > Hi. > > I did simple pic uploader while ago. > > Source code is available at https://github.com/jtiai/picpaster > > 25.1

Simple file uploading app

2017-10-25 Thread guettli
I need a simple file uploading app. Every user should be able to upload files to his own area. This is the basic feature. You could think of additional goodies, but the first step is above feature. I tried to find an application which implements this, but failed. I tried this and other searche

Re: How to clean a form which receives multiple files

2017-09-25 Thread guettli
thank you very much for your Feedback! Am Freitag, 22. September 2017 18:24:23 UTC+2 schrieb mike: > > I do it this way too and agree that it feels dirty. Curious to hear what > others have to say about this! > > On Fri, Sep 22, 2017 at 9:18 AM, guettli > > wrote: > >

How to clean a form which receives multiple files

2017-09-22 Thread guettli
I am not happy with this snippet from the django docs: from django.views.generic.edit import FormViewfrom .forms import FileFieldForm class FileFieldView(FormView): form_class = FileFieldForm template_name = 'upload.html' # Replace with your template. success_url = '...' # Replace

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-18 Thread guettli
Am Donnerstag, 17. August 2017 16:09:42 UTC+2 schrieb Vijay Khemlani: > > How can we propose faster alternatives if we don't know how fast must it > be? > > Of course it is up to you in the end, but if you are seriously considering > exotic options such as using stored procedures at least I wou

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-17 Thread guettli
Am Mittwoch, 16. August 2017 13:39:53 UTC+2 schrieb Vijay Khemlani: > > So, please share the specific numbers you got from your profiling. > > Why should I share the numbers? How would this help? -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-16 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Here are more docs about guardian being slow: http://django-guardian.readthedocs.io/en/stable/userguide/performance.html

Re: Use one correspondig database user for each application user

2017-08-14 Thread guettli
Am Freitag, 21. Juli 2017 19:55:17 UTC+2 schrieb Fred Stluka: > > Answer: Connection pooling > > Sharing a single DB user for all/multiple Web app users allows > connection pooling. Otherwise, you have to create a new DB > connection for each HTTP request, or at least for each web app > user.

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Freitag, 11. August 2017 10:05:00 UTC+2 schrieb James Schneider: > > >> My concern is that this python code can't return a queryset with all > items where a given permission+user tuple match. > > > def has_perm(obj, user): > if user.is_superuser: > return True > > This means I nee

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Did you run benchmarks? Profiling? > > Usually your own business logic will be the bottleneck of your > application, not

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-10 Thread guettli
Am Mittwoch, 9. August 2017 18:03:44 UTC+2 schrieb Vijay Khemlani: > > > https://django-guardian.readthedocs.io/en/stable/userguide/check.html#get-objects-for-user > > projects = get_objects_for_user(request.user, 'projects.view_project') > > > Thank you for providing this link. I guess it is new

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Mittwoch, 9. August 2017 10:46:10 UTC+2 schrieb James Schneider: > > Sorry for the duplicate, accidently hit send before I was done, finished > below. > > On Aug 3, 2017 1:08 AM, "guettli" > wrote: > > First I asked a similar question on the postgresql-gene

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Mittwoch, 9. August 2017 10:04:25 UTC+2 schrieb James Schneider: > > > > On Aug 3, 2017 1:08 AM, "guettli" > wrote: > > First I asked a similar question on the postgresql-general list. The > discussion[1] has settled there. > > Now I would love the

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
> really stick to the canonical way. The canonical way is more maintainable, >> because it's widely used. It will be easier for other programmers to >> understand what you are doing. Elegance of solution is not compelling >> enough. A compelling reason would be, for exampl

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
d that working in Python is a lot easier than working in raw > SQL :-) but you will of course need to adapt the queries to make them > faster (which can be done by prefetching for example). > > That's just my 2 cents. > > Regards, > > Andréas > > 2017-08-07 8:43

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
> > Yes, writing python is more easy, but if you need the conditions in SQL WHERE to get a queryset, you don't have python. You have a nice ORM MyModel.objects.filter(...) which is nice and helps to create the needed SQL statements. > That's just my 2 cents. > > Rega

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-06 Thread guettli
; would make me happy. Thank you. Am Donnerstag, 3. August 2017 10:07:53 UTC+2 schrieb guettli: > > First I asked a similar question on the postgresql-general list. The > discussion[1] has settled there. > > Now I would love the hear what you think. > > > I am think

Row based permissions: In DB or App? ... farewell pain

2017-08-03 Thread guettli
First I asked a similar question on the postgresql-general list. The discussion[1] has settled there. Now I would love the hear what you think. I am thinking about rewriting an existing application which uses PostgreSQL via Django. Up to now the permission checks are done at the application

Re: From old-school Post/Redirect/Get to modern web

2017-07-25 Thread guettli
ular seem to be supported - nice. thank you for sharing this link. Regards, Thomas > HTH > > On 24 July 2017 at 11:36, guettli > > wrote: > > I use Post/Redirect/Get since several years. I use simple HTML forms > (via > > ModelForm) with a plain old

From old-school Post/Redirect/Get to modern web

2017-07-24 Thread guettli
I use Post/Redirect/Get since several years. I use simple HTML forms (via ModelForm) with a plain old submit-button. Above pattern works. But I think the web of the future works different. Up to now my web application sends html to the web clie

Re: Use one correspondig database user for each application user

2017-07-17 Thread guettli
Am Donnerstag, 13. Juli 2017 10:32:26 UTC+2 schrieb Antonis Christofides: > > BTW, > > another idea for "connecting" to PostgreSQL as different users would be to > actually have Django connect to PostgreSQL as a superuser and then > (probably in some early middleware) execute SET SESSION AUTHOR

Re: Use one correspondig database user for each application user

2017-07-13 Thread guettli
USING (current_setting('my.username') IN (message_from, message_to)) WITH CHECK (message_from = current_setting('my.username')) Regards, Thomas Güttler Am Dienstag, 11. Juli 2017 11:40:53 UTC+2 schrieb guettli: > > I guess most applications have exactly one database us

Re: Use one correspondig database user for each application user

2017-07-11 Thread guettli
can probably do things differently, and maybe there exist custom > database backends that would allow you to switch the database user on > login, but if there's no compelling reason you should really stick to the > canonical way. > > Regards, > > Antonis > > Antonis Chr

Re: Use one correspondig database user for each application user

2017-07-11 Thread guettli
Am Dienstag, 11. Juli 2017 11:46:41 UTC+2 schrieb Avraham Serour: > > Where would you store the password hashes? > > I see several possible ways. 1. use django.contrib.auth for authentication like before. The initial connection to the db gets done via a database-superuser. After auth in djang

Use one correspondig database user for each application user

2017-07-11 Thread guettli
I guess most applications have exactly one database user. Why not use one database for each application user? Example: User "foo" in my web application has a corresponding database user "foo". This way you could use row level security from the database. PostgreSQL has a lot of interesting feat

Re: SingleObjectMixin docs Typo?

2017-06-06 Thread guettli
456af6c84. > > Thanks. > > On Tuesday, June 6, 2017 at 8:44:31 AM UTC-4, guettli wrote: >> >> Current docs of SingleObjectMixin.get_context_data(): >> >> >> *> Returns context data for displaying the list of objects.* >> Source: >> https://

Re: Generic Search for any Django Model

2017-06-06 Thread guettli
Thank you Melvyn Sopacua, I was blind :-) Am Freitag, 2. Juni 2017 16:19:10 UTC+2 schrieb Melvyn Sopacua: > > On Friday 02 June 2017 07:10:15 guettli wrote: > > > There are several libraries which enable you to do fancy pagination of > > > django queryset. > >

SingleObjectMixin docs Typo?

2017-06-06 Thread guettli
Current docs of SingleObjectMixin.get_context_data(): *> Returns context data for displaying the list of objects.* Source: https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.get_context_data I don't understand "the li

Generic Search for any Django Model

2017-06-02 Thread guettli
There are several libraries which enable you to do fancy pagination of django queryset. See this grid: https://djangopackages.org/grids/g/pagination/ I have not look at all libraries, but the one I saw needed a queryset as input. I search a solution for the step before this: How to get to the

Re: vs {{ form }}

2017-05-19 Thread guettli
Am Freitag, 19. Mai 2017 10:46:02 UTC+2 schrieb James Schneider: > > > > On Thu, May 18, 2017 at 8:14 AM, guettli > wrote: > >> >> >> >> Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider: >>> >>> >>> >>

Re: vs {{ form }}

2017-05-18 Thread guettli
Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider: > > > > On May 17, 2017 6:31 AM, "guettli" > wrote: > > Hi Russell Keith-Magee, > > which version do you use? With or without table? > >{{ form }} vs {{ form }} > > &g

Re: vs {{ form }}

2017-05-17 Thread guettli
Hi Russell Keith-Magee, which version do you use? With or without table? {{ form }} vs {{ form }} Regards, Thomas Am Dienstag, 16. Mai 2017 17:52:19 UTC+2 schrieb Russell Keith-Magee: > > > On 16 May 2017, 12:51 AM -0700, guettli >, wrote: > > > I know that real su

Re: vs {{ form }}

2017-05-16 Thread guettli
Am Mittwoch, 10. Mai 2017 10:56:56 UTC+2 schrieb Melvyn Sopacua: > > On Tuesday 09 May 2017 14:08:44 Jani Tiainen wrote: > > > > > And to use bootstrap you don't need any special package, you can do it > > > without it just fine. > > > > To render a webpage, you don't need Django you can do j

Re: {{ form }} vs {{ form }}

2017-05-05 Thread guettli
Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov: > > Take a look at: > 1) Form rendering options > > 2) Outputting forms as HTML >

{{ form }} vs {{ form }}

2017-05-04 Thread guettli
I am unsure how to render a form. I see these ways - {{ form }} - {{ form }} If I use a model form, then the first way is the correct one. How to you solve this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Alternative to celery

2017-04-20 Thread guettli
Some years ago I used celery for a project. Today I face roughly the same use case again. The last time I used it, celery felt to heavy weighted, too complicated. I found this alternative: http://python-rq.org/ There are two things which speak agains python-rq: - redis is a cache. I need a pe

Re: ORM for structured Logs

2017-04-10 Thread guettli
to get it working. Again, thank you for sharing your solution. Regards, Thomas Am Samstag, 8. April 2017 18:58:59 UTC+2 schrieb Scot Hacker: > > On Tuesday, April 4, 2017 at 5:18:42 AM UTC-7, guettli wrote: >> >> In the past I was told: Don't store logs in the databas

Re: ORM for structured Logs

2017-04-07 Thread guettli
Hi Marten, Am Donnerstag, 6. April 2017 14:10:58 UTC+2 schrieb knbk: > > Hi Thomas, > > The primary purpose of logging is to catch and examine errors. If > something went wrong, you want to know *when *and *why*. Logging to a > database increases the complexity and greatly increases the number o

Re: ORM for structured Logs

2017-04-07 Thread guettli
Am Donnerstag, 6. April 2017 10:42:17 UTC+2 schrieb Christian Ledermann: > > On 6 April 2017 at 09:15, guettli > > wrote: > > Hello Brick Wall, how are you doing? > > Hello Stonemason. > > What is your question? > > It was more an idea than a question.

Re: ORM for structured Logs

2017-04-06 Thread guettli
Hello Brick Wall, how are you doing? Am Dienstag, 4. April 2017 14:18:42 UTC+2 schrieb guettli: > > In the past I was told: Don't store logs in the database. > > Time (and hardware) has changed. > > I think it is time to store logs where I have great tools for analyzing &

ORM for structured Logs

2017-04-04 Thread guettli
In the past I was told: Don't store logs in the database. Time (and hardware) has changed. I think it is time to store logs where I have great tools for analyzing logs. Storing in a model which I can access via django orm is my current strategy. It seems no one has done this before. I could no

Re: Executing DB-Queries during import

2017-04-04 Thread guettli
Am Donnerstag, 30. März 2017 00:55:40 UTC+2 schrieb Simon Charette: > > > Is it advisable to execute db queries in my AppConfig ready signal > handler? > > AppConfig.ready() is still at module-level. > > ok. Good to know. > > Use case: I want to add URL patterns which get collected from db r

Re: Executing DB-Queries during import

2017-03-29 Thread guettli
Am Mittwoch, 22. März 2017 19:20:43 UTC+1 schrieb Tim Graham: > > Correct, module level queries should be avoided. Django might try to add > some detection to warn about or prohibit that, see > https://groups.google.com/d/topic/django-developers/7JwWatLfP44/discussion > . > > I understand db qu

Re: System check framework suiteable for monitoring?

2017-03-27 Thread guettli
Am Montag, 27. März 2017 11:31:22 UTC+2 schrieb Jani Tiainen: > > Hi, > > Checks framework is mainly built to prevent system starting management > commands in case of invalid state of the system. It's not meant for health > monitoring. > There exists several ways to run health checks - we use q

System check framework suiteable for monitoring?

2017-03-27 Thread guettli
I guess a lot of people here are not only developers, they are operators, too. I mean they need to care for a production system and ensure it is up and healthy. I am unsure if the System Check Framework[1] inside Django is suited to do monitoring checks. With "monitoring checks" I mean these

Re: No support for UNION (OUTER JOIN instead)

2017-03-24 Thread guettli
Just for the records. If you think further, then deprecating is_superuser, is_staff and is_active could be a solution. See: https://groups.google.com/forum/#!topic/django-developers/J9yttc7WmJU Am Mittwoch, 15. März 2017 10:44:22 UTC+1 schrieb guettli: > > > Just for the records, I a

  1   2   >