Securely generate and configure secrets for JWT, encryption, MongoDB, MinIO, SMTP, Redis, SEO API, and debugging — using Python code or online tools, with proper links and flow.
1

1. Project Secrets and Token Keys

VariablePurposePython CodeOnline Source
JWT_SECRETSigns access tokenssecrets.token_urlsafe(64)RandomKeyGen
JWT_REFRESH_SECRETSigns refresh tokenssecrets.token_urlsafe(64)RandomKeyGen
SECURITY_KEYAES key (16/24/32 bytes)secrets.token_urlsafe(16)Encryption Keys
CSRF_TOKEN_SECRETCSRF protectionsecrets.token_urlsafe(32)Security Tokens
NEXT_PUBLIC_COOKIE_PASSWORDCookie encryptionsecrets.token_urlsafe(32)RandomKeyGen
import secrets
print("JWT_SECRET =", secrets.token_urlsafe(64))
print("JWT_REFRESH_SECRET =", secrets.token_urlsafe(64))
print("SECURITY_KEY =", secrets.token_urlsafe(16))
print("CSRF_TOKEN_SECRET =", secrets.token_urlsafe(32))
print("NEXT_PUBLIC_COOKIE_PASSWORD =", secrets.token_urlsafe(32))
2

2. MongoDB Credentials

VariablePurposeGenerator
MONOGODB_URIDB connection URImongodb://username:password@host:27017/dbname
MONGO_INITDB_ROOT_USERNAMEDB root usernameSet manually or use Atlas UI
MONGO_INITDB_ROOT_PASSWORDDB root passwordPassword Generator
MONOGODB_URI=mongodb://admin:securepass@host:27017/test?authSource=admin
3

3. MinIO / AWS S3-Compatible Storage

VariablePurposeHow to Generate
AWS_ACCESS_KEY_IDAccess KeyMinIO Console / AWS IAM
AWS_SECRET_ACCESS_KEYSecret KeyMinIO Docs
AWS_BUCKETBucket NameChoose your bucket name (e.g., weam-frontend-media)
import secrets
print("AWS_ACCESS_KEY_ID =", secrets.token_hex(16))
print("AWS_SECRET_ACCESS_KEY =", secrets.token_hex(32))
4

4. Email Provider Credentials (SMTP / SES)

VariableDescriptionHow to Generate
SMTP_USEREmail or usernameGmail/Zoho/SendGrid login
SMTP_PASSWORDApp password/tokenGmail App Passwords
SMTP_SERVERSMTP hoste.g., smtp.gmail.com
SMTP_PORTSMTP portTLS: 587, SSL: 465
SENDER_EMAILEmail sender namee.g., Weam <you@example.com>
SMTP_USER=yourname@gmail.com
SMTP_PASSWORD=your_generated_app_password
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SENDER_EMAIL="Weam <yourname@gmail.com>"
5

5. Celery Redis Configuration

VariablePurposeExample URI
CELERY_BROKEN_URLRedis brokerredis://redis:6379/7
CELERY_RESULT_BACKENDTask result backendredis://redis:6379/7
Celery Redis Docs
6

6. SEO API Credentials

VariableDescriptionSource
SEO_USER_IDEmail for SEO loginDataForSEO
SEO_PASSWORDPassword or token for API accessDashboard → API Credentials
7

7. Dev Tools (Debugger - WDB)

VariableDescriptionDefault
WDB_SOCKET_SERVERDebugger socket serverwdb
WDB_PORTDebugger port1984
WDB_NO_BROWSER_AUTO_OPENDisable browser auto-launch1
WDB GitHub
Keep your secrets safe: never commit them to Git. Always use environment variables or a secure secrets manager in production.