diff --git a/lib/settings/defaults.py b/lib/settings/defaults.py index 5b07b47a36..0be0d0bfa8 100644 --- a/lib/settings/defaults.py +++ b/lib/settings/defaults.py @@ -60,13 +60,19 @@ USE_L10N = True USE_TZ = True +STATICFILES_DIRS = ( + #os.path.join(BASE_DIR, 'static'), +) + +STATIC_ROOT = os.path.join(BASE_DIR, 'public', 'static') # FIXME: Is this where we want it? + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/dev/howto/static-files/ STATIC_URL = '/static/' # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # FIXME: Is this where we want it? +MEDIA_ROOT = os.path.join(BASE_DIR, 'public', 'media') # FIXME: Is this where we want it? # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). @@ -87,6 +93,12 @@ TEMPLATE_CONTEXT_PROCESSORS += ( ) MIDDLEWARE_CLASSES += ( + #'django.middleware.transaction.TransactionMiddleware', + #'devserver.middleware.DevServerMiddleware', +) + +TEMPLATE_DIRS = ( + os.path.join(BASE_DIR, 'templates'), ) ROOT_URLCONF = 'lib.urls' @@ -108,3 +120,17 @@ INSTALLED_APPS = ( 'tastypie', 'django_extensions', ) + +INTERNAL_IPS = ('127.0.0.1',) + +DEVSERVER_DEFAULT_ADDR = '0.0.0.0' +DEVSERVER_DEFAULT_PORT = '8013' +DEVSERVER_MODULES = ( + 'devserver.modules.sql.SQLRealTimeModule', + 'devserver.modules.sql.SQLSummaryModule', + 'devserver.modules.profile.ProfileSummaryModule', + #'devserver.modules.ajax.AjaxDumpModule', + #'devserver.modules.profile.MemoryUseModule', + #'devserver.modules.cache.CacheSummaryModule', + #'devserver.modules.profile.LineProfilerModule', +) diff --git a/lib/templates/admin/base_site.html b/lib/templates/admin/base_site.html new file mode 100644 index 0000000000..5463f7f4b1 --- /dev/null +++ b/lib/templates/admin/base_site.html @@ -0,0 +1,36 @@ +{# Admin site customizations. #} +{% extends "admin/base.html" %} +{% load i18n %} + +{% block title %}{{ title }} | {% trans 'Ansible Commander Admin' %}{% endblock %} + +{% block extrastyle %} +{{ block.super }} +{% endblock %} + +{% block extrahead %} +{{ block.super }} +{% endblock %} + +{% block blockbots %} +{{ block.super }} +{% endblock %} + +{% block branding %} +

{% trans 'Ansible Commander Admin' %}

+{% endblock %} + +{% block userlinks %} +{{ block.super }} +{% endblock %} + +{% block nav-global %} +{% if user.is_active and user.is_staff and not is_popup %} +{# Placeholder for version/hostname info. #} +{% endif %} +{{ block.super }} +{% endblock %} + +{% block content_title %} +{{ block.super }} +{% endblock %} diff --git a/lib/urls.py b/lib/urls.py index 88bbab2cc3..c4382e521d 100644 --- a/lib/urls.py +++ b/lib/urls.py @@ -1,16 +1,14 @@ -from django.conf.urls.defaults import * - -# Uncomment the next two lines to enable the admin: -# from django.contrib import admin -# admin.autodiscover() +from django.conf import settings +from django.conf.urls import * urlpatterns = patterns('', # Example: - # (r'^acom/', include('acom.foo.urls')), - - # Uncomment the admin/doc line below to enable admin documentation: - # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - - # Uncomment the next line to enable the admin: - # (r'^admin/', include(admin.site.urls)), + # (r'^foo/', include('lib.foo.urls')), ) + +if 'django.contrib.admin' in settings.INSTALLED_APPS: + from django.contrib import admin + admin.autodiscover() + urlpatterns += patterns('', + url(r'^admin/', include(admin.site.urls)), + )