Re: "No module named models.auth" magic-removal confusion?

2006-06-21 Thread Peter Ferne
Hi GrigoryOn 6/21/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote:
http://code.djangoproject.com/wiki/RemovingTheMagic#IncludetemplateextensionexplicitlyI don't think that's the problem. In my urlconf I have:
    (r'^json/trails/(?P\d+)/$',    'trail_detail_json',    {'template_name': 'json/detail'}),N.B. no extension on the template name. 
And a very simple view:def trail_detail_json(*args, **kwargs):    trail = get_object_or_404(trails, pk=kwargs['trail_id'])    if DEBUG:    response = HttpResponse(mimetype='text/plain')
    else:        response = HttpResponse(mimetype='application/json')    t = loader.get_template(kwargs['template_name'])    c = Context({    'trail': trail,    })    response.write(t.render
(c))    return responseand an even simpler template:{% load mista %}{{trail|json}}what made you think that was the problem?-- petef

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django users" group.  To post to this group, send email to django-users@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: "No module named models.auth" magic-removal confusion?

2006-06-21 Thread Grigory Fateyev

Hello petef!
On Wed, 21 Jun 2006 12:47:19 - you wrote:

> 
> I've been developing an app (http://preview.sharing-places.com)
> against Django v0.91. A little while back I started a branch on my
> local dev machine (an OS X laptop) to incorporate the magic-removal
> changes. I've suspended work on that branch for the time being to
> carry on with bug fixing and adding new features to the trunk.
> 
> I'm now getting an unexpected import error, working on the trunk,
> which has me pulling my hair out:
> 
>   Exception Type: ImportError
>   Exception Value:No module named models.auth

http://code.djangoproject.com/wiki/RemovingTheMagic#Includetemplateextensionexplicitly

>>> from django.contrib.auth.models import User
>>>

-- 
÷ÓÅÇÏ ÎÁÉÌÕÞÛÅÇÏ!
greg [at] anastasia [dot] ru çÒÉÇÏÒÉÊ.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



"No module named models.auth" magic-removal confusion?

2006-06-21 Thread petef

I've been developing an app (http://preview.sharing-places.com) against
Django v0.91. A little while back I started a branch on my local dev
machine (an OS X laptop) to incorporate the magic-removal changes. I've
suspended work on that branch for the time being to carry on with bug
fixing and adding new features to the trunk.

I'm now getting an unexpected import error, working on the trunk, which
has me pulling my hair out:

  Exception Type:   ImportError
  Exception Value:  No module named models.auth

The exception is being thrown here at line 2:

  0. from datetime import datetime
  1. from decimal import Decimal
  2. from django.models.auth import User
  3. from django.models.walks import Tag, Trail, WayPoint
  4. from simplejson import JSONEncoder
  5.
  6. class ExtendedJsonEncoder (JSONEncoder):
  7. """Extends the JSONEncoder to support Decimal and datetime"""
  8. def default(self, o):

Now this code is unchanged from before the error appeared, also if I
run these imports in a shell they work just fine:

  $ ./manage.py shell
  Python 2.4.2 (#1, Jan 31 2006, 16:46:22)
  [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
  Type "help", "copyright", "credits" or "license" for more
information.
  (InteractiveConsole)
  >>> from datetime import datetime
  >>> from decimal import Decimal
  >>> from django.models.auth import User
  >>> from django.models.walks import Tag, Trail, WayPoint
  >>> from simplejson import JSONEncoder
  >>>

I'm assuming this is some kind of magic-removal confusion, what with
django.models.auth becoming django.contrib.auth.models but I've deleted
my django-0.95 directory and even redownloaded and reinstalled
django-0.91 and it's still persisting.

I should also add that if I rollback my dev env to the exact same
codebase as is running on the live site I still get the import error
locally (although it's fine on the live site).

Clearly I've made some kind of config change locally which is screwing
things up but I'm having trouble pinning it down, to say the least. I'd
really appreciate any pointers as to where to look/things to try.

TIA
--
petef


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---