{% extends "base.html" %} {% load static %} {% block title %}Subscription - {{ project_name }}{% endblock %} {% block content %} {% csrf_token %}

Subscription Management

Manage your monthly subscription plan

{% if not stripe_enabled or not stripe_available %}

Subscription Management Unavailable

{% if missing_api_keys %}

Stripe integration is not properly configured. Please contact support.

{% else %}

Subscription features are currently disabled.

{% endif %}
{% else %}

Current Subscription

{% if subscription and subscription.is_active %} Active {% else %} No Active Subscription {% endif %}
{% if subscription and subscription.is_active %}
{% with stripe_product=subscription.get_stripe_product %} {% if stripe_product %}

Plan: {{ stripe_product.name }}

Monthly Credits: {{ stripe_product.credit_amount }} credits

Price: ${{ stripe_product.price }}/month

{% else %}

Plan: Unknown Plan

{% endif %} {% endwith %} {% if subscription.current_period_start and subscription.current_period_end %}

Billing Period: {{ subscription.current_period_start|date:"M d, Y" }} - {{ subscription.current_period_end|date:"M d, Y" }}

{% endif %} {% if subscription.days_until_renewal is not None %} {% if subscription.days_until_renewal > 0 %}

Next Billing: {{ subscription.days_until_renewal }} days

{% elif subscription.days_until_renewal == 0 %}

Next Billing: Today

{% else %}

Status: Billing period expired

{% endif %} {% endif %} {% if subscription.cancel_at_period_end %}

Cancellation Scheduled: Your subscription will end on {{ subscription.current_period_end|date:"M d, Y" }}

{% endif %}
{% else %}

You don't have an active subscription. Subscribe to a monthly plan to get credits automatically each month.

  • Monthly credit allocation
  • Better value than pay-as-you-go
  • Automatic renewal
  • Cancel anytime
{% endif %}
{% if subscription_products %}

Available Plans

{% for product in subscription_products %}

{{ product.name }}

${{ product.price }}/month

{% if product.description %}

{{ product.description }}

{% endif %}
  • {{ product.credit_amount }} credits per month
  • Credits expire monthly
  • Cancel anytime
  • {% if product.credit_amount > 0 %}
  • {% widthratio product.price 1 product.credit_amount %} cents per credit
  • {% endif %}
{% if subscription and subscription.is_active and subscription.get_stripe_product.id == product.id %} Current Plan {% elif subscription and subscription.is_active %} Plan Change Coming Soon {% else %} {% endif %}
{% endfor %}
{% endif %}

Credit Balance

{% if user.credit_account %} {% with balance_breakdown=user.credit_account.get_balance_by_type %}

{{ balance_breakdown.subscription }}

Subscription Credits

{% if subscription and subscription.is_active %} Expires: {{ subscription.current_period_end|date:"M d, Y" }} {% else %} No active subscription {% endif %}

{{ balance_breakdown.pay_as_you_go }}

Pay-as-You-Go Credits

Never expire

{{ balance_breakdown.total }}

Total Credits

Available for use

{% endwith %} {% else %}

No credit account found.

{% endif %}
{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}