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,34 @@
|
||||
# Generated manually for soil_data
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="SoilLocation",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("latitude", models.DecimalField(db_index=True, decimal_places=6, help_text="عرض جغرافیایی (lat)", max_digits=9)),
|
||||
("longitude", models.DecimalField(db_index=True, decimal_places=6, help_text="طول جغرافیایی (lon)", max_digits=9)),
|
||||
("depth_0_5cm", models.JSONField(blank=True, help_text="دادههای لایه ۰–۵ سانتیمتر از API SoilGrids", null=True)),
|
||||
("depth_5_15cm", models.JSONField(blank=True, help_text="دادههای لایه ۵–۱۵ سانتیمتر از API SoilGrids", null=True)),
|
||||
("depth_15_30cm", models.JSONField(blank=True, help_text="دادههای لایه ۱۵–۳۰ سانتیمتر از API SoilGrids", null=True)),
|
||||
("task_id", models.CharField(blank=True, help_text="شناسه تسک Celery در حال پردازش", max_length=255)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-updated_at"],
|
||||
},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="soillocation",
|
||||
constraint=models.UniqueConstraint(fields=("latitude", "longitude"), name="soil_location_unique_lat_lon"),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user