mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Updates to enable admin.
This commit is contained in:
@@ -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',
|
||||
)
|
||||
|
||||
36
lib/templates/admin/base_site.html
Normal file
36
lib/templates/admin/base_site.html
Normal file
@@ -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 %}
|
||||
<h1 id="site-name">{% trans 'Ansible Commander Admin' %}</h1>
|
||||
{% 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 %}
|
||||
22
lib/urls.py
22
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)),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user