Skip to main content
Glama
settings.pyโ€ข7.79 kB
""" Django settings for django_firebase_mcp project. Generated by 'django-admin startproject' using Django 5.2.1. For more information on this file, see https://docs.djangoproject.com/en/5.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/5.2/ref/settings/ """ import os from datetime import timedelta from pathlib import Path from dotenv import load_dotenv # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Load environment variables from .env file load_dotenv(BASE_DIR / '.env') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-(3c_58*ou+j^+ve0&x0kk%*$5!x*3+@@jnc(lwx$@r*kr%gy8o' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ['127.0.0.1', 'localhost'] CSRF_COOKIE_SECURE = False # Set to False for localhost development SESSION_COOKIE_SECURE = False # Set to False for localhost development AUTH_USER_MODEL = 'base_user.User' # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', # Required for allauth # Third party apps 'rest_framework', # Added DRF 'rest_framework.authtoken', # Token authentication 'rest_framework_simplejwt', # JWT authentication 'drf_spectacular', # Added drf-spectacular 'corsheaders', # CORS support # Authentication apps 'allauth', 'allauth.account', 'allauth.socialaccount', 'dj_rest_auth', 'dj_rest_auth.registration', # Local apps 'base', 'base_user', 'firebase_admin_mcp', # Add Firebase MCP app ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', # Add CORS middleware 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'allauth.account.middleware.AccountMiddleware', # Required for allauth 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'django_firebase_mcp.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'django_firebase_mcp.wsgi.application' # Database # https://docs.djangoproject.com/en/5.2/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/5.2/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.2/howto/static-files/ STATIC_URL = 'static/' # Default primary key field type # https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' REST_FRAMEWORK = { 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework_simplejwt.authentication.JWTAuthentication', ], 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', ], } SPECTACULAR_SETTINGS = { 'TITLE': 'django_firebase_mcp API', 'DESCRIPTION': 'API documentation for the django_firebase_mcp project.', 'VERSION': '1.0.0', 'COMPONENT_SPLIT_REQUEST': True, 'SCHEMA_PATH_PREFIX': '/api/', } # Django Sites Framework SITE_ID = 1 # -------------------------------------------------- ALLAUTH CONFIGURATIONS -------------------------------------------------- AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'allauth.account.auth_backends.AuthenticationBackend', ) ACCOUNT_USER_MODEL_USERNAME_FIELD = None ACCOUNT_EMAIL_VERIFICATION = "mandatory" ACCOUNT_LOGIN_METHODS = {"email"} ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True ACCOUNT_LOGIN_BY_CODE_ENABLED = True ACCOUNT_EMAIL_VERIFICATION_BY_CODE_ENABLED = False ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"] HEADLESS_ONLY = False LOGIN_REDIRECT_URL = "/" ACCOUNT_SIGNUP_REDIRECT_URL = "/" ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = "/" ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS = True # -------------------------------------------------- REST_AUTH -------------------------------------------------- REST_AUTH = { 'REGISTER_SERIALIZER': 'base_user.serializers.CustomRegisterSerializer', 'LOGIN_SERIALIZER': 'base_user.serializers.CustomLoginSerializer', 'USER_DETAILS_SERIALIZER': 'base_user.serializers.CustomUserDetailsSerializer', 'PASSWORD_RESET_USE_SITES_DOMAIN': True, 'USE_JWT': True, # 'JWT_AUTH_COOKIE': '', # 'JWT_AUTH_REFRESH_COOKIE': '', } REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'dj_rest_auth.jwt_auth.JWTCookieAuthentication', ), "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema" } # JWT Configuration SIMPLE_JWT = { 'ACCESS_TOKEN_LIFETIME': timedelta(days=1000), 'REFRESH_TOKEN_LIFETIME': timedelta(days=1000), } # Email Configuration (for development) EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # SMTP for email # EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # EMAIL_HOST = 'smtp.gmail.com' # EMAIL_PORT = 587 # EMAIL_HOST_USER = 'testinguser1110@gmail.com' # EMAIL_HOST_PASSWORD = 'unffuqgygrhbchxq' # EMAIL_USE_TLS = True # FROM_EMAIL = 'testinguser1110@gmail.com' # CORS Configuration (if needed for frontend) CORS_ALLOWED_ORIGINS = [ "http://localhost:3000", "http://127.0.0.1:3000", "http://localhost:8080", "http://127.0.0.1:8080", ] CORS_ALLOW_CREDENTIALS = True # Firebase MCP Configuration SERVICE_ACCOUNT_KEY_PATH = os.getenv( "SERVICE_ACCOUNT_KEY_PATH", "serviceAccountKey.json") FIREBASE_STORAGE_BUCKET = os.getenv("FIREBASE_STORAGE_BUCKET", "") ENABLE_FIRESTORE = True ENABLE_AUTH = True ENABLE_STORAGE = True MCP_TRANSPORT = os.getenv("MCP_TRANSPORT", "stdio") # "stdio" or "http" MCP_HTTP_PORT = int(os.getenv("MCP_HTTP_PORT", "8000")) # CORS settings for MCP CORS_ALLOW_ALL_ORIGINS = True CORS_ALLOW_CREDENTIALS = True CORS_ALLOWED_HEADERS = [ 'accept', 'accept-encoding', 'authorization', 'content-type', 'dnt', 'origin', 'user-agent', 'x-csrftoken', 'x-requested-with', ] CORS_ALLOW_METHODS = [ 'DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT', ]

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Highpolar-Softwares/django-firebase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server