These are chat archives for django/django

3rd
Mar 2016
vaibhav jain
@vaibhav-jain
Mar 03 2016 03:55
@megapctr but how to check that the parent.delete() is invoked in pre_delete signal of child instance ??
vaibhav jain
@vaibhav-jain
Mar 03 2016 04:03
@megapctr right now I am setting NULL to every FK constraint by running alter table tablename drop constraint constraintname, add constraint constraintname foreign key (packet_id) references girvi_packet(id) on delete set null;
Filip Figiel
@megapctr
Mar 03 2016 09:12
Oh my god
Please don't do this
I think you can specify the on_delete behavior in the foreign key itself
vaibhav jain
@vaibhav-jain
Mar 03 2016 11:56
@megapctr Yeah but these tables aren't controlled by me they are created by django-audit-log app
Filip Figiel
@megapctr
Mar 03 2016 12:20
you should seek help in the gitter of this django app then
Gayathrimenakath
@Gayathrimenakath
Mar 03 2016 12:41
Can someone please tell me what actually this is 'virtualenv venv --python=/path/to/python3'?
mpachas
@mpachas
Mar 03 2016 13:05
Virtualenv creates isolated enviroments for python modules. With that command it creates a virtual environment called venv and takes python3 as its python interpreter
Gayathrimenakath
@Gayathrimenakath
Mar 03 2016 13:06
Thanks :)
Gayathrimenakath
@Gayathrimenakath
Mar 03 2016 13:47
SECRET_KEY = os.environ['SECRET_KEY']. raise KeyError(key)
KeyError: 'SECRET_KEY'. I get this when I run the command python manage.py syncdb. Can someone please tel me how to fix this?
fl
@imflop
Mar 03 2016 13:57
@Gayathrimenakath you trying to setup multiple setting files?
Sergey
@armicron
Mar 03 2016 14:38
use getattr(os.environ, 'SECRET_KEY', None)
or run code in try/catch block
Gayathrimenakath
@Gayathrimenakath
Mar 03 2016 17:02
Thanks everyone. I got it fixed.