Questions about setting up my first app in django tutorial

34 views
Skip to first unread message

Xiaofeng Feng

unread,
Apr 17, 2014, 12:03:03 AM4/17/14
to django...@googlegroups.com
I am now trying to set up my first app using django tutorial. However, I was stuck at adding the poll app in part 2. I think I followed all the steps and it goes well before this question. After I change admin.py with
from django.contrib import admin
from polls.models import Poll

admin.site.register(Poll)
as the tutorial says. The admin website does not change at all. Does anybody know why this happens? Thanks.

Jorge Andrés Vergara Ebratt

unread,
Apr 17, 2014, 8:24:12 AM4/17/14
to django...@googlegroups.com
Did you register the app in settings.py?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7bdb76f7-caf7-4c44-af6f-05f042494bed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jorge Andres Vergara Ebratt
#SoftwareDeveloper (Or at least trying to be)
@javebratt

Xiaofeng Feng

unread,
Apr 17, 2014, 10:51:51 AM4/17/14
to django...@googlegroups.com
Yes.
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'TestApp',
)

The last line TestApp is my first app.

Ramón Carrillo

unread,
Apr 18, 2014, 12:40:19 AM4/18/14
to django...@googlegroups.com
The file is probably in the wrong directory or you're naming it incorrectly.

It must be project_name/app_name/admin.py

Maybe you're placing it in project_name/admin.py or
project_name/project_name/admin.py
> https://groups.google.com/d/msgid/django-users/36c07290-ff33-4e3d-b142-26efd577c38c%40googlegroups.com.

Jason

unread,
Apr 18, 2014, 11:49:15 AM4/18/14
to django...@googlegroups.com
from django.contrib import admin
from polls.models import Poll

class PollAdmin(admin.ModelAdmin):
pass

admin.site.register(Poll, PollAdmin)
Reply all
Reply to author
Forward
0 new messages