Skip to content

Commit fca25e4

Browse files
committedJun 25, 2015
Calling django.setup() before CoG installation can take place.
1 parent 6ee2763 commit fca25e4

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed
 

‎__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default_app_config = 'cog.apps.CogConfig'

‎apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
class CogConfig(AppConfig):
4+
5+
name = 'cog'
6+
verbose_name = "CoG Scientific Projects Web Environment"

‎cog/installation/install.py

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from cog.plugins.esgf.security import esgfDatabaseManager
2323
from django_openid_auth.models import UserOpenID
2424

25+
from django import setup as django_setup
2526
from django.core import management
2627
import sqlalchemy
2728
import datetime
@@ -36,6 +37,9 @@ class CoGInstall(object):
3637

3738
def __init__(self):
3839

40+
# in stand-alone scripts, must explicitly invoke django.setup() to populate the application registry before anything can be done
41+
django_setup()
42+
3943
# read cog_settings.cfg
4044
self.siteManager = SiteManager()
4145

‎settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
'django_openid_auth',
197197
'grappelli',
198198
'filebrowser',
199-
'django.contrib.admin',
199+
'django.contrib.admin.apps.SimpleAdminConfig',
200200
'django_comments',
201201
'django.contrib.webdesign',
202202
'django.contrib.staticfiles',

0 commit comments

Comments
 (0)
Please sign in to comment.