P
P
pornstar982019-05-05 23:16:42
Django
pornstar98, 2019-05-05 23:16:42

Error saving entry when using default=timezone.now?

from django.db import models
from django.utils import timezone
import pytz
# Create your models here.
class Bb(models.Model):
    title = models.CharField(max_length = 5)
    content = models.TextField(null = True, blank = True)
    price = models.FloatField(null = True, blank = True)
    published = models.DateTimeField(default=timezone.now, db_index = True)

5ccf44829faa3188123243.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2019-05-05
@sim3x

https://docs.djangoproject.com/en/2.2/ref/models/f...
https://stackoverflow.com/questions/2771676/django...
https://www.google.com.ua/ search?q=django+DateTimeField

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question