Add Redis service and Celery configuration to Docker setup
- Introduced Redis service in both docker-compose files for production and development. - Updated web and celery services to use Redis as the broker and result backend. - Added necessary environment variables for Celery in settings.py. - Included new tasks and soil_data apps in Django settings and updated URL routing. - Updated requirements.txt to include Celery and Redis dependencies.
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
# Generated manually: refactor to SoilDepthData table
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("soil_data", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="SoilDepthData",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
(
|
||||
"depth_label",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("0-5cm", "۰–۵ سانتیمتر"),
|
||||
("5-15cm", "۵–۱۵ سانتیمتر"),
|
||||
("15-30cm", "۱۵–۳۰ سانتیمتر"),
|
||||
],
|
||||
db_index=True,
|
||||
max_length=10,
|
||||
),
|
||||
),
|
||||
("bdod", models.FloatField(blank=True, null=True)),
|
||||
("cec", models.FloatField(blank=True, null=True)),
|
||||
("cfvo", models.FloatField(blank=True, null=True)),
|
||||
("clay", models.FloatField(blank=True, null=True)),
|
||||
("nitrogen", models.FloatField(blank=True, null=True)),
|
||||
("ocd", models.FloatField(blank=True, null=True)),
|
||||
("ocs", models.FloatField(blank=True, null=True)),
|
||||
("phh2o", models.FloatField(blank=True, null=True)),
|
||||
("sand", models.FloatField(blank=True, null=True)),
|
||||
("silt", models.FloatField(blank=True, null=True)),
|
||||
("soc", models.FloatField(blank=True, null=True)),
|
||||
("wv0010", models.FloatField(blank=True, null=True)),
|
||||
("wv0033", models.FloatField(blank=True, null=True)),
|
||||
("wv1500", models.FloatField(blank=True, null=True)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
(
|
||||
"soil_location",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="depths",
|
||||
to="soil_data.soillocation",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"ordering": ["soil_location", "depth_label"],
|
||||
},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="soildepthdata",
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=("soil_location", "depth_label"),
|
||||
name="soil_depth_unique_location_depth",
|
||||
),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="soillocation",
|
||||
name="depth_0_5cm",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="soillocation",
|
||||
name="depth_5_15cm",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="soillocation",
|
||||
name="depth_15_30cm",
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user