From c464645cc303385392b34ab4d841471bf21243e0 Mon Sep 17 00:00:00 2001 From: Audrey Roy Date: Sat, 18 May 2013 13:17:15 +0200 Subject: [PATCH] Enabled admin at admin/ in example. Put admin2 at admin2/. --- djadmin2/urls.py | 3 ++- djadmin2/views.py | 2 +- example/example/settings.py | 3 +-- example/example/urls.py | 10 ++++------ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/djadmin2/urls.py b/djadmin2/urls.py index a06510f..dc16b6e 100644 --- a/djadmin2/urls.py +++ b/djadmin2/urls.py @@ -21,6 +21,8 @@ urlpatterns = patterns('', view=views.ModelListView.as_view(), name="model_list" ), +) + """ url( regex=r'^(?P[_\-\w]+)/(?P[_\-\w]+)/(?P[\w]+)/$', @@ -43,4 +45,3 @@ urlpatterns = patterns('', name="model_delete" ) """ -) \ No newline at end of file diff --git a/djadmin2/views.py b/djadmin2/views.py index 4e548c7..701ab35 100644 --- a/djadmin2/views.py +++ b/djadmin2/views.py @@ -20,7 +20,7 @@ class IndexView(ListView): #(LoginRequiredMixin, StaffuserRequiredMixin, ListVie return get_admin2s() -class ModelListView(object): +class ModelListView(ListView): pass diff --git a/example/example/settings.py b/example/example/settings.py index 732706d..ecf7331 100644 --- a/example/example/settings.py +++ b/example/example/settings.py @@ -115,8 +115,7 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', - # Uncomment the next line to enable the admin: - # 'django.contrib.admin', + 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'djadmin2', diff --git a/example/example/urls.py b/example/example/urls.py index 741ebc2..5de2285 100644 --- a/example/example/urls.py +++ b/example/example/urls.py @@ -1,17 +1,15 @@ from django.conf.urls import patterns, include, url +from django.contrib import admin -# Uncomment the next two lines to enable the admin: -# from django.contrib import admin -# admin.autodiscover() +admin.autodiscover() urlpatterns = patterns('', # Examples: - url(r'^$', include('djadmin2.urls')), + url(r'^admin2/$', include('djadmin2.urls')), # url(r'^example/', include('example.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)), + url(r'^admin/', include(admin.site.urls)), )