Re: Keep getting NameError at /admin/

2009-02-09 Thread djandrow

You need to remove the # from:

# from django.contrib import admin
# admin.autodiscover()

I had the same thing earlier.

Heres some more stuff about setting up the admin if you want to read
it:

http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02

On Feb 9, 11:24 pm, "claudio.br...@googlemail.com"
 wrote:
> On 9 Feb, 19:16, Daniel Roseman  wrote:
>
> > On Feb 9, 6:57 pm, "claudio.br...@googlemail.com"
>
> >  wrote:
> > > Hi Alex
>
> > > Yes I have the line from django.contrib import admin" in urls.py
>
> > You're going to need to post the whole urls.py. It's a bit hard to
> > understand why you're getting that error if you do have that line, and
> > it's not commented out. Please show us the whole file, preferably by
> > posting it somewhere like dpaste.com.
>
> > --
> > DR.
>
> Okay I stripped everything else out of the urls.py and am left with
> the following
>
> ---
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> # from django.contrib import admin
> # admin.autodiscover()
>
> urlpatterns = patterns('',
>     # Example:
>     # (r'^mysite/', include('mysite.foo.urls')),
>
>     # Uncomment the admin/doc line below and add
> 'django.contrib.admindocs'
>     # to INSTALLED_APPS to enable admin documentation:
>     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
>     # Uncomment the next line to enable the admin:
>      (r'^admin/(.*)', admin.site.root),
> )
>
> and I still get the same error
>
> K
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Keep getting NameError at /admin/

2009-02-09 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 6:24 PM, claudio.br...@googlemail.com <
claudio.br...@googlemail.com> wrote:

>
>
>
> On 9 Feb, 19:16, Daniel Roseman  wrote:
> > On Feb 9, 6:57 pm, "claudio.br...@googlemail.com"
> >
> >  wrote:
> > > Hi Alex
> >
> > > Yes I have the line from django.contrib import admin" in urls.py
> >
> > You're going to need to post the whole urls.py. It's a bit hard to
> > understand why you're getting that error if you do have that line, and
> > it's not commented out. Please show us the whole file, preferably by
> > posting it somewhere like dpaste.com.
> >
> > --
> > DR.
>
> Okay I stripped everything else out of the urls.py and am left with
> the following
>
> ---
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> # from django.contrib import admin
> # admin.autodiscover()
>
> urlpatterns = patterns('',
># Example:
># (r'^mysite/', include('mysite.foo.urls')),
>
># Uncomment the admin/doc line below and add
> 'django.contrib.admindocs'
># to INSTALLED_APPS to enable admin documentation:
># (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
># Uncomment the next line to enable the admin:
> (r'^admin/(.*)', admin.site.root),
> )
>
> and I still get the same error
>
> K
>
> >
>
You have the import commented out, this means that code never gets
executed.  I would recommend reading up a bit more on python before
proceeding.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Keep getting NameError at /admin/

2009-02-09 Thread claudio.br...@googlemail.com



On 9 Feb, 19:16, Daniel Roseman  wrote:
> On Feb 9, 6:57 pm, "claudio.br...@googlemail.com"
>
>  wrote:
> > Hi Alex
>
> > Yes I have the line from django.contrib import admin" in urls.py
>
> You're going to need to post the whole urls.py. It's a bit hard to
> understand why you're getting that error if you do have that line, and
> it's not commented out. Please show us the whole file, preferably by
> posting it somewhere like dpaste.com.
>
> --
> DR.

Okay I stripped everything else out of the urls.py and am left with
the following

---

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
# Example:
# (r'^mysite/', include('mysite.foo.urls')),

# Uncomment the admin/doc line below and add
'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
 (r'^admin/(.*)', admin.site.root),
)

and I still get the same error

K

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Keep getting NameError at /admin/

2009-02-09 Thread Daniel Roseman

On Feb 9, 6:57 pm, "claudio.br...@googlemail.com"
 wrote:
> Hi Alex
>
> Yes I have the line from django.contrib import admin" in urls.py
>

You're going to need to post the whole urls.py. It's a bit hard to
understand why you're getting that error if you do have that line, and
it's not commented out. Please show us the whole file, preferably by
posting it somewhere like dpaste.com.

--
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-users@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: Keep getting NameError at /admin/

2009-02-09 Thread claudio.br...@googlemail.com

Hi Alex

Yes I have the line from django.contrib import admin" in urls.py

On 9 Feb, 16:20, Alex Gaynor  wrote:
> On Mon, Feb 9, 2009 at 11:11 AM, claudio.br...@googlemail.com <
>
>
>
> claudio.br...@googlemail.com> wrote:
>
> > Hi
>
> > I am new to django and have just started to play. I have a working
> > (small) app but wanted to turn on the admin console for the project. I
> > edited the settings.py to include the admin module and now get the
> > following errors
>
> > NameError at /admin/
>
> > name 'admin' is not defined
>
> > Request Method: GET
> > Request URL:http://127.0.0.1:8000/admin/
> > Exception Type: NameError
> > Exception Value:
>
> > name 'admin' is not defined
>
> > although I first saw the error using django 1.0.2, I can re-create it
> > using 0.96. I have come to the conclusion that I am doing something
> > wrong but can anyone tell me what?
>
> > the relevant part of my settings.py looks like;
>
> > INSTALLED_APPS = (
> >'django.contrib.auth',
> >'django.contrib.contenttypes',
> >'django.contrib.sessions',
> >'django.contrib.sites',
> >'django.contrib.admin',
> > )
>
> > and URLS looks like
>
> ># Uncomment the next line to enable the admin:
> > (r'^admin/(.*)', admin.site.root),
> > )
>
> > i have removed evrything else from the project and app and still get
> > the errror, at the top of the urls.py it makes no difference whether I
> > have the line admin.autodiscover() or not as I still get the error
>
> > Regards
>
> > K
>
> Do you have the line "from django.contrib import admin" in your urls.py?
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Keep getting NameError at /admin/

2009-02-09 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 11:11 AM, claudio.br...@googlemail.com <
claudio.br...@googlemail.com> wrote:

>
> Hi
>
> I am new to django and have just started to play. I have a working
> (small) app but wanted to turn on the admin console for the project. I
> edited the settings.py to include the admin module and now get the
> following errors
>
> NameError at /admin/
>
> name 'admin' is not defined
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/admin/
> Exception Type: NameError
> Exception Value:
>
> name 'admin' is not defined
>
> although I first saw the error using django 1.0.2, I can re-create it
> using 0.96. I have come to the conclusion that I am doing something
> wrong but can anyone tell me what?
>
> the relevant part of my settings.py looks like;
>
> INSTALLED_APPS = (
>'django.contrib.auth',
>'django.contrib.contenttypes',
>'django.contrib.sessions',
>'django.contrib.sites',
>'django.contrib.admin',
> )
>
> and URLS looks like
>
>
># Uncomment the next line to enable the admin:
> (r'^admin/(.*)', admin.site.root),
> )
>
> i have removed evrything else from the project and app and still get
> the errror, at the top of the urls.py it makes no difference whether I
> have the line admin.autodiscover() or not as I still get the error
>
> Regards
>
> K
>
> >
>
Do you have the line "from django.contrib import admin" in your urls.py?

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---