Files
RasadDam_Backend/apps/log/models.py

17 lines
846 B
Python

from django.db import models
from apps.core.models import BaseModel
from mongoengine import Document, fields
# Create your models here.
class Log(Document):
endpoint = fields.StringField(max_length=100, null=True) # The url the user requested
user = fields.StringField(max_length=200, null=True)
response_code = fields.IntField(default=0) # Response status code
method = fields.StringField(max_length=10, null=True) # Request method
remote_address = fields.StringField(max_length=20, null=True) # IP address of user
exec_time = fields.IntField(null=True) # Time taken to create the response
date = fields.DateTimeField(auto_now=True) # Date and time of request
body_response = fields.StringField(null=True) # Response data
body_request = fields.StringField(max_length=1000, null=True) # Request data