6👍
at the top of your **url.py**
file, add the following code
from django.contrib import admin
admin.autodiscover()
So it that particular block should look something like the following
from django.conf.urls import patterns, include, url
**from django.contrib import admin
admin.autodiscover()**
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'examplesite.views.home', name='home'),
# url(r'^examplesite/', include('examplesite.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)),**
)
- 'Questions ' object is not iterable Django
- How to make Django's "DATETIME_FORMAT" active?
- How do I create a proper user with django allauth?
2👍
i change my urls.py like this… this should be the basic format
from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
- Django runserver custom database
- How to ensure task execution order per user using Celery, RabbitMQ and Django?
- Nullable TextField or empty string in Django model?
- Disable pylint warning E1101 when using enums
1👍
Well after an long, agonizing quest to fix this stupid problem, I FINALLY came across the answer! Another Django programmer ran into the same problem and found this:
IN THE PARENT OF ChoiceInLine (which you’ll see as ‘admin.StackedInline’ in the tutorial), THE L IN StackedInline SHOULD NOT BE CAPITALIZED … It’s as simple as that … thankyou SO much Karen Tracey …
- How to use full_clean() for data validation before saving in Django 1.5 gracefully?
- How to emit SocketIO event on the serverside
- Django admin – select reverse foreign key relationships (not create, I want to add available)
0👍
I suspect you don’t have from django.contrib import admin
in your model file where you defined ModelAdmin
classes, class ChoiceInline(admin.StackedInline):
.
- Docker compose for production and development
- Use a django built in filter in code (outside of a template)
- How to downgrade from Django 1.7 to Django 1.6
- Django Boolean Queryset Filter Not Working
- Django Admin + FORCE_SCRIPT_NAME + Login redirects incorrectly
0👍
You should place the admin code (everything after #COMMENTED OUT UNTIL I FIX THE ADMIN NAME) to admin.py
- Django, loop over all form errors
- Django-compressor: how to write to S3, read from CloudFront?
- Django – Search related fields
- Django filter on APIView
- How can I automatically let syncdb add a column (no full migration needed)
0👍
A way to fix this for me was to add this in the beginning of admin.py
:
from django.contrib import admin