add media files to production compose

This commit is contained in:
godd0t
2023-05-10 13:19:19 +02:00
parent 1ae2664984
commit 70a802350a
25 changed files with 129 additions and 123 deletions

View File

@@ -1,3 +1,8 @@
from django.contrib import admin # noqa
from django.contrib import admin
# Register your models here.
from test_app.models import TestModel
@admin.register(TestModel)
class TestModelAdmin(admin.ModelAdmin):
list_display = ("name", "description")

View File

@@ -2,5 +2,5 @@ from django.apps import AppConfig
class TestAppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'test_app'
default_auto_field = "django.db.models.BigAutoField"
name = "test_app"

View File

@@ -1,3 +1,10 @@
from django.db import models # noqa
from django.db import models # noqa
# Create your models here.
class TestModel(models.Model):
name = models.CharField(max_length=255)
description = models.TextField()
file = models.FileField(upload_to="test_app/files/")
def __str__(self):
return self.name

6
src/test_app/tasks.py Normal file
View File

@@ -0,0 +1,6 @@
from project_name.celery import app
@app.task(bind=True, name="test_periodic_task")
def test_periodic_task(self): # noqa: Adding self since we are using bind=True
print("Hello from periodic task")

View File

@@ -1,3 +0,0 @@
from django.test import TestCase # noqa
# Create your tests here.

View File

@@ -1,4 +1,4 @@
from django.urls import path # noqa
from django.urls import path # noqa
urlpatterns = [
# ... other urls

View File

@@ -1,3 +1 @@
from django.shortcuts import render # noqa
# Create your views here.
from django.shortcuts import render # noqa