44π
After adding and registering your admin:
# app/admin.py
class YourModelAdmin(admin.ModelAdmin):
pass
admin.site.register(YourModel, YourModelAdmin)
Make sure your app is in your project settings.py
:
# settings.py
INSTALLED_APPS = (
# other apps ...
'app',
)
Sync your project for that model if you have not done so already:
python manage.py syncdb
Restart your server, CTRL-C
:
python manage.py runserver
13π
In such a situation is also a good practice to check if the user logged in to the admin panel has rights to manage such a model. If they do then you could change your code to access the functions as root.
- Django's get_current_language always returns "en"
- Is there a way to render a html page without view model?
- Create a canonical "parent" product in Django Oscar programmatically
- How do I simulate connection errors and request timeouts in python unit tests
4π
I have the experience, that sometimes after changing an admin.py the dev-sever wonβt be restarted. in that case touch settings.py
helps.
- How can I schedule a Task to execute at a specific time using celery?
- How do I simulate connection errors and request timeouts in python unit tests
2π
I think the checklist in Thierryβs answer is almost definitive, but make sure that urls.py
contains admin.autodiscover()
to load INSTALLED_APPS
admin.py modules.
# urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
('^admin/', include(admin.site.urls)),
)
More info in the django docs.
- How do I simulate connection errors and request timeouts in python unit tests
- Is there a way to render a html page without view model?
1π
Have you added the application to your installed apps? That has happened to me both one and two times. π Otherwise it would be useful for us to see the code to help you.
1π
Also make sure there are no syntax errors in your admin.py or anything. That can cause an app to fail to be registered with the AdminSite.
0π
Iβve faced the same problem, but it was a little tricky than yours.
Consider, that you have a project with, say, five or even more apps. For me it is more obvious to register all models in just one admin.py file, so I have decided to do it in one place β core directory. Of course, it was not an app, so none of models showed up on admin page.
- How to create custom groups in django from group
- Is there a way to render a html page without view model?
-1π
comment out the some lines in urls.py
see docs for more details
admin.autodiscover()
urlpatterns = patterns('',
('^admin/', include(admin.site.urls)),
)