These are chat archives for django/django

20th
Aug 2015
Samuel Spencer
@LegoStormtroopr
Aug 20 2015 03:44
I got sick of getting lost when making Django models, I'm also lazy and didn't want to draw entity-relationship diagrams. So I've built a reusable Django app that builds interactive ERDs straight from a django project. It even colours nodes differently based on the app that it belongs to, and if you hover over nodes it gives a complete description of the model build from the inline
Python docs and from the field help_text.
you can check it out here :
Răzvan Ionescu
@ionescu77
Aug 20 2015 03:48
@LegoStormtroopr wow man it really looks cool. I will give it a try later today. I remember there was an option to manage.py to display the DB scheme but it does not seem to be present in 1.8 anymore. Your django spaghetti looks really promising!
Răzvan Ionescu
@ionescu77
Aug 20 2015 03:55
@LegoStormtroopr I'll have a look at Aristotle. Maybe I can help with German and Romanian translation.
Samuel Spencer
@LegoStormtroopr
Aug 20 2015 04:01
Glad to hear you like it @ionescu77 , speaking of Aristotle I built spaghetti for helping track the Aristotle models and there is a live demo of spaghetti on the Aristotle demo site.
@ionescu77 I'm also giving out shirts for translators, so any help you can give would be great.
Oleg Serbokryl
@Krokop
Aug 20 2015 07:25
it would be ok if i save local variables in base?
Example: after 10 bad login try , i block user for 1 hour. How can i change 10 to 20 without refactoring code?
Mir Nazim
@mnazim
Aug 20 2015 07:27
@krokop It’s unclear what you mean by "save variables in base”? Storing such a value in settings would be the general pattern here.
# inside settings.py
LOGIN_BLOCK_AFTER = 10 # Retries
LOGIN_BLOCK_FOR = 60 # Minutes

# inside your app code
from django.conf import settings

settings.LOGIN_BLOCK_AFTER
settings.LOGIN_BLOCK_FOR
Oleg Serbokryl
@Krokop
Aug 20 2015 07:33
@mnazim i understand this pattern. But if later you want change BLOCK_AFTER, and you haven't access to code. How you solve this?
Mir Nazim
@mnazim
Aug 20 2015 07:34
store it in the DB then. Checkout django-solo. I use it to store project wide dynamic configuration
Oleg Serbokryl
@Krokop
Aug 20 2015 07:35
@mnazim thanks you
Mir Nazim
@mnazim
Aug 20 2015 07:36
You might also be interested in checking out https://www.djangopackages.com/grids/g/live-setting/
Oleg Serbokryl
@Krokop
Aug 20 2015 07:38
@mnazim yep, that's what i need
Mir Nazim
@mnazim
Aug 20 2015 07:38
:thumbsup:
noisy @noisy sends test message from irssi using https://irc.gitter.im/
Krzysztof Szumny
@noisy
Aug 20 2015 07:59