Urban Store integrates four external services to handle data persistence, payments, image storage, and transactional email. Each service requires an account and a set of credentials that must be added to your localDocumentation 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.
.env files before the application will start successfully. This guide walks through the setup process for each service from scratch.
MongoDB Atlas
Urban Store uses MongoDB as its primary database through MongoEngine. The database name isurbanstore. While a local MongoDB instance is included in docker-compose.yml for development convenience, Atlas is recommended for any environment where data persistence and availability matter.
Create a free cluster
Go to mongodb.com/atlas and sign up or log in. Create a new project, then click Build a Database and select the Free (M0) tier. Choose your preferred cloud provider and region.
Create a database user
In the Atlas UI, navigate to Database Access and click Add New Database User. Choose Password authentication, enter a username and a strong password, and grant the user Read and write to any database privileges. Save the credentials — you will need them in the connection string.
Whitelist your IP address
Navigate to Network Access and click Add IP Address. For local development you can click Allow Access from Anywhere to add
0.0.0.0/0. For production, restrict this to the specific IP address of your server.Get the connection string
Return to your cluster, click Connect, and choose Drivers. Select Python as the driver. Copy the connection string — it looks like:Replace
<username> and <password> with the credentials you created in step 2.Confirm the database name
The application connects to the database named
urbanstore (configured in config/settings.py via mongoengine.connect(db='urbanstore', host=config['MONGODB_URI'], ...)). Ensure the database name at the end of your URI matches, or that you are using the explicit db= parameter in the connection call.Stripe
Urban Store uses Stripe to process card payments. The backend usesstripe (Python SDK) to create and confirm payment intents; the frontend uses Stripe.js loaded with the publishable key.
Create a Stripe account
Go to stripe.com and sign up. You do not need to activate your account to use test mode.
Open the API keys page
In the Stripe Dashboard, click Developers in the top navigation bar, then select API keys.
Copy the publishable key
Copy the Publishable key (begins with
pk_test_) and set it in both environment files:Cloudinary
Urban Store stores all product images as Cloudinary secure URLs. The backend is configured with your Cloudinary credentials inconfig/settings.py via the cloudinary Python SDK. Images are uploaded manually through the Cloudinary dashboard or Media Library, and the resulting URLs are stored in the product’s images array.
Create a Cloudinary account
Go to cloudinary.com and sign up for a free account.
Find your credentials
After logging in, the Dashboard page immediately shows your three credentials:
- Cloud name
- API Key
- API Secret
Upload product images
Use the Media Library in the Cloudinary dashboard to upload your product images. After uploading, click on an image and copy its Secure URL — it will look like:
Gmail SMTP
Urban Store sends transactional emails (order confirmations, etc.) through Gmail SMTP using a custom email backend defined inconfig/email_backend.py. This backend handles SSL certificate configuration using certifi to ensure reliable TLS connections across operating systems.
Enable 2-Step Verification
Go to myaccount.google.com/security and enable 2-Step Verification on the Google account you will use to send emails. App Passwords are only available after this step is complete.
Open App Passwords
Still on the Security page, scroll to the 2-Step Verification section and click on it. At the bottom of that page you will find App Passwords — click it. If you don’t see this option, 2-Step Verification may not be fully enabled yet.
Create an App Password
In the App Passwords dialog, select Mail as the app and Other (custom name) as the device. Enter a name like
Urban Store and click Generate. Google will display a 16-character password in a yellow box — copy it immediately, as it will not be shown again.Urban Store uses a custom email backend at
config/email_backend.py (CustomEmailBackend) rather than Django’s built-in django.core.mail.backends.smtp.EmailBackend. This custom backend explicitly sets the SSL context using certifi’s certificate bundle, which resolves SSL certificate verification errors that can occur on certain Linux and macOS configurations when connecting to smtp.gmail.com.