Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
da86e0d8
authored
Feb 09, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
circle: disable django admin in production
Closes #369
parent
1e514d5b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
1 deletions
+13
-1
circle/circle/settings/base.py
+2
-0
circle/circle/settings/local.py
+2
-0
circle/circle/urls.py
+6
-1
circle/dashboard/context_processors.py
+1
-0
circle/dashboard/templates/dashboard/base.html
+2
-0
No files found.
circle/circle/settings/base.py
View file @
da86e0d8
...
@@ -559,3 +559,5 @@ MAX_NODE_RAM = get_env_variable("MAX_NODE_RAM", 1024)
...
@@ -559,3 +559,5 @@ MAX_NODE_RAM = get_env_variable("MAX_NODE_RAM", 1024)
# Url to download the client: (e.g. http://circlecloud.org/client/download/)
# Url to download the client: (e.g. http://circlecloud.org/client/download/)
CLIENT_DOWNLOAD_URL
=
get_env_variable
(
'CLIENT_DOWNLOAD_URL'
,
'http://circlecloud.org/client/download/'
)
CLIENT_DOWNLOAD_URL
=
get_env_variable
(
'CLIENT_DOWNLOAD_URL'
,
'http://circlecloud.org/client/download/'
)
ADMIN_ENABLED
=
False
circle/circle/settings/local.py
View file @
da86e0d8
...
@@ -113,3 +113,5 @@ if DEBUG:
...
@@ -113,3 +113,5 @@ if DEBUG:
PIPELINE_DISABLED_COMPILERS
=
(
PIPELINE_DISABLED_COMPILERS
=
(
'pipeline.compilers.less.LessCompiler'
,
'pipeline.compilers.less.LessCompiler'
,
)
)
ADMIN_ENABLED
=
True
circle/circle/urls.py
View file @
da86e0d8
...
@@ -41,7 +41,6 @@ urlpatterns = patterns(
...
@@ -41,7 +41,6 @@ urlpatterns = patterns(
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url
(
r'^$'
,
lambda
x
:
redirect
(
reverse
(
"dashboard.index"
))),
url
(
r'^$'
,
lambda
x
:
redirect
(
reverse
(
"dashboard.index"
))),
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^network/'
,
include
(
'network.urls'
)),
url
(
r'^network/'
,
include
(
'network.urls'
)),
url
(
r'^dashboard/'
,
include
(
'dashboard.urls'
)),
url
(
r'^dashboard/'
,
include
(
'dashboard.urls'
)),
...
@@ -79,6 +78,12 @@ if 'rosetta' in settings.INSTALLED_APPS:
...
@@ -79,6 +78,12 @@ if 'rosetta' in settings.INSTALLED_APPS:
url
(
r'^rosetta/'
,
include
(
'rosetta.urls'
)),
url
(
r'^rosetta/'
,
include
(
'rosetta.urls'
)),
)
)
if
settings
.
ADMIN_ENABLED
:
urlpatterns
+=
patterns
(
''
,
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
)
if
get_env_variable
(
'DJANGO_SAML'
,
'FALSE'
)
==
'TRUE'
:
if
get_env_variable
(
'DJANGO_SAML'
,
'FALSE'
)
==
'TRUE'
:
urlpatterns
+=
patterns
(
urlpatterns
+=
patterns
(
...
...
circle/dashboard/context_processors.py
View file @
da86e0d8
...
@@ -29,4 +29,5 @@ def notifications(request):
...
@@ -29,4 +29,5 @@ def notifications(request):
def
extract_settings
(
request
):
def
extract_settings
(
request
):
return
{
return
{
'COMPANY_NAME'
:
getattr
(
settings
,
"COMPANY_NAME"
,
None
),
'COMPANY_NAME'
:
getattr
(
settings
,
"COMPANY_NAME"
,
None
),
'ADMIN_ENABLED'
:
getattr
(
settings
,
"ADMIN_ENABLED"
,
False
),
}
}
circle/dashboard/templates/dashboard/base.html
View file @
da86e0d8
...
@@ -20,9 +20,11 @@
...
@@ -20,9 +20,11 @@
{% if user.is_authenticated and user.pk and not request.token_user %}
{% if user.is_authenticated and user.pk and not request.token_user %}
<ul
class=
"nav navbar-nav navbar-right"
id=
"dashboard-menu"
>
<ul
class=
"nav navbar-nav navbar-right"
id=
"dashboard-menu"
>
{% if user.is_superuser %}
{% if user.is_superuser %}
{% if ADMIN_ENABLED %}
<li>
<li>
<a
href=
"/admin/"
><i
class=
"fa fa-cogs"
></i>
{% trans "Admin" %}
</a>
<a
href=
"/admin/"
><i
class=
"fa fa-cogs"
></i>
{% trans "Admin" %}
</a>
</li>
</li>
{% endif %}
<li>
<li>
<a
href=
"/network/"
><i
class=
"fa fa-globe"
></i>
{% trans "Network" %}
</a>
<a
href=
"/network/"
><i
class=
"fa fa-globe"
></i>
{% trans "Network" %}
</a>
</li>
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment