Production · June 16, 2026
1. Question and Answer When an admin clicks the cancel subscription button, their cancel_at_period_ends is set to True. What I am thinking is whether their clients' cancel_at_period_ends should also be set to True or not. The current code never set clients' cancel_at_period_ends True. Can you give me any suggestions? For your client portal design, I would not set the clients' cancel_at_period_end to True. The reason is that the subscription belongs to the admin, not to the clients....
Computer Science · June 12, 2026
1. Do I need to rotate journalctl? I often see logs by journalctl -u myproject -f. By the way, is the journal rotated? I think I need to rotate it because it will pile up in the server. Yes. If you're viewing logs with: journalctl -u myproject -f those logs are managed by systemd-journald, and journald has its own log rotation and cleanup mechanism. You do not use logrotate for journalctl logs. Check current disk usage journalctl --disk-usage Example: Archived and active journals take up 256.0M...
Production · June 11, 2026
1. Two mails. Why? I tested on Day 7 suspension email. After payment failure, billing_followup.py sent suspension email, which runs suspended_billing_access(). This function does checkout session to start a new subscription. But at the same time, since billing_followup.py cancelled the current subscription on Day 7, which caused Stripe to fire the event of customer.subscription.deleted. The webhook caught the event and sent another mail for intentional cancellation by the user. This mail says...
Production · June 05, 2026
1. Question # ROUTE 2: sing up, paid, activate, signup completed. After some time, payment failed # => Day 0 has_paid = False, payment_failed_at = now, email sent (stripe_webhook) # => Day 3 reminder email sent (billing_followup.py) # => Day 7 suspension email sent, # is_active = False, suspend_at = now, data_deletion_scheduled_at = Day37, # client.is_active = False, client.data_deletion_scheduled_at = Day37 (billing_followup.py) # => Day 30 warning email sent (this command) # =>...
Production · June 03, 2026
1. How to delete a Stripe account In cleanup_scheduled_deletions.py, I need to end the user's Stripe account. How can I do that? And where should I do it? Here is Day90's part of the code: (Code omitted) There are two different things that people often mean by "end the user's Stripe account": Option 1: Cancel subscriptions (recommended) This is usually what SaaS applications do. You: cancel the Stripe subscription, stop future billing, keep the Stripe customer record. The customer remains...
Production · May 20, 2026
1. Code Can you explain the following code? Should I put it on a cronjob? # accounts/management/commands/cleanup_abandoned_signups.py from datetime import timedelta from django.core.management.base import BaseCommand from django.utils import timezone from accounts.models import CustomUser class Command(BaseCommand): help = "Delete abandoned admin signups that never completed payment" def handle(self, *args, **options): now = timezone.now() cutoff = now - timedelta(hours=24) abandoned_users =...
Computer Science · May 20, 2026
1. Why does it work without importing the function? I don't understand the following: signer = TimestampSigner() token = signer.sign(str(user.id)) payment_url = (f"{settings.DOMAIN}" f"/accounts/billing-recover/{token}/") remaining_days = (user.data_deletion_scheduled_at - timezone.now()).days # maybe 30 subject = "Account suspended – action required to restore access" context = {"user": user, "payment_url": payment_url, "remaining_days": remaining_days,} message =...
Computer Science · May 19, 2026
1. A problem When I tried to upload a file of more than 10MB, it was supposed to display some message. But instead, the following page was shown: 413 Request Entity Too Large nginx/1.24.0 (Ubuntu) Why? How can I display my own message? The following is part of models.py: (Code omitted) The following is part of forms.py: (Code omitted) And a view: (Code omitted) This happens because the upload is being rejected by Nginx before Django even receives the file. Your validator: validate_file_size()...
Computer Science · May 12, 2026
1. Problem What is the difference between these two lines? I first wrote the first one, then I changed it to the second by commenting the first one. But I don't remember why I did so. Can you figure out why I did? #documents = ClientDocument.objects.all() documents = ClientDocument.objects.select_related("client__clientprofile__admin", "uploader").order_by("-uploaded_at") Yes. The second line is an optimization to avoid excessive database queries. You probably changed it after encountering slow...
Production · May 09, 2026
[MY NOTE] I haven't done this yet as of today. 1. Problem My client portal system uses Stripe, and a Stripe payment page shows my personal email as contact information. It is true I use my personal email for Stripe, but I don't want to show my customers my personal email address. It is okay to show customers my business email. Is it possible to hide my personal email and instead, show my business email as a contact? Yes — in most cases, you can avoid exposing your personal email to customers...

Show more