hi, has anyone seen their stack trace from runserver being repeated several times when an exception is raised? i'm running django 1.10 with werkzeug 0.11.10, django-extensions 1.7
kuter joined the channel
probro2017 has quit
lacrymology joined the channel
jessamyn_ joined the channel
Itkovian joined the channel
jessamynsmith has quit
plus65Naomi has quit
thomaxo joined the channel
mattste joined the channel
woltman has quit
mmxx_th joined the channel
username_ joined the channel
woltman joined the channel
Bowey has quit
andykay has quit
Leeds has quit
KaliLinuxGR joined the channel
FlavioZ joined the channel
FlavioZ
Hello all, I need to access session within a helper method. Here: https://docs.djangoproject.com/en/1.10/topics/h... shows how to access session out of views. Is this the best practice, or there are another methods that work better? Thanks guys :)
mattste has left the channel
Itkovian has quit
woltman has quit
probro2017 joined the channel
woltman joined the channel
mastizada joined the channel
moldy
FlavioZ: it works like that anywhere where you have access to te request object
woltman has quit
FlavioZ
moldy: Could you explain a little bit further? Sorry about that :)
woltman joined the channel
kinygos
FlavioZ: the session is tied to the request
eperzhand joined the channel
FlavioZ: so it only makes sense using the session object when handling a request
woltman has quit
moldy
FlavioZ: we can help much better if we know what you're really trying to do, e.g. what do you use the session for, and what does the helper method do
in general, you access the session with request.session
woltman joined the channel
iamkiran1 joined the channel
sol1x joined the channel
lacrymology has quit
lacrymology joined the channel
iamkiran1 has quit
probro2017 has left the channel
samsagaz joined the channel
FlavioZ
moldy: Yep, I am aware of that. I have always used sessions within my views where request is present. Now I am getting all confused. I think I need to read more about sessions :) Will be back with more questions
kuter has quit
woltman4 joined the channel
madboxs joined the channel
iamkiran joined the channel
woltman has quit
iamkiran has left the channel
gopar joined the channel
phinxy has quit
maks25 has quit
moerin has quit
not_a_web_devbot joined the channel
thomaxo joined the channel
eperzhand has quit
eperzhand joined the channel
Astyan
hi
I have some problem with translation. If I use "activate(fr)" it's translate but if I want to change the url for http://127.0.0.1:8000/fr/ it's give me a 404 any hint ?
I use activate on a specific view where I need to generate a pdf but I used it just to test if my problem was an easy enough problem to solve in settings
jessamynsmith joined the channel
jessamynsmith has quit
jessamynsmith joined the channel
thinkt4n_ has quit
maugzoide has quit
eperzhand has quit
t0n1 joined the channel
thomaxo has quit
any idea apollo13 ?
def_a_web_devbot joined the channel
apollo13
Astyan: yes, please show your settings
not those what you think are important, but the whole…
who the heck is translating these texts, they must have a really good time
therue joined the channel
hylje
good times
Astyan
ok it work when I put 'django.middleware.locale.LocaleMiddleware' in MIDDLEWARE, seems to crash if I add 'simple_history.middleware.HistoryRequestMiddleware' in but I will investigater this
thanks a lot apollo13
smacko has quit
MattHardcastle joined the channel
milardovich joined the channel
space-wizard joined the channel
dethos has quit
iiie joined the channel
morenoh149 joined the channel
milardovich has quit
Debnet
Hi people.
For historisation purposes, I use GenericForeignKey to keep a trace of every change of my models.
But in deletion, the previous histories are deleted too.
eperzhand joined the channel
Is there a way to keep the data and not dropping entities?
thomaxo joined the channel
morenoh149
+1 historisation
Debnet
morenoh149: ?
morenoh149
👍
moldy
possibly GFK supports something like on_delete=SET_NULL, i bet the docs have something
Debnet
At least, I would like to keep the content type.
moldy: Nope, unfortunatly.
def_a_web_devbot has quit
not_a_web_devbot joined the channel
ycon_ joined the channel
When looking at definition, the field doesn't take parameters other than ct_field='content_type', fk_field='object_id', for_concrete_model=True.
Bowey joined the channel
moldy
"Unlike ForeignKey, GenericForeignKey does not accept an on_delete argument to customize this behavior; if desired, you can avoid the cascade-deletion simply by not using GenericRelation, and alternate behavior can be provided via the pre_delete signal."