# Path: sh00t/utils.py
# def get_secret_key(secret_file):
#     secret_key = " "
#     # Do not create secret for migrate
#     if "manage.py" == sys.argv[0]:
#         if "migrate" == sys.argv[1]:
#             return secret_key
# 
#     try:
#         secret_key = open(secret_file).read().strip()
#     except IOError:
#         secret_key = generate_secret_key(secret_file)
#     return secret_key


import os
from .utils import get_secret_key
USE_L10N = True
USE_TZ = True

THIS_DIR = os.path.dirname(os.path.abspath(__file__))
DEFAULT_USERNAME = "sh00t"
DEFAULT_PASSWORD = DEFAULT_USERNAME

LOGIN_URL = '/admin/login/'

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = 'staticfiles'
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'app/static'),
)

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAdminUser',
    ],
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
    'PAGE_SIZE': 20,
}

SECRET_FILE = os.path.join(THIS_DIR, 'secret.txt')

try:
    SECRET_KEY
except NameError:

# Path: sh00t/utils.py
# def get_secret_key(secret_file):
#     secret_key = " "
#     # Do not create secret for migrate
#     if "manage.py" == sys.argv[0]:
#         if "migrate" == sys.argv[1]:
#             return secret_key
# 
#     try:
#         secret_key = open(secret_file).read().strip()
#     except IOError:
#         secret_key = generate_secret_key(secret_file)
#     return secret_key


# Path: sh00t/settings.py
import os
from .utils import get_secret_key

USE_L10N = True
USE_TZ = True

THIS_DIR = os.path.dirname(os.path.abspath(__file__))
DEFAULT_USERNAME = "sh00t"
DEFAULT_PASSWORD = DEFAULT_USERNAME

LOGIN_URL = '/admin/login/'

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = 'staticfiles'
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'app/static'),
)

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAdminUser',
    ],
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
    'PAGE_SIZE': 20,
}

SECRET_FILE = os.path.join(THIS_DIR, 'secret.txt')

try:
    SECRET_KEY
except NameError:

    SECRET_KEY = get_secret_key(SECRET_FILE)  # Defined in utils.py