This commit is contained in:
2024-11-14 02:06:21 +08:00
commit 29ce03dbc5
24 changed files with 1042 additions and 0 deletions

12
short_url/models.py Normal file
View File

@ -0,0 +1,12 @@
from django.db import models
from url_shortener.utils import generate_random_string_3
class ShortUrl(models.Model):
alias = models.CharField(
max_length=120, unique=True, default=generate_random_string_3
)
target = models.URLField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)