only able to connect with home wifi ip
shivamgarg001
FREEOP
10 months ago
when i connect to credo.up.railway.app directly with my flutter app installed on my phone with wifi connected, it is able to connect and when i do it on mobile data (ip changes), it is not able to connect.
i am calling https://credo.up.railway.app/client/v1/login api endpoint fron frontend, and it is not connecting. at backend in settings.py (django drf) i have set this "
import os
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = os.getenv('DEBUG') == 'True' # Make sure DEBUG is a boolean (SHOULD BE FALSE IN PRODUCTION)
BASE_URL = os.getenv('BASE_URL', 'http://0.0.0.0:8080') # Default to localhost if not defined
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "credo.up.railway.app", "*", "0.0.0.0"]
# Application definition
INSTALLED_APPS = [
# Default apps...
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'cloudinary_storage',
'cloudinary',
# Your apps
'client_management',
'biz',
# Third-party packages
'oauth2_provider',
'rest_framework',
'rest_framework_simplejwt',
'corsheaders',
]
EXTERNAL_APPS = [
'client_management',
'biz',
]
PACKAGES = [
'oauth2_provider',
'rest_framework',
'rest_framework_simplejwt',
'corsheaders',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
"whitenoise.middleware.WhiteNoiseMiddleware",
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'oauth2_provider.middleware.OAuth2TokenMiddleware',
]
WSGI_APPLICATION = 'backend_core.wsgi.application'
CORS_ALLOW_ALL_ORIGINS = os.getenv('CORS_ALLOW_ALL_ORIGINS', 'False') == 'True'
CSRF_TRUSTED_ORIGINS = os.getenv('CSRF_TRUSTED_ORIGINS', '').split(',')
CORS_ALLOW_CREDENTIALS = os.getenv('CORS_ALLOW_CREDENTIALS', 'False') == 'True'" (RUNNING WITH GUNICORN)
1 Replies
david
EMPLOYEE
10 months ago
Apologies but this looks like an issue with the application level code. Due to volume, we can only answer platform level issues here
Status changed to Awaiting User Response Railway • 10 months ago