Added more projects and upload path for images

This commit is contained in:
Eljakim Herrewijnen 2022-12-29 20:58:10 +01:00
parent c34e1b0725
commit 1ef9bdce2b
8 changed files with 6 additions and 2 deletions

View File

@ -125,6 +125,10 @@ USE_TZ = True
STATIC_URL = 'static/'
STATICFILES_DIRS = [
BASE_DIR / "static",
]
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

View File

@ -5,7 +5,7 @@ class Project(models.Model):
title = models.CharField(max_length=100)
description = models.TextField(default="No description added")
status = models.IntegerField(default=ProjectStatus.RUNNING)
image = models.ImageField(null=True, blank=True)
image = models.ImageField(upload_to="static/project_images/", null=True, blank=True)
rtd_url = models.CharField(max_length=200, null=True, blank=True)
url = models.CharField(max_length=200, null=True, blank=True)
visible = models.BooleanField(default=False)

View File

@ -5,4 +5,4 @@ from .models import Project
class ProjectView(viewsets.ModelViewSet):
serializer_class = ProjectSerializer
queryset = Project.objects.all()
queryset = Project.objects.all()

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB