我正在尝试将我的 Django 项目上传到 Heroku。我像往常一样运行以下命令:
git add .
git commit -am ""
git push heroku master
heroku run bash
$- python manage.py migrate //this for apply all the migrations
一旦我运行它们,我就得到了cannot cast type date to time without time zone
.
我已经找到了一些答案,但没有一个对我有用。
我已经TIME_ZONE
在 settings.py 中设置了
这是给我错误的迁移:
# Generated by Django 3.1.7 on 2021-08-16 16:29
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('website', '0009_order_creation_date'),
]
operations = [
migrations.AlterField(
model_name='order',
name='creation_date',
field=models.TimeField(default=django.utils.timezone.now, verbose_name='Data Ordine'),
),
]