Re: Application specific middleware support

2019-07-07 Thread Aymeric Augustin
Oops! Scratch that, let's try again... So Django doesn't create a relationship incoming HTTP requests and applications. You could try to create such a relationship, based on where URLconfs or views are defined, but you'll quickly discover tons of edge cases — starting with decorators — that mak

Re: insert or update on table “app_job” violates foreign key constraint “app_job_user_id” DETAIL:Key (user_id)=(1) is not present in table “accounts_user”

2019-07-07 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Application specific middleware support

2019-07-07 Thread Adam Johnson
Aymeric, are you sure about that? I can't find the code, and the docs for current_app say it's noto set by Django itself: https://docs.djangoproject.com/en/2.2/ref/request-response/#django.http.HttpRequest.current_app Also middleware can't reliably make use of routing information except in process

insert or update on table “app_job” violates foreign key constraint “app_job_user_id” DETAIL:Key (user_id)=(1) is not present in table “accounts_user”

2019-07-07 Thread Aayush Bhattarai
[image: Capture.PNG] *I have used function based View to get data from post Request. I need to get many data that also include a primary key field too. I need to push data into two models. While doing so, I encountered an error.* #accounts models.py from django.db import models class User(m

Re: Application specific middleware support

2019-07-07 Thread Aymeric Augustin
Hello Kapil, When you talk of a "URL served by an app", I suppose you're referring to URL namespaces, which provide a request.currrent_app attribute associating an HTTP request to an app. As far as I know, this is the only association of a request and an app that Django defines. Django's docum

Re: Application specific middleware support

2019-07-07 Thread Adam Johnson
Hi Kapil The main reason I believe is because URL's are project global, rather than per app. Yes the root urlconf can include URL's kept within apps, but because it's a recursive data structure this isn't so easy. For your use case I'd suggest either: - Using class based views, creating a sub

Application specific middleware support

2019-07-07 Thread Kapil Garg
Hi, I am working on one django project and recently i had the requirement for a middleware. But i don't want this middleware to hook to every url served by the whole project but instead, only to one of the apps. I tried to look on the internet but everywhere there are hacks to implement it but

Re: Fuzzing Django at Google OSS-Fuzz

2019-07-07 Thread Florian Apolloner
Hi Guido, wow. That would be very much appreciated. security@dp is just a google mailing list I fear. If you added me, would it be possible that I manage the other email addresses, or would you have to do that all? Also for now please do not add anyone without my sayso, I'll get in touch with y