Views & Functions Reference (No Code)¶
This section answers one question only:
“Which view does what?”
If a bug appears, a feature needs extension, or a new developer joins —
this section tells where to look and what not to touch .
1. Core App (core)¶
HomePageView¶
Responsibility
- Render landing page
- Show featured / active products
- Serve static testimonials (marketing-only)
ProductListView¶
Responsibility
- Display all active products
- Handle:
- Search (
q) - Category filtering (multi-select)
- Pagination
- Same template used for normal + HTMX requests
ProductDetailView¶
Responsibility
- Show product detail page
- Determine:
- If user is logged in
- If product is already purchased
- Decide whether UI shows Buy Now or Download
2. Authentication & Email (auth_email)¶
LoginView¶
Responsibility
- Authenticate user via email + password
- Role-based redirect:
- Seller → Seller Dashboard
- Customer → My Products
- Block inactive users
RegistrationView¶
Responsibility
- Register new user
- Set password
- Auto-login after registration
- Assign default customer role
SendVerifyEmailView¶
Responsibility
- Generate email verification token
- Send verification email via Celery
- Prevent duplicate verification
VerifyEmailView¶
Responsibility
- Validate email verification token
- Mark user as email verified
- Redirect based on role
CustomPasswordResetView¶
Responsibility
- Accept email for password reset
- Generate reset link
- Trigger reset email via Celery
PasswordResetConfirmView¶
Responsibility
- Validate reset token
- Allow password change
- Enforce one-time usage
3. Users (Generic / Shared Views)¶
GenericUserProfileView¶
Responsibility
- Base profile update logic
- Update name only (email read-only)
- Used by:
- CustomerProfileView
- SellerProfileView
GenericPasswordChangeView¶
Responsibility
- Change password
- Force logout after password change
- Used by both customer & seller
GenericOrderHistoryView¶
Responsibility
- Display order history
- Convert raw Order rows into UI-friendly billing list
- Pagination
GenericMyProductListView¶
Responsibility
- List purchased products
- Show:
- Download button
- Updated badge (last 3 days)
- Support request CTA
- Prefetch latest support request per product
4. Customer Panel (customer)¶
CustomerProfileView¶
Responsibility
- Customer profile wrapper over GenericUserProfileView
CustomerPasswordChangeView¶
Responsibility
- Customer password change wrapper
CustomerOrderHistoryView¶
Responsibility
- Customer order history wrapper
CustomerMyProductListView¶
Responsibility
- Customer’s purchased products listing
CustomerMySupportListView¶
Responsibility
- Customer’s support request list
- Cancel / Complete allowed based on status
5. Seller Panel (seller)¶
SellerDashboardView¶
Responsibility
- Seller analytics dashboard
- Show:
- Total customers
- Revenue (current + last 12 months)
- Latest buyers
- Uses analytics utility functions
SellerDashboardAPI¶
Responsibility
- Fetch Google Analytics data
- Return JSON for charts
SellerProfileView¶
Responsibility
- Seller profile wrapper
SellerOrderHistoryView¶
Responsibility
- Seller order history wrapper
SellerMyProductListView¶
Responsibility
- Seller’s own purchased products (as customer)
SellerMySupportListView¶
Responsibility
- Seller’s own support requests (as customer)
SellerProductListView¶
Responsibility
- List products created by seller
- Search + pagination
- Show updated badge (3 days logic)
SellerProductCreateView¶
Responsibility
- Create new product
- Handle:
- Draft vs Publish
- Category assignment
- Trigger product + Dodo product creation
SellerProductUpdateView¶
Responsibility
- Edit existing product
- Re-publish or save as draft
- Trigger Dodo product update
SellerProductDeleteView¶
Responsibility
- Delete product only if:
- No PurchasedProduct exists
- Prevent accidental revenue loss
SellerProductCategory* Views¶
Responsibility
- Create / List / Edit / Delete categories
- Seller-managed taxonomy only
6. Payments (payments)¶
PaymentSuccessView¶
Responsibility
- Post-payment redirect handler
- Role-based redirect after checkout
LocalProductDownloadView¶
Responsibility
- Serve local file downloads (DEV only)
ProductDownloadView¶
Responsibility
- Validate ownership
- Generate:
- Local download URL (dev)
- Presigned S3 URL (prod)
- Enforce private access
7. Dodo Payments (payments_dodo)¶
InitiateCheckoutSessionView¶
Responsibility
- Render billing form
- Create checkout session on POST
- Create Order before redirect
- Prevent duplicate purchases
DodoWebhookView¶
Responsibility
- Verify webhook signature
- Confirm payment
- Update Order
- Create PurchasedProduct atomically
8. Support System (depsupport)¶
SupportRequestCreateView¶
Responsibility
- Create support request
- Prevent duplicate active requests
- Trigger Telegram notification
SupportRequestListView¶
Responsibility
- Seller view of all incoming support requests
SupportRequestUpdateView¶
Responsibility
- Seller updates:
- Status
- Meeting link
- Admin notes
- Lock completed / cancelled requests
GenericMySupportListView¶
Responsibility
- User’s support request list
- Determine:
- Can cancel
- Can complete
SupportCancelView¶
Responsibility
- Allow cancellation in early stages only
SupportCompleteView¶
Responsibility
- Allow completion only in
in_progress
9. Short URL (shorturl)¶
shorturl_view¶
Responsibility
- Resolve short URL
- Check expiry
- Cache result
- Increment click count
- Redirect to destination
ShorturlCreateView¶
Responsibility
- Create new short URL
- Auto-generate slug if missing
ShorturlListView¶
Responsibility
- List seller short URLs
- Search + pagination
- Build full short URL dynamically
ShorturlUpdateView¶
Responsibility
- Edit short URL
- Clear cache on update
ShorturlDeleteView¶
Responsibility
- Delete short URL
- Clear cache
10. Maintenance (under_construction)¶
UnderConstructionMiddleware¶
Responsibility
- Block entire site when enabled
- Allow bypass via:
- Staff user
- Secret query parameter
- Serve maintenance page
Summary¶
- Views are thin and intentional
- Business logic is pushed to:
- Models
- Utils
- Tasks
- Role separation is enforced via mixins
- No cross-app chaos