mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
AC-170 Disable REST session auth and Django admin by default.
This commit is contained in:
parent
ccbef21c42
commit
a25a162229
@ -1,9 +1,13 @@
|
||||
# Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
# Django admin isn't officially supported!
|
||||
|
||||
# Python
|
||||
import json
|
||||
import urllib
|
||||
|
||||
# Django
|
||||
from django.conf.urls import *
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.util import unquote
|
||||
@ -15,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.admin import UserAdmin
|
||||
|
||||
# AWX
|
||||
from awx.lib.compat import format_html
|
||||
from awx.main.models import *
|
||||
from awx.main.forms import *
|
||||
|
@ -117,7 +117,6 @@ ROOT_URLCONF = 'awx.urls'
|
||||
WSGI_APPLICATION = 'awx.wsgi.application'
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.messages',
|
||||
@ -133,6 +132,8 @@ INSTALLED_APPS = (
|
||||
'awx.main',
|
||||
'awx.api',
|
||||
'awx.ui',
|
||||
# Django admin is disabled and not supported by default.
|
||||
#'django.contrib.admin',
|
||||
)
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
@ -144,7 +145,7 @@ REST_FRAMEWORK = {
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||
'rest_framework.authentication.BasicAuthentication',
|
||||
'awx.api.authentication.TokenAuthentication',
|
||||
'rest_framework.authentication.SessionAuthentication',
|
||||
#'rest_framework.authentication.SessionAuthentication',
|
||||
),
|
||||
'DEFAULT_PERMISSION_CLASSES': (
|
||||
'awx.api.permissions.ModelAccessPermission',
|
||||
|
12
awx/urls.py
12
awx/urls.py
@ -22,7 +22,13 @@ if 'django.contrib.admin' in settings.INSTALLED_APPS:
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += patterns('awx.main.views',
|
||||
url(r'^(?:admin/)?403.html$', 'handle_403'),
|
||||
url(r'^(?:admin/)?404.html$', 'handle_404'),
|
||||
url(r'^(?:admin/)?500.html$', 'handle_500'),
|
||||
url(r'^403.html$', 'handle_403'),
|
||||
url(r'^404.html$', 'handle_404'),
|
||||
url(r'^500.html$', 'handle_500'),
|
||||
)
|
||||
if 'django.contrib.admin' in settings.INSTALLED_APPS:
|
||||
urlpatterns += patterns('awx.main.views',
|
||||
url(r'^admin/403.html$', 'handle_403'),
|
||||
url(r'^admin/404.html$', 'handle_404'),
|
||||
url(r'^admin/500.html$', 'handle_500'),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user