add media files to production compose
This commit is contained in:
@@ -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")
|
||||
|
@@ -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"
|
||||
|
@@ -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
6
src/test_app/tasks.py
Normal 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")
|
@@ -1,3 +0,0 @@
|
||||
from django.test import TestCase # noqa
|
||||
|
||||
# Create your tests here.
|
@@ -1,4 +1,4 @@
|
||||
from django.urls import path # noqa
|
||||
from django.urls import path # noqa
|
||||
|
||||
urlpatterns = [
|
||||
# ... other urls
|
||||
|
@@ -1,3 +1 @@
|
||||
from django.shortcuts import render # noqa
|
||||
|
||||
# Create your views here.
|
||||
from django.shortcuts import render # noqa
|
||||
|
Reference in New Issue
Block a user