Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https is not served when using drf. #82

Open
SeokEunJu opened this issue Feb 20, 2023 · 0 comments
Open

https is not served when using drf. #82

SeokEunJu opened this issue Feb 20, 2023 · 0 comments

Comments

@SeokEunJu
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant