mattmcc, okay, I'll try to refactor my code. thanks.
wolakkk has quit
lpz
during a django test, all the data are rolled back? I'm, anything will be save in the test database ?
I mean*
wolakkk joined the channel
bjornkri
I’m trying to add the current user to a many-to-many when they create an instance through the admin interface, but I don’t manage. Trying to do it like this: https://dpaste.de/iJEc
rpkilby joined the channel
The idea is that users can only see projects where they are in the owners list - but it’s happened a few times that they forget to add themselves when creating a project and so can’t access it without the help of an admin. (Yeah, I know, but they want it to work this way)
fission6 joined the channel
greg_f joined the channel
wolakkk has quit
rpkilby has quit
wolakkk joined the channel
Ah. save_related is what I should be looking for, probably.
hop_
bjornkri: you don't actually save anything, me thinks
after you add the user, i mean
bjornkri
Nope, that’s why I’m adding the user *after* saving
Can’t do it before the object has an id
hop_
bjornkri: there is a code snippet in the docs that's almost what you need. why don't you use that?
hi guys! I'm trying to change my db backend from sqlite to postgresql but on migrate I get : LINE 1: ...MN "reminder_offset" TYPE date USING "reminder_offset"::date
any ideas how to fix this ?
can I just squash every migration ever and make a schema from the current models and use that ?
chasonchaffin joined the channel
fikka has quit
dustinm joined the channel
chasonchaffin has quit
fikka joined the channel
iamriel has quit
BreakerZero joined the channel
rodolfojcj joined the channel
aditya_r has quit
Lauxley
cuci: sure you can reset your migrations as long as you don't need another db to be migrated from a passed state
hop_
cuci: if you have data you want to keep you have to split the migration
wolakkk has quit
cuci
hop_: no data I wanna keep
hop_
then truncate the table before migrating, i think
hop_ is now known as hop
chocoelho joined the channel
cuci
the project changed very much since the initial state and many of the migrations are just trying out stuff till I got it done
Ahuj has quit
hop
well, sure you can squash anyway, but altering the column still won't work
chocoelho has quit
with data in it
cuci
I shouldn't have any reminder_offsets
hop
hm
cuci
Is there a manage.py create_database_from_current_models ?
so I can use just that ?
hop
throw away all migrations and start from scratch?
cuci
yup
I feel bold
KeyJoo has quit
hop
keeping migrations clean is ocd work, don't worry
Xorg has quit
redir joined the channel
wolakkk joined the channel
lacrymology joined the channel
rpkilby joined the channel
READ10 joined the channel
geekodour08 has quit
rpkilby has quit
iamriel joined the channel
fujii has quit
fujii joined the channel
iamriel has quit
csotelo_at_work joined the channel
iamriel joined the channel
iamriel has quit
iamriel joined the channel
geekodour08 joined the channel
fission6 joined the channel
iamriel
anyone here deploying django as a container?
techno_x64 joined the channel
fikka has quit
vimes joined the channel
fikka joined the channel
vimes
Hello! it's not strictly django, but I'm trying to deploy a django app to my small webserver using this guide http://michal.karzynski.pl/blog/2013/06/09/djan... , but supervisor fails. I've tried changing things in the supervisor config file but it still fails. any ideas? https://dpaste.de/sxpQ
Haudegen joined the channel
Haudegen has quit
chasonchaffin joined the channel
doismellburning
vimes: "fails" tells us very little - dpaste traceback etc. please
...sorry my window truncated that!
vimes
My problem is that I didn't find any more logs, but now I tried to run the gunicorn script manually and got an error. I can paste the gunicorn script and error
doismellburning
vimes: that would be a good start - if you can't start it manually, chances are supervisor can't start it either
sounds like your sourcing of your virtualenv isn't right
geekodour08 has quit
chasonchaffin has quit
batisteo joined the channel
vimes
I think the name of the sock was wrong, I changed it and got a different error now. https://dpaste.de/5UDi
Lenz has quit
seems like I'm missing secret key (this is just to test on server, it will be shut down once it works)
greg_f joined the channel
joshuajonah joined the channel
mmm but my settings has a secret key, the one that was generated when I created the project
kezabelle
probably its not reading your settings at all, and its just erroring hard on that specific [required] one
vimes
yes, my config says "DJANGO_SETTINGS_MODULE=fossekalltek.settings" but my secret key is in fossekall/settings/base.py. Can I just change it to "production.py" (that gets all the data from base.py) or do I have to set the folder too?
jadajada joined the channel
empedokles78
why is the reverse importet in the method definition here?: is https://dpaste.de/5bqj and why is the id coerced to a str?
swills joined the channel
wolakkk has quit
Diemuzi joined the channel
kezabelle
why is reverse imported there? no idea. probably for no reason. It's unlikely to be avoiding a circular import. Why coerce to str? No idea, its probably not necessary?
eggstyrone joined the channel
[usually imports live outside the top of a file to avoid circular imports, usually because of package boundary crossing]
empedokles78
kezabelle, can you give an example of how you use get_absolute_path in your models?