.
This commit is contained in:
@@ -50,6 +50,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'debug_toolbar',
|
'debug_toolbar',
|
||||||
"tagulous",
|
"tagulous",
|
||||||
|
"dbbackup",
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@@ -198,7 +199,11 @@ THUMBNAIL_ALIASES = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBBACKUP_STORAGE = 'django.core.files.storage.FileSystemStorage'
|
||||||
|
DBBACKUP_STORAGE_OPTIONS = {'location': os.path.join(BASE_DIR, '../backups')}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .settings_local import *
|
from .settings_local import *
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-11 20:34
|
||||||
|
|
||||||
|
import django.core.files.storage
|
||||||
|
from django.db import migrations, models
|
||||||
|
import rapids.models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('rapids', '0013_auto_20210209_2239'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='rapidimage',
|
||||||
|
name='image',
|
||||||
|
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(base_url='/media/rapids/', location='/home/ross/rad/media//rapids/'), upload_to=rapids.models.image_directory_path),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 3.1.3 on 2021-02-11 20:35
|
||||||
|
|
||||||
|
import django.core.files.storage
|
||||||
|
from django.db import migrations, models
|
||||||
|
import rapids.models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('rapids', '0014_auto_20210211_2034'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='rapidimage',
|
||||||
|
name='image',
|
||||||
|
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(base_url='/media/rapids/', location='/home/ross/rad/media/rapids/'), upload_to=rapids.models.image_directory_path),
|
||||||
|
),
|
||||||
|
]
|
||||||
+2
-2
@@ -24,7 +24,7 @@ from generic.models import Site, Condition, Sign, ExamBase
|
|||||||
|
|
||||||
image_storage = FileSystemStorage(
|
image_storage = FileSystemStorage(
|
||||||
# Physical file location ROOT
|
# Physical file location ROOT
|
||||||
location=u"{0}/rapids/".format(settings.MEDIA_ROOT),
|
location=u"{0}rapids/".format(settings.MEDIA_ROOT),
|
||||||
# Url for file
|
# Url for file
|
||||||
base_url=u"{0}rapids/".format(settings.MEDIA_URL),
|
base_url=u"{0}rapids/".format(settings.MEDIA_URL),
|
||||||
)
|
)
|
||||||
@@ -288,7 +288,7 @@ class RapidImage(models.Model):
|
|||||||
rapid = models.ForeignKey(Rapid,
|
rapid = models.ForeignKey(Rapid,
|
||||||
related_name="images",
|
related_name="images",
|
||||||
on_delete=models.CASCADE)
|
on_delete=models.CASCADE)
|
||||||
image = models.ImageField(upload_to=image_directory_path, storage=image_storage)
|
image = models.FileField(upload_to=image_directory_path, storage=image_storage)
|
||||||
|
|
||||||
feedback_image = models.BooleanField(default=False)
|
feedback_image = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ psycopg2-binary
|
|||||||
django-sortedm2m
|
django-sortedm2m
|
||||||
pytesseract
|
pytesseract
|
||||||
opencv-python
|
opencv-python
|
||||||
|
django-dbbackup
|
||||||
Reference in New Issue
Block a user