I'm currently working on my first Django project and did it from scratch. It's definitely a lot to do. When I have more experience I'll definitely look into django-cookiecutter or similar templates
hop has quit
hop_ joined the channel
GinFuyou
so you mean base template, not project template?
You can use any general-purpose (not intended for specific CMS\template engine) html template you can find around webs, just throw in template tags to make better use of it with django
crCr62U0 has quit
Or you can use some frontend framework like bootstrap, material-design-lite, whatever
else it's list of tuples, since you could be selecting more than one value
if b is PK and you are sure it exists, you could probably just X.objects.get(pk=value).a
madsj joined the channel
sydbarret
it says 'QuerySet' object has no attribute 'value_list'
fleetfox
it's valueS
rtfm please
docs have examples
cesario joined the channel
greg_f joined the channel
jpg joined the channel
sandeepK has quit
JustASlacker joined the channel
GinFuyou
up old question: can I extract msgid from translation string? e.g. _('name') -> 'name' ?
Stigster
FunkyBob: My issue with the populated formset was solved by passing a queryset with no objects, like so: formset = EntryFormSet(queryset=Entry.objects.none()). The same issue was solved by apollo13 in May 2013. :P
Sorry, September 2010.
lqez
GinFuyou: gettext does not have a reverse lookup function. So django neither.
viejafea
What would be the recommended way to implement 'fake' users in django. meaning these will be users that'll have the same fields as my extended User model, yet won't need to login logout? (related q2: what if there is a possibility of them registering later?)
GinFuyou
lqez, but if there is no translation provided it returns msgid, right?
lqez
it's default behavior. But it looks like you're trying to get msgid from 'translated' msgstr.
I'm just wondering why do you need it
could you explain a bit more?
GinFuyou
lqez, translating model choices which are named tuples
so I need attributes in solid english, but values as translation strings
stahl joined the channel
FunkyBob
Stigster: glad you got it working! :)
Stigster
hehe, me too! Looks like I might actually meet my deadline. :D
AlecTaylor has quit
lqez
GinFuyou: in which case? please share your models code
VikingHoarder has quit
GinFuyou
lqez, in any case? Not exactly what I really have now, but I used similar code for a while now: https://dpaste.de/Su7w
_n is gettext_noop, it actually can work as a hack
lqez, i don't want tuple
lqez
understood
GinFuyou
tuple is much easier ofc, but it's ugly to refer in code later
if makemessages wouldn't overwrite translation when it's done with gettext_noop...
sandeepK joined the channel
tm007 joined the channel
Maybe I could force translation to English? (Which is not used anyway) It didn't appear to me that translation can be done only once
Jellyg00se joined the channel
sydbarret has quit
VikingHoarder joined the channel
Haudegen has quit
lqez has quit
gcain joined the channel
gcain
I'm using django forms, is there a way to submit fields as soon as they change?
The goal is to have a toggle switch that turns something on and off on the backend.
viejafea has quit
GinFuyou
gcain, ajax
jpg
gcain: I would implement the toggle as a separate functionality out of the form
GinFuyou
yeah, simple toggle doen't really need a form I guess
gcain
OK, thanks.
Guess. django can't do everything. :)
jpg
gcain: you can still include the link that makes the call inside the <form></form>
gcain
Actually, it doesn't even need to be a form, you're right!
GinFuyou
it's not really about what django can do )
gcain
I could just do something like onClick="callthe_api"
jpg
gcain: exactly
gcain
That works.
Beauty, thanks again.
shangxiao joined the channel
adsworth has quit
dodobrain_ joined the channel
dodobrain_ has quit
dodobrain joined the channel
dodobrain has quit
adsworth joined the channel
jarshwah_ joined the channel
kapil___ joined the channel
jarshwah has quit
jarshwah_ has quit
shruggedwm has quit
djent joined the channel
djent
Hi everyone! I have a Django app running within docker container served by uwsgi. Single container works fine, but when served in Kubernetes, I got an "upstream prematurely closed connection" error in nginx ingress log. That requests are not visible in container log so it seems like they are not reaching them. Here is my nginx.conf: https://dpaste.de/B44u could you please take a look?
zothix joined the channel
I'm trying different solutions since few days, haven't found any good solution...
zothix
how can i send a dictionary item in all views? example { 'example' : example }
djent
the nginx returns 502 error after 3 minutes, but I see no 3m timeout anywhere in the config
phiofx has quit
GinFuyou
zothix, context processor
zothix
GinFuyou, alright ill look into that, any kind of documentation will be helpful
pere
I want to verify the identity of my users of my python 3 django site using OpenID Connect, and use both web pages and a REST API. Do any of you have any experience with such setup? What options should I look at?