Is there a way I can initialize my models with a lambda expression such as lambda: datetime.now().date()? When I had default=datetime.now it worked ok but now makemigrations is complaining that I can't serialize a lambda expression
mitaka joined the channel
codeme has quit
I'm just trying to get a date field to be initialized with todays date; I don't want a full datetime field
shangxiao
okimoyo: default kwargs accept callables
codeme joined the channel
apollo13
okimoyo: don't make it a lambda
okimoyo
If I'm using a modelform to create it, how would I pass that from the form?
MawGoomba joined the channel
MawGoomba has quit
MawGoomba joined the channel
eka joined the channel
Alina-malina has quit
ulhas has quit
grafa joined the channel
v0r0nwe joined the channel
Alina-malina joined the channel
ulhas joined the channel
FreedomFighter has quit
kinetic joined the channel
doza joined the channel
FreedomFighter joined the channel
FreedomFighter has quit
sagaragarwal94 joined the channel
codeme has quit
lorddaedra joined the channel
jessamynsmith joined the channel
DLSteve joined the channel
SecondForm_Glenn has quit
codeme joined the channel
Debnet joined the channel
keimlink joined the channel
Spoutnik16
hello
slick666_work joined the channel
anyone using django in addition with docker-compose ?
apollo13
most likely, a specific question would be better…
that said, django is just a library, so I do not see how docker-compose affects it at all
ulhas has quit
Spoutnik16
all the template i tryied (like dockerizing django, django-cookiecutter, etc) just seems not working at all on my mint setup
kinetic has quit
as well as on fresh digital ocean ubuntu droplets
apollo13
"just seem not working" is not really something we can help you with, get more specific… and for the love of god get rid of mint
Spoutnik16
so, doe someone use regularly such a template which do work ? does it exists ?
apollo13
again, there is no reason why django-cookiecutter would not work… what specific issues are you running into…
Spoutnik16
when i do the docker-run, it tells me things between "postgres not found", "pip not finding library", "missing a .env", and not allways the same
those time, django-cookiecutter tells me postgres not found
apollo13
please read the topic and probide the info asked for there
Joshee joined the channel
Spoutnik16
but is tehre really people using it and it do works ? or am i working on a thing that nobody use and is a bad tool ?
Hairy joined the channel
apollo13
there surely are people using docker-compose, and if you use cookiecutter or not does not make a diff…
kendas joined the channel
Spoutnik16
and are those people mainly using project templating to output projects ? or doing everything by hand is the only way to have something good out of docker-compose ?
apollo13
*sigh*
Spoutnik16: cookiecutter works just fine with docker-compose
you are trying to solve a problem which does not exist
okimoyo has quit
ulhas joined the channel
Spoutnik16
well, last project on cookiecutter i have only works with the dev.yml setup, the docker-compose.yml setup never worked....
grafa has quit
the new one does not at all works, django tells me "is the server runnign on host "postgres" (172.17.0.61) and accepting tcp/ip connections on port 5432
and i just donwloaded the thing, and made it run... out of the box
apollo13
and, is the server running where it is supposed to?
Spoutnik16
the dev server is supposed to run on my laptop ? I'm not sure I get the question :/
martin_jft joined the channel
apollo13
I have the feeling you should invest some time into docker etc to understand how those things work
Spoutnik16
and I'd as well run the prod server on my laptop to test it before sending it to the digital ocean to live
ok, what should i read about it ?
apollo13
what docker containers are, how they work, how they can talk with each other and how to pull in linked configuration etc…
Leeds has quit
Spoutnik16
I feel like i've read a bit, but maybe it's just totally out of my league :)
lacrymology joined the channel
and the idea "let's get django-cookiecutter, docker-compose, and never worry again about installing postgres and setting up django for postgres and setting up redis and installing postgis and all that shit" is just a dream :/
is it ?
apollo13
well it is not a dream, I have a similar setup running here, although with packer and ansible, but in the end it boils down to the same
MawGoomba has quit
Spoutnik16
but you still have to learn ansible and packer to make it work without trouble ? or is there a simple all in hands solution ?
codeitloadit joined the channel
Hairy joined the channel
ulhas has quit
infinitesum joined the channel
that was the nice thing with the django-cookiecutter, I tought "well, I'll never learn sysadmin and I will allways be able to deploay with a postgis painlessly"
infinitesum
If I have a base settings file that gets imported into my dev settings file, is there a way I can auto-refresh that import for when I’m editing things in the base settings?
apollo13
infinitesum: ?
infinitesum
apollo13: So in my dev.py, I have ‘from .base import *’. But if I make a change to a value in base.py, it’s not getting picked up by the dev server
unless I manually kill the server and restart
apollo13
infinitesum: the devserver reloads on code changes, so yes it will pick it up
unless you somehow managed to not make it track that file
infinitesum
apollo13: hmm I’ll look into it, it seemed to not be working before.
Spoutnik16
infinitesum: the base server works that way, runserver_plus from django-extensions does auto-reload
kendas has quit
infinitesum
Spoutnik16: Thanks! I have django-extensions installed, so I’ll actually use that
apollo13
Spoutnik16: no, the standard runserver also does autoreload
MawGoomba joined the channel
infinitesum
apollo13: hmm ok it’s actually working now, not sure what was going on before
mitaka has quit
apollo13
infinitesum: if you have syntax errors or so you can sometimes confuse the reloader