Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Practical django Projects, 2nd ed., source code
    text
    copied!<p>In James Bennett's "Practical django Projects" (2nd edition) the author builds a content management system, leveraging off of django.contrib.admin. The problem is that it doesn't work.</p> <p>I'm in chapter three, where he adds a keyword search capability, by adding a new admin module. The problem is is that I can't get it to work. Browsing around the web, I find constant complaints that despite the claims in the book, the author has not made working source available. The core of the problem is that he seems to be depending upon internals of the django platform that are changing with every minor release, hence his solutions prove fragile.</p> <p>Still, I'd like to work my way through this.</p> <p>In chapter three, he supposedly adds a new search keyword admin function, by creating a new SearchKeyword model, and then creating and registering a SearchKeywordAdmin class.</p> <p>The model (in cms/search/models.py:</p> <pre><code>class SearchKeyword(models.Model): keyword = models.CharField(max_length=50) page = models.ForeignKey(FlatPage) def __unicode__(self): return self.keyword </code></pre> <p>The class (in cms/search/admin.py):</p> <pre><code>class SearchKeywordAdmin(admin.ModelAdmin): pass admin.site.register(SearchKeyword, SearchKeywordAdmin) </code></pre> <p>I see no compile errors, but I see nothing on the admin page.</p> <p>Either I'm doing something wrong, or something in django.contrib.admin has changed, to make this code no longer work.</p> <p>Anyone have any ideas which? And what I might need to do to make this work?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload