Skip to content

Commit 41a19ce

Browse files
committed
Shifting to Railway
1 parent 68a05cf commit 41a19ce

3 files changed

Lines changed: 51 additions & 18 deletions

File tree

details.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
1-
'NAME': 'task_management',
2-
'USER': 'postgres',
3-
'PASSWORD': 'password',
4-
'HOST': 'localhost',
5-
'PORT': '5432'
1+
✅ STEP 1: requirements.txt বানাও
2+
bash
3+
Copy
4+
Edit
5+
pip freeze > requirements.txt
6+
✅ STEP 2: Procfile বানাও
7+
📄 File name: Procfile (no extension)
8+
9+
bash
10+
Copy
11+
Edit
12+
web: gunicorn your_project_name.wsgi
13+
👉 your_project_name মানে যেই ফোল্ডারে settings.py, wsgi.py আছে (যেমন: mysite, tasknest, etc.)
14+
15+
✅ STEP 3: runtime.txt (optional)
16+
txt
17+
Copy
18+
Edit
19+
python-3.11.9
20+
(তোমার Python version অনুযায়ী)
21+
22+
✅ STEP 4: settings.py আপডেট করো
23+
🔹 DEBUG False + Allowed Hosts:
24+
python
25+
Copy
26+
Edit
27+
import os
28+
DEBUG = False
29+
ALLOWED_HOSTS = ['*'] # অথবা railway এর domain
30+
🔹 Static Files:
31+
python
32+
Copy
33+
Edit
34+
STATIC_URL = '/static/'
35+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
36+
🔹 PostgreSQL with Env Vars:
37+
python
38+
Copy
39+
Edit
40+
DATABASES = {
41+
'default': {
42+
'ENGINE': 'django.db.backends.postgresql',
43+
'NAME': os.getenv('DB_NAME'),
44+
'USER': os.getenv('DB_USER'),
45+
'PASSWORD': os.getenv('DB_PASSWORD'),
46+
'HOST': os.getenv('DB_HOST'),
47+
'PORT': os.getenv('DB_PORT'),
48+
}
49+
}

runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.13

tasknest/settings.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# SECURITY WARNING: don't run with debug turned on in production!
1616
DEBUG = False
1717

18-
ALLOWED_HOSTS: list[str] = ['tasknest-7qex.onrender.com']
18+
ALLOWED_HOSTS: list[str] = ['*']
1919

2020
AUTH_USER_MODEL = 'users.CustomUser'
2121

@@ -89,18 +89,6 @@
8989
}
9090
}
9191

92-
# PostgresQL (Hardcoded for testing/specific deployment)
93-
# DATABASES = {
94-
# 'default': {
95-
# 'ENGINE': 'django.db.backends.postgresql',
96-
# 'NAME': 'task_management',
97-
# 'USER': 'postgres',
98-
# 'PASSWORD': 'password',
99-
# 'HOST': 'localhost',
100-
# 'PORT': '5432'
101-
# }
102-
# }
103-
10492
STATIC_ROOT = BASE_DIR / 'staticfiles'
10593

10694

0 commit comments

Comments
 (0)