Thanks for the time to reply.

I installed django by copyong the packahe into site-packages.
The w2k box uses ntfs and is just a local pc. No network setup except
internet connection.

I think what I will do is start clean and redo the tuturial.

I'm still not too clear about what to pass for the object, but if I
redo the code perhaps it will conme to me.

Thanks

John

On Mar 27, 2:13 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> Hi John,
>
> On 3/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > I did a search on this and was pointed at environment issues but
> > without a clear pointer as to what to do.
>
> If you are having problems with importing django.core.management, it
> means that the django-admin script can't import django. This means
> that Django isn't in your PYTHONPATH.
>
> How to fix this problem depends a little bit on how you installed
> Django in the first place. How exactly did you install Django?
>
> > One line in the tuturial has me puzzled.
>
> > <<The vote() view is still required. However, it must be modified to
> > match the new templates and context variables. Change the template
> > call from polls/detail.html to polls/poll_detail.html, and pass object
> > in the context instead of poll.>>
>
> > <<pass object in the context instead of poll.>>
>
> This is referring to part of the porting process from custom written
> views into a generic views.
>
> In order to be generic, a generic view uses generic names. When you
> manually wrote a view for Polls in Tutorial 3, you wrote a template
> called detail.html, used the URL pattern to extract a variable called
> 'poll_id', wrote a view to find the poll matching the poll_id, and
> provided that poll as a context variable to the template.
>
> The generic views exist to provide common functionality without the
> need to write views. "Display 1 object", "Edit 1 object", and "Display
> a list of objects" are all basic functionality for database backed
> websites, so Django provides a mechanism (generic views) to implement
> this functionality without the need to write individual views. Since
> displaying an object of one type is fundamentally the same as
> displaying an object of any other type, Django is able to provide
> generic view definitions that can be deployed for any given model
> type.
>
> To do this, the generic view makes some assumptions. It assumes that
> the template will always be called '<model>_detail.html', and assumes
> that the URL pattern will extract a variable called 'object_id'. You
> don't need to define your own view - the generic view does all the
> work, based upon the generic template name and object id.
>
> Once you have done this to the edit/display/list views, the tutorial
> example has a problem; the vote view can't be made generic. There will
> always be a need to write _some_ customized views - the vote view is
> one of these. However, the vote view can reuse some of the templates
> from the generic views - you just need to modifiy the code for the
> vote view to point to the generic-named templates (poll_detail.html,
> rather than detail.html), and to provide the context variables that
> the generic template expects (object, rather than poll)
>
> > One further point, when I set up my site using the admin tool, it did
> > not create an  __init__.py file in my 'mysite' directory along with
> > models.py and views.py. The tutorial implied that it would.
>
> It should have. It certainly does on my test machines (Unix and Mac based).
>
> Based on your earlier problem with installing (and finding
> core.management) It sounds like there might be a problem creating
> __init__.py files on your machine. You say you are using Win2k - is
> your filesystem NTFS or FAT32? Are you using a network drive at all?
> Is there anything else interesting about the drive you are using that
> might prevent the creation of empty files?
>
> Yours,
> Russ Magee %-)


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to