From 31223b0a1ff67f4a35f6e39d6dafa8ee68716550 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Thu, 16 Sep 2010 11:28:31 -0400 Subject: [PATCH] Enabling the admin system --- analyzer/admin.py | 9 +++++++++ settings.py | 4 ++-- urls.py | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 analyzer/admin.py diff --git a/analyzer/admin.py b/analyzer/admin.py new file mode 100644 index 0000000..14f7653 --- /dev/null +++ b/analyzer/admin.py @@ -0,0 +1,9 @@ +from mtgweb.analyzer.models import Deck, Card +from django.contrib import admin + +class CardAdmin(admin.ModelAdmin): + search_fields = ['name'] + list_filter = ['type'] + +admin.site.register(Card, CardAdmin) +admin.site.register(Deck) diff --git a/settings.py b/settings.py index f95ddf4..2b901f5 100755 --- a/settings.py +++ b/settings.py @@ -55,7 +55,7 @@ MEDIA_URL = '' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/media/' +ADMIN_MEDIA_PREFIX = 'http://phoenixinquis.is-a-geek.org/admin_media/' # Make this unique, and don't share it with anybody. SECRET_KEY = 'w((e#e75atr#mvb+4793wh81(rqqfw#9h7&5bk!_=z9&8o88_d' @@ -91,6 +91,6 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.messages', # Uncomment the next line to enable the admin: - # 'django.contrib.admin', + 'django.contrib.admin', 'mtgweb.analyzer' ) diff --git a/urls.py b/urls.py index 7622031..a8a7b94 100755 --- a/urls.py +++ b/urls.py @@ -1,8 +1,8 @@ from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: -# from django.contrib import admin -# admin.autodiscover() +from django.contrib import admin +admin.autodiscover() urlpatterns = patterns('', # Example: @@ -15,5 +15,5 @@ urlpatterns = patterns('', # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: - # (r'^admin/', include(admin.site.urls)), + (r'^admin/', include(admin.site.urls)), )