In my django admin panel there are four items: "Groups", "Users", "Sites", and my custom model "Ads". All of it has button "Add" and "Change". System items' button works as usual. And my model's button "Add" redirect on blank page with title "add (1x1)", button "Change" redirect on blank page with title "ad (1x1)".
It happens even when I create project from Django tutorial https://docs.djangoproject.com/en/1.4/intro/tutorial01/
I use django's development server.
from django.db import models
class Ad(models.Model):
text = models.TextField()
tel = models.CharField(max_length=12)
pub_date = models.DateTimeField(auto_now_add=True)
checked = models.BooleanField(default=False)
def __unicode__(self):
return self.text[0:20]
from models import Ad
from django.contrib import admin
admin.site.register(Ad)
Very simple code.
How to get normal Add and Change pages?
UPD: System - Windows, browsers - Chrome, Firefox, Opera
I was seeing all the models in the admin but none of them were editable. I had no available actions. My urls.py
looked normal to me:
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
admin.autodiscover()
I moved admin.autodiscover()
to the top of the file, before the urlpatterns
declaration, and everything started working normally:
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With