from django.apps import AppConfig


class SsoConfig(AppConfig):
    name = 'sso'
    github_client_id = '844189c44c56ff04e727'
    github_client_secret = '0bfecee7a78ee0e800b6bff85b08c140b91be4cc'

import json
import os.path
from django.apps import AppConfig
from fmproject import settings


class SsoConfig(AppConfig):
    base_config = json.load(
        open(os.path.join(settings.BASE_DIR, 'fmproject', 'config.json'))
    )
    name = 'sso'
    github_client_id = base_config['github']['client_id']
    github_client_secret = base_config['github']['client_secret']


Load github config from external file
Load github config from external file

+ import json
+ import os.path
  from django.apps import AppConfig
+ from fmproject import settings
  
  
  class SsoConfig(AppConfig):
+     base_config = json.load(
+         open(os.path.join(settings.BASE_DIR, 'fmproject', 'config.json'))
+     )
      name = 'sso'
-     github_client_id = '844189c44c56ff04e727'
-     github_client_secret = '0bfecee7a78ee0e800b6bff85b08c140b91be4cc'
+     github_client_id = base_config['github']['client_id']
+     github_client_secret = base_config['github']['client_secret']
  
+ 
Load github config from external file
## Code Before:
from django.apps import AppConfig


class SsoConfig(AppConfig):
    name = 'sso'
    github_client_id = '844189c44c56ff04e727'
    github_client_secret = '0bfecee7a78ee0e800b6bff85b08c140b91be4cc'

## Instruction:
Load github config from external file
## Code After:
import json
import os.path
from django.apps import AppConfig
from fmproject import settings


class SsoConfig(AppConfig):
    base_config = json.load(
        open(os.path.join(settings.BASE_DIR, 'fmproject', 'config.json'))
    )
    name = 'sso'
    github_client_id = base_config['github']['client_id']
    github_client_secret = base_config['github']['client_secret']

