Re: ImportError cannot import name DetailView

2011-01-04 Thread Anthony Pearce
That could be it. I downloaded the latest official version, 1.2.4.  I
totally overlooked that comment at the top.

On Jan 5, 12:13 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Tuesday, January 4, 2011 3:07:58 PM UTC, Anthony Pearce wrote:
>
> > While completing "Writing your first Django app, part 4", I ran into
> > an error. I have almost completed the online tutorial, but using the
> > code verbatum, I get this error. I even went as far as to cut and
> > paste the code, rather than typing it as I usually do, just in case I
> > made a simple error I could not see.
>
> > Exception Location: C:\DjangoProjects\mysite\polls\urls.py in
> > , line 2
>
> > Copy of line 2 of urls.py. from django.views.generic import
> > DetailView, ListView
>
> > Anyone have any ideas?
>
> You're using the docs for the development version, but are probably running
> the released version 1.2. There's a link at the top of each page to the
> correct documentation for your version.
> --
> DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ImportError cannot import name DetailView

2011-01-04 Thread Anthony Pearce
While completing "Writing your first Django app, part 4", I ran into
an error. I have almost completed the online tutorial, but using the
code verbatum, I get this error. I even went as far as to cut and
paste the code, rather than typing it as I usually do, just in case I
made a simple error I could not see.

Exception Location: C:\DjangoProjects\mysite\polls\urls.py in
, line 2

Copy of line 2 of urls.py. from django.views.generic import
DetailView, ListView

Anyone have any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Templates Directory Question

2011-01-03 Thread Anthony Pearce
Now I feel stupid. That intelligent comment flew right over my head.
I'm not sure yet where apache is falling in here yet, nor do I know
what htdocs is.

I should mention I'm using Windows 7 also, in case any terminology is
based on another OS.


On Jan 3, 10:56 pm, "Mo J. Al-Mughrabi" <mo.mughr...@gmail.com> wrote:
> By document root they mean apache public directory, aka htdocs
>
> Sent from my iPhone
>
> On Jan 3, 2011, at 4:53 PM, Anthony Pearce <coden...@gmail.com> wrote:
>
>
>
> > In Tutorial 2, I was instructed to make a templates directory. It is
> > located at:
> >     C:\DjangoProjects\mysite\templates
>
> > Now again in Tutorial 3, section "Write views that actually do
> > something", I am given the instructions:
> >      create a directory, somewhere on your filesystem, whose
> > contents Django can access. (Django runs as whatever user your server
> > runs.) Don't put them under your document root.
>
> > I think the document who's root I cannot put them under is the
> > views.py document, as that's what I had been editing.  It is located
> > at:
> >     C:\DjangoProjects\mysite\polls\views.py
>
> > I guess my question is, where is the best place for this new templates
> > directory?  Can I simply make a subdirectory in the templates
> > directory for the views.py template?  For example, like this:
> >     C:\DjangoProjects\mysite\templates\views\
>
> > Sorry for a question with likely a quite obvious solution, but thanks
> > again for any assistance.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Templates Directory Question

2011-01-03 Thread Anthony Pearce
In Tutorial 2, I was instructed to make a templates directory. It is
located at:
 C:\DjangoProjects\mysite\templates

Now again in Tutorial 3, section "Write views that actually do
something", I am given the instructions:
  create a directory, somewhere on your filesystem, whose
contents Django can access. (Django runs as whatever user your server
runs.) Don't put them under your document root.


I think the document who's root I cannot put them under is the
views.py document, as that's what I had been editing.  It is located
at:
 C:\DjangoProjects\mysite\polls\views.py

I guess my question is, where is the best place for this new templates
directory?  Can I simply make a subdirectory in the templates
directory for the views.py template?  For example, like this:
 C:\DjangoProjects\mysite\templates\views\

Sorry for a question with likely a quite obvious solution, but thanks
again for any assistance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Customize the admin look and feel

2011-01-02 Thread Anthony Pearce
That has worked. Puzzling to me though since we left off the admin
directory in TEMPLATE_DIRS

None the less, thank you very much. I will continue with the tutorial
and see how much farther I can get.

On Jan 2, 11:46 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
wrote:
> Could you please try moving the base_site.html to
> C:\DjangoProjects\mysite\mytemplates\admin
> folder and Leave the TEMPLATE_DIRS as it is, which is "*
> C:/DjangoProjects/mysite/mytemplates*" only. and please try removing the /
> slash at the end.
>
>
>
>
>
> On Sun, Jan 2, 2011 at 5:36 PM, Anthony Pearce <coden...@gmail.com> wrote:
> > TYVM for your response. My first reply does not show, so hopefully I'm
> > not double posting.
>
> > This is what I have so far:
>
> > TEMPLATE_DIRS           "C:/DjangoProjects/mysite/mytemplates/"
> > base_site.html location   C:\DjangoProjects\mysite\mytemplates
>
> > This is what base_site.html reads.
> > {% extends "admin/base.html" %}
> > {% load i18n %}
> > {% block title %}{{ title }} | {% trans 'Django site admin' %}{%
> > endblock %}
> > {% block branding %}
> > {% trans 'Django Administration' %}
> > {% endblock %}
> > {% block nav-global %}{% endblock %}
>
> > If this supposed to help me change the appearance?  I don't see how to
> > change anything here.
>
> > On Jan 2, 4:36 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
> > wrote:
> > > Hi,
>
> > > Your TEMPLATE_DIRS should contain a path to a folder where you want to
> > keep
> > > your templates. Say if your project is in *D:/myproject* then create a
> > > folder named
> > > template under *D:\myproject*, and in that folder create a folder named
> > *admin
> > > *and then copy and paste base_site.html into the admin folder.
>
> > >  TEMPLATE_DIRS section should look like the below snippet in settings.py
>
> > > *
> > > TEMPLATE_DIRS = (
> > >     'D:/myproject /templates'
> > > )
>
> > > *
>
> > > On Sun, Jan 2, 2011 at 10:04 AM, Anthony Pearce <coden...@gmail.com>
> > wrote:
> > > > I have made it to the "Writing your first Django app, part 2" page
> > > > down to "Customize the admin look and feel", at the bottom.  I'm stuck
> > > > with this paragraph..
>
> > > > Now copy the template admin/base_site.html from within the default
> > > > Django admin template directory in the source code of Django itself
> > > > (django/contrib/admin/templates) into an admin subdirectory of
> > > > whichever directory you're using in TEMPLATE_DIRS. For example, if
> > > > your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above,
> > > > then copy django/contrib/admin/templates/admin/base_site.html to /home/
> > > > my_username/mytemplates/admin/base_site.html. Don't forget that admin
> > > > subdirectory.
>
> > > > I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
> > > > templates/admin/base_site.html.
>
> > > > I have no idea where this is supposed to be copied and pasted to.
>
> > > > Any help please?
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django-us...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@google­groups.com>
> > <django-users%2bunsubscr...@google­groups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > *Praveen Krishna R*- Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@google­groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> *Praveen Krishna R*- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Customize the admin look and feel

2011-01-02 Thread Anthony Pearce
TYVM for your response. My first reply does not show, so hopefully I'm
not double posting.

This is what I have so far:

TEMPLATE_DIRS   "C:/DjangoProjects/mysite/mytemplates/"
base_site.html location   C:\DjangoProjects\mysite\mytemplates

This is what base_site.html reads.
{% extends "admin/base.html" %}
{% load i18n %}
{% block title %}{{ title }} | {% trans 'Django site admin' %}{%
endblock %}
{% block branding %}
{% trans 'Django Administration' %}
{% endblock %}
{% block nav-global %}{% endblock %}

If this supposed to help me change the appearance?  I don't see how to
change anything here.


On Jan 2, 4:36 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
wrote:
> Hi,
>
> Your TEMPLATE_DIRS should contain a path to a folder where you want to keep
> your templates. Say if your project is in *D:/myproject* then create a
> folder named
> template under *D:\myproject*, and in that folder create a folder named *admin
> *and then copy and paste base_site.html into the admin folder.
>
>  TEMPLATE_DIRS section should look like the below snippet in settings.py
>
> *
> TEMPLATE_DIRS = (
>     'D:/myproject /templates'
> )
>
> *
>
>
>
>
>
> On Sun, Jan 2, 2011 at 10:04 AM, Anthony Pearce <coden...@gmail.com> wrote:
> > I have made it to the "Writing your first Django app, part 2" page
> > down to "Customize the admin look and feel", at the bottom.  I'm stuck
> > with this paragraph..
>
> > Now copy the template admin/base_site.html from within the default
> > Django admin template directory in the source code of Django itself
> > (django/contrib/admin/templates) into an admin subdirectory of
> > whichever directory you're using in TEMPLATE_DIRS. For example, if
> > your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above,
> > then copy django/contrib/admin/templates/admin/base_site.html to /home/
> > my_username/mytemplates/admin/base_site.html. Don't forget that admin
> > subdirectory.
>
> > I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
> > templates/admin/base_site.html.
>
> > I have no idea where this is supposed to be copied and pasted to.
>
> > Any help please?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@google­groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> *Praveen Krishna R*- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Customize the admin look and feel

2011-01-02 Thread Anthony Pearce
OK, this is  now what I have:

Project location. C:\DjangoProjects\mysite\
base_site.html locationC:\DjangoProjects\mysite\templates
\base_site.html
TEMPLATE_DIRS reads "C:/DjangoProjects/mysite/templates/"

There are no apparent errors, but I also do not see how this helps
me.

base_site.html reads as follows:

{% extends "admin/base.html" %}
{% load i18n %}
{% block title %}{{ title }} | {% trans 'Django site admin' %}{%
endblock %}
{% block branding %}
{% trans 'Django Administration' %}
{% endblock %}
{% block nav-global %}{% endblock %}

What am I supposed to do with this to change the appearance?

btw, tyvm for your response  :)

On Jan 2, 4:36 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
wrote:
> Hi,
>
> Your TEMPLATE_DIRS should contain a path to a folder where you want to keep
> your templates. Say if your project is in *D:/myproject* then create a
> folder named
> template under *D:\myproject*, and in that folder create a folder named *admin
> *and then copy and paste base_site.html into the admin folder.
>
>  TEMPLATE_DIRS section should look like the below snippet in settings.py
>
> *
> TEMPLATE_DIRS = (
>     'D:/myproject /templates'
> )
>
> *
>
>
>
>
>
> On Sun, Jan 2, 2011 at 10:04 AM, Anthony Pearce <coden...@gmail.com> wrote:
> > I have made it to the "Writing your first Django app, part 2" page
> > down to "Customize the admin look and feel", at the bottom.  I'm stuck
> > with this paragraph..
>
> > Now copy the template admin/base_site.html from within the default
> > Django admin template directory in the source code of Django itself
> > (django/contrib/admin/templates) into an admin subdirectory of
> > whichever directory you're using in TEMPLATE_DIRS. For example, if
> > your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above,
> > then copy django/contrib/admin/templates/admin/base_site.html to /home/
> > my_username/mytemplates/admin/base_site.html. Don't forget that admin
> > subdirectory.
>
> > I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
> > templates/admin/base_site.html.
>
> > I have no idea where this is supposed to be copied and pasted to.
>
> > Any help please?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@google­groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> *Praveen Krishna R*- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Customize the admin look and feel

2011-01-02 Thread Anthony Pearce
"DjangoProjects/mysite/mytemplates/admin/"  but I created the
"mytemplates" and "admin" directories for this purpose.

What exactly is this supposed to do for me anyway? I thought it would
allow me to edit the "Django administration" bar at the top, but I
can't as of yet.

On Jan 2, 8:05 pm, Daniel Roseman  wrote:
> The directions seem quite clear. What have you set TEMPLATE_DIRS to in 
> settings.py? It goes in there.
> --
> DR

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Customize the admin look and feel

2011-01-01 Thread Anthony Pearce
I have made it to the "Writing your first Django app, part 2" page
down to "Customize the admin look and feel", at the bottom.  I'm stuck
with this paragraph..

Now copy the template admin/base_site.html from within the default
Django admin template directory in the source code of Django itself
(django/contrib/admin/templates) into an admin subdirectory of
whichever directory you're using in TEMPLATE_DIRS. For example, if
your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above,
then copy django/contrib/admin/templates/admin/base_site.html to /home/
my_username/mytemplates/admin/base_site.html. Don't forget that admin
subdirectory.

I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
templates/admin/base_site.html.

I have no idea where this is supposed to be copied and pasted to.

Any help please?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help getting started.....I think it is installed correctly

2011-01-01 Thread Anthony Pearce
Thank you, that helps.  Will give it a shot.

On Jan 2, 10:00 am, Blue Cuenca <azue...@gmail.com> wrote:
> /home/mycode or /home is a linux location.  Apparently, you are using
> windows.
>
> I would suggest creating a folder for all your django projects, say
> C:\DjangoProjects\ , and run django-admin.py from there.
>
> You do not want to put your django project folder in your www folder,
> since that may allow access to the sources themselves, instead of
> running them to create the html.
>
> On 1/2/2011 12:14 AM, Anthony Pearce wrote:
>
>
>
> > Quote from "Writing your first Django app, part 1":
>
> >>From the command line, cd into a directory where you d like to store
> > your code, then run the command django-admin.py startproject mysite.
> > This will create a mysite directory in your current directory.
>
> > Put your code in some directory outside of the document root, such as /
> > home/mycode.
>
> > OK, please explain where /hom/mycode should be located.  Is it
> > directly on the C:, or like I have a www folder for playing with html,
> > or within the Python directory somewhere?   Sorry, but I'm looking at
> > this again for the first time in over a year, and need a bump start.- Hide 
> > quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help getting started.....I think it is installed correctly

2011-01-01 Thread Anthony Pearce
OK thank you. One last question though. What makes a folder private?
Sorry but I really am a noob at this.

On Jan 2, 3:31 am, Acorn <shiniest.ac...@gmail.com> wrote:
> You can put your code anywhere you like although you shouldn't put it
> anywhere public.
>
> Just pick a private folder somewhere and let django-admin.py set up the 
> folder.
>
> On 1 January 2011 16:14, Anthony Pearce <coden...@gmail.com> wrote:
>
>
>
> > Quote from "Writing your first Django app, part 1":
>
> > From the command line, cd into a directory where you’d like to store
> > your code, then run the command django-admin.py startproject mysite.
> > This will create a mysite directory in your current directory.
>
> > Put your code in some directory outside of the document root, such as /
> > home/mycode.
>
> > OK, please explain where /hom/mycode should be located.  Is it
> > directly on the C:, or like I have a www folder for playing with html,
> > or within the Python directory somewhere?   Sorry, but I'm looking at
> > this again for the first time in over a year, and need a bump start.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Help getting started.....I think it is installed correctly

2011-01-01 Thread Anthony Pearce
Quote from "Writing your first Django app, part 1":

>From the command line, cd into a directory where you’d like to store
your code, then run the command django-admin.py startproject mysite.
This will create a mysite directory in your current directory.

Put your code in some directory outside of the document root, such as /
home/mycode.


OK, please explain where /hom/mycode should be located.  Is it
directly on the C:, or like I have a www folder for playing with html,
or within the Python directory somewhere?   Sorry, but I'm looking at
this again for the first time in over a year, and need a bump start.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.