Files
2012-02-21 01:15:00 -05:00

1 line
7.5 KiB
JSON

[{"user_id": 3580, "stars": [], "topic_id": 13713, "date_created": 1300415451.5622699, "message": "other than it being lame to mix-em.. any difference I should be worried about?", "group_id": 81, "id": 379254}, {"user_id": 3580, "stars": [], "topic_id": 13713, "date_created": 1300415418.5358551, "message": "I noticed a mix of imports in our projects..", "group_id": 81, "id": 379248}, {"user_id": 3580, "stars": [], "topic_id": 13713, "date_created": 1300415436.0461709, "message": "other times we from projectname import settings", "group_id": 81, "id": 379253}, {"user_id": 3580, "stars": [], "topic_id": 13713, "date_created": 1300415428.169965, "message": "sometimes we from django.conf import settings", "group_id": 81, "id": 379250}, {"user_id": 11646, "stars": [], "topic_id": 13713, "date_created": 1300416744.61502, "message": "I think the main reason is to have a common point between django, projects and reusable apps. Your settings may omit some variables in favor of django's defaults.", "group_id": 81, "id": 379365}, {"user_id": 3580, "stars": [], "topic_id": 13713, "date_created": 1300421786.7766161, "message": "reusable apps? ... just kidding. that makes perfect sense.", "group_id": 81, "id": 379784}, {"user_id": 4857, "stars": [{"date_created": 1300456582.8650579, "user_id": 14679}, {"date_created": 1300466093.8888941, "user_id": 3580}, {"date_created": 1300468922.981343, "user_id": 927}], "topic_id": 13713, "date_created": 1300432594.3618989, "message": "You cannot use different settings when importing directly from projectname. For example we have settings_test.py and settings_production.py. django.conf settings works always the way it should.", "group_id": 81, "id": 380325}, {"user_id": 11646, "stars": [], "topic_id": 13713, "date_created": 1300445016.669451, "message": "@phill You're right, they might not be reusable, but then you don't need settings. :)", "group_id": 81, "id": 381068}, {"user_id": 5630, "stars": [], "topic_id": 13713, "date_created": 1300447367.9929161, "message": "@ricobl untrue. Sometimes, settings is the best place to add in some necessary global settings that your app requires you to specify.", "group_id": 81, "id": 381262}, {"user_id": 14679, "stars": [], "topic_id": 13713, "date_created": 1300456625.6459451, "message": "@jk nailed it. Your settings module may vary by deployment, but django.conf.settings is always the right one.", "group_id": 81, "id": 382087}, {"user_id": 11646, "stars": [], "topic_id": 13713, "date_created": 1300499506.0035851, "message": "@pthrasher You're right. It was a joke.", "group_id": 81, "id": 386470}, {"user_id": 4077, "stars": [], "topic_id": 13713, "date_created": 1300499972.2194619, "message": "I don't know if django.conf.settings is ALWAYS right. I've done some perverse things with my settings modules. Generally, to set up a mobile site, I'll make a 'mobile_settings.py' file that imports regular settings, and then overrides the template directories. Meanwhile, my flup scripts are setup to listen on a different port while loading that settings file on the m.domain address.", "group_id": 81, "id": 386496}, {"user_id": 1736, "stars": [{"date_created": 1300667263.277271, "user_id": 927}], "topic_id": 13713, "date_created": 1300503158.680676, "message": "@bmelton django.conf.settings is basically just a proxy for $DJANGO_SETTINGS_MODULE with a little bit of logic for default values of core Django settings.", "group_id": 81, "id": 386756}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300503223.1562719, "message": "I really can't think of a valid reason to ever use your settings module(s) directly beyond stuff like inheritance.", "group_id": 81, "id": 386762}, {"user_id": 4077, "stars": [], "topic_id": 13713, "date_created": 1300550221.649816, "message": "So, if I launch a flup instance that points at settings2, and I reference django.conf.settings, it's going to return what's in settings2? If so, I retract my earlier statement, and offer apologies.", "group_id": 81, "id": 388690}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300553633.8360629, "message": "@bmelton Yes, the relevant code is http://code.djangoproject.com/browser/django/trunk/django/conf/__init__.py#L87", "group_id": 81, "id": 388872}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300553647.3945761, "message": "It just imports the specified module and wraps it", "group_id": 81, "id": 388874}, {"user_id": 4077, "stars": [], "topic_id": 13713, "date_created": 1300554645.5621271, "message": "I'm not 100% sure I see where self.SETTINGS_MODULE is coming from, but I can play with this and figure it out. I probably just learned something. Scary.", "group_id": 81, "id": 388900}, {"user_id": 5863, "stars": [], "topic_id": 13713, "date_created": 1300569132.823756, "message": "I always use django.conf import so I can flip between different settings files when running manage.py as well. It takes a --settings argument which lets you change the module.", "group_id": 81, "id": 389549}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300579924.997174, "message": "I mean importing the settings module directly is still wrong, that just isn't something that should happen :-)", "group_id": 81, "id": 389945}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300579903.43645, "message": "That shouldn't ever cause the issue you mention unless you are just importing things incorrectly anyway", "group_id": 81, "id": 389941}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300579696.5711019, "message": "@pheze I don't think so, django.conf will actually import your module as per normal using importlib", "group_id": 81, "id": 389929}, {"user_id": 1917, "stars": [], "topic_id": 13713, "date_created": 1300578943.619369, "message": "also, another argument to not mix both import is even if it's the same file, if it is imported from 2 different paths, it will get executed two times. Meaning that if there are things to do only once, it can create sneaky bug. (For instance, creating events to which you can register.. it could be a pain to create it twice, etc.)", "group_id": 81, "id": 389906}, {"user_id": 1917, "stars": [], "topic_id": 13713, "date_created": 1300579767.304388, "message": "(I mean, it's good to use django.conf)", "group_id": 81, "id": 389932}, {"user_id": 1917, "stars": [], "topic_id": 13713, "date_created": 1300579785.7100949, "message": "It's bad to use sometime django.conf and sometime directly import it by projectname", "group_id": 81, "id": 389933}, {"user_id": 1917, "stars": [], "topic_id": 13713, "date_created": 1300583775.8374081, "message": "Well, an example for that.. say your project is named test and there's an app named test2", "group_id": 81, "id": 390099}, {"user_id": 1917, "stars": [], "topic_id": 13713, "date_created": 1300583792.149008, "message": "if somewhere you do: import test.test2 and somewhere else import test2", "group_id": 81, "id": 390100}, {"user_id": 1917, "stars": [], "topic_id": 13713, "date_created": 1300583795.0678041, "message": "it can create problem", "group_id": 81, "id": 390101}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300585848.0491941, "message": "@pheze from __future__ import absolute_import", "group_id": 81, "id": 390176}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300585856.9513161, "message": "If you aren't using that on every file, you are Wrong (tm)", "group_id": 81, "id": 390177}, {"user_id": 1736, "stars": [], "topic_id": 13713, "date_created": 1300585870.731195, "message": "(note: I am frequently lazy and forget it too)", "group_id": 81, "id": 390178}]