http://github.com/lsbardel/django/commit/9215082052b5d0ea0d0116ddeb08345452ae5358 As I said, not great but it works.
On 23 October 2010 15:26, Luca Sbardella <[email protected]> wrote: > ups. > > the settings import is also in django.forms.models > > from django.db import connections > > I still strongly think django.forms should be import django.conf free at > module level. > I'll come up with an idea. > > > > On 23 October 2010 13:29, Luca Sbardella <[email protected]> wrote: > >> I left it vague on purpose. >> My problem is I cannot import forms outside django, not the function >> itself. >> I don't have an opinion on how best to re-implemented it in backward >> compatible fashion. But I can come up with one. >> All I needed to know is if is there an appetite for this? and if so, a >> guideline on how not to do it. >> The quickest way would be to put the import in the function and throw the >> same ImportError when accessing it without settings file available. >> Not nice but it would work. >> >> ciao >> >> >> >> On 23 October 2010 12:36, Luke Plant <[email protected]> wrote: >> >>> On Sat, 2010-10-23 at 12:07 +0100, Luca Sbardella wrote: >>> > ImportError: Settings cannot be imported, because environment variable >>> > DJANGO_SETTINGS_MODULE is undefined >>> > >>> > Hi guys, >>> > nothing to do with 1.3 awesome new features... >>> > but I'm trying to use django forms outside django (why not!). >>> > Not possible because of the above. >>> > >>> > The settings is imported in django.forms.widgets and only used by the >>> > Media class absolute_path function. >>> > I think that import should be removed and the absolute_path function >>> > written differently. Anyone agrees? >>> >>> 'differently' is entirely too vague here. What concrete, *backwards >>> compatible* proposal do you have for eliminating the dependency on the >>> settings file in that method? >>> >>> Luke >>> >>> -- >>> "If you do a job badly enough, sometimes you don't get asked to do >>> it again." (Calvin and Hobbes) >>> >>> Luke Plant || http://lukeplant.me.uk/ >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Django developers" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<django-developers%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/django-developers?hl=en. >>> >>> >> > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
