Skip to content

https is not served when using drf. #82

Description

@SeokEunJu

In the case of a general file field, the url starts with http:// in local and https:// in dev and prod. But for privateFileField it starts with http:// everywhere.

Model Code

class ProjectImage(models.Model):
    project = models.ForeignKey(Project, on_delete=models.CASCADE, related_name="project_image")
    image = PrivateFileField(
        _("Project Image"),
        upload_to=investment_project_image_path,
    )

Serializer Code

class ProjectImageSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.ProjectImage
        fields = ['image']

Result
image

For General File field
image

Why is this happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions