Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ALEJ4NDRO2025/urban-store/llms.txt

Use this file to discover all available pages before exploring further.

Urban Store uses two .env files — one for the Django backend and one for the Next.js frontend — to keep all secrets and service credentials out of source code. Neither file should ever be committed to version control; both are already listed in .gitignore. The sections below document every required variable, what it does, and where to obtain it.

Backend Variables

Create a file at backend/.env and populate it with the following variables:
VariableRequiredDescription
SECRET_KEYYesDjango cryptographic secret key used to sign JWTs and sessions
MONGODB_URIYesMongoDB Atlas connection URI, e.g. mongodb+srv://user:pass@cluster.mongodb.net/urbanstore
CLOUDINARY_CLOUD_NAMEYesCloudinary cloud name, found on your Cloudinary dashboard
CLOUDINARY_API_KEYYesCloudinary API key
CLOUDINARY_API_SECRETYesCloudinary API secret
EMAIL_HOST_USERYesGmail address used to send transactional emails
EMAIL_HOST_PASSWORDYesGmail App Password (16 characters — not your regular Gmail password)
STRIPE_SECRET_KEYYesStripe secret key — use sk_test_... during development
STRIPE_PUBLISHABLE_KEYYesStripe publishable key — use pk_test_... during development
Example backend/.env:
SECRET_KEY=your-django-secret-key-here
MONGODB_URI=mongodb+srv://myuser:mypassword@cluster0.abcde.mongodb.net/urbanstore
CLOUDINARY_CLOUD_NAME=my-cloud
CLOUDINARY_API_KEY=123456789012345
CLOUDINARY_API_SECRET=abcdefghijklmnopqrstuvwxyz12345
EMAIL_HOST_USER=your-store@gmail.com
EMAIL_HOST_PASSWORD=abcd efgh ijkl mnop
STRIPE_SECRET_KEY=sk_test_51...
STRIPE_PUBLISHABLE_KEY=pk_test_51...

Frontend Variables

Create a file at frontend/.env.local and populate it with the following variables:
VariableRequiredDescription
NEXT_PUBLIC_API_URLYesBackend API base URL — use http://localhost:8000 in development
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYYesStripe publishable key for the Stripe.js frontend SDK
Example frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51...

How to Obtain Each Credential

1

Django SECRET_KEY

Generate a cryptographically strong key using Django’s own utility. Run the following command once and paste the output into your .env:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
2

MongoDB URI

  1. Log in to MongoDB Atlas.
  2. Open your cluster and click Connect.
  3. Choose Drivers and select Python.
  4. Copy the connection string and replace <password> with your database user’s password.
  5. The database name at the end of the URI should be urbanstore.
3

Cloudinary Credentials

  1. Log in to cloudinary.com.
  2. Your Dashboard shows Cloud Name, API Key, and API Secret at a glance.
  3. Copy all three values into backend/.env.
4

Gmail App Password

  1. Go to your Google Account → Security.
  2. Enable 2-Step Verification if it is not already active.
  3. Under 2-Step Verification, open App Passwords.
  4. Create a new App Password for Mail / Other (custom name) and name it Urban Store.
  5. Google will display a 16-character password — copy it immediately (it won’t be shown again).
  6. Set EMAIL_HOST_USER to your Gmail address and EMAIL_HOST_PASSWORD to this 16-character password.
5

Stripe API Keys

  1. Log in to dashboard.stripe.com.
  2. Navigate to Developers → API keys.
  3. Copy the Secret key (sk_test_...) → STRIPE_SECRET_KEY.
  4. Copy the Publishable key (pk_test_...) → STRIPE_PUBLISHABLE_KEY and NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY.

Never commit backend/.env or frontend/.env.local to source control. Both files contain secrets that give full access to your database, payment processor, email account, and media storage. They are already excluded by .gitignore — do not override that exclusion.
During development, STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY must be your test keys — the ones that start with sk_test_ and pk_test_ respectively. Test mode lets you process payments with Stripe’s test card number (4242 4242 4242 4242) without real charges. Switch to live keys (sk_live_ / pk_live_) only when deploying to production.

Build docs developers (and LLMs) love