-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow initconfig to execute on first run
Signed-off-by: Sergio Oliveira <sergio@tracy.com.br>
- Loading branch information
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
|
||
import os | ||
import sys | ||
|
||
from django.core.management import ManagementUtility | ||
|
||
from colab.management.commands import initconfig | ||
|
||
def execute_from_command_line(argv=None): | ||
""" | ||
A simple method that runs a ManagementUtility. | ||
""" | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings") | ||
from django.conf import settings | ||
|
||
utility = ManagementUtility(argv) | ||
utility.execute() | ||
if not hasattr(settings, 'SECRET_KEY') and 'initconfig' in sys.argv: | ||
command = initconfig.Command() | ||
command.handle() | ||
else: | ||
utility = ManagementUtility(argv) | ||
utility.execute() |