Adjustments for initial public launch of OpenCloud
diff --git a/planetstack/core/plus/__init__.py b/planetstack/core/plus/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/planetstack/core/plus/__init__.py
@@ -0,0 +1 @@
+
diff --git a/planetstack/core/plus/sites.py b/planetstack/core/plus/sites.py
new file mode 100644
index 0000000..da86a10
--- /dev/null
+++ b/planetstack/core/plus/sites.py
@@ -0,0 +1,31 @@
+#sites.py
+
+from django.contrib.admin.sites import AdminSite
+
+
+class AdminMixin(object):
+ """Mixin for AdminSite to allow custom dashboard views."""
+
+ def __init__(self, *args, **kwargs):
+ return super(AdminMixin, self).__init__(*args, **kwargs)
+
+ def get_urls(self):
+ """Add our dashboard view to the admin urlconf. Deleted the default index."""
+ from django.conf.urls import patterns, url
+ from views import DashboardWelcomeView
+
+ urls = super(AdminMixin, self).get_urls()
+ del urls[0]
+ custom_url = patterns('',
+ url(r'^$', self.admin_view(DashboardWelcomeView.as_view()),
+ name="index")
+ )
+
+ return custom_url + urls
+
+
+class SitePlus(AdminMixin, AdminSite):
+ """
+ A Django AdminSite with the AdminMixin to allow registering custom
+ dashboard view.
+ """
diff --git a/planetstack/core/plus/views.py b/planetstack/core/plus/views.py
new file mode 100644
index 0000000..e5451ff
--- /dev/null
+++ b/planetstack/core/plus/views.py
@@ -0,0 +1,11 @@
+#views.py
+from django.views.generic import TemplateView
+
+
+class DashboardWelcomeView(TemplateView):
+ template_name = 'admin/dashboard/welcome.html'
+
+ def get(self, request, *args, **kwargs):
+ context = self.get_context_data(**kwargs)
+
+ return self.render_to_response(context=context)