Hi,

    In admin.py yourprojectname is missing. Instead of from
news.models import Articles, try from yourprojectname.news.models
import Articles.
Lokesh S

On Jul 18, 7:06 pm, arthur_mwai <mwaigar...@gmail.com> wrote:
> I wanted to register an app called "news" in the admin site and i got
> this error:
>
> NameError at /admin/
> name 'news' is not defined
> Request Method: GET
> Request URL:    http://127.0.0.1:8000/admin/
> Django Version: 1.3
> Exception Type: NameError
> Exception Value:
> name 'news' is not defined
> Exception Location:     /home/arthur/code_testing/news/admin.py in
> <module>, line 3
>
> here is my admi.py:
>
> from django.contrib import admin
> from news.models import Articles
>
> class ArticlesAdmin(admin.ModelAdmin):
>   pass
> admin.site.register(Articles,ArticlesAdmin)
>
> and below is my urls.py
> from django.conf.urls.defaults import patterns, include, url
>
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
>     # Examples:
>     # url(r'^$', 'code_testing.views.home', name='home'),
>     # url(r'^code_testing/', include('code_testing.foo.urls')),
>
>     # Uncomment the admin/doc line below to enable admin
> documentation:
>     # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
>     # Uncomment the next line to enable the admin:
>     url(r'^admin/', include(admin.site.urls)),
> )

-- 
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.

Reply via email to