Skip to content

Commit

Permalink
fix: change media url in nginx, django media directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ljy2855 committed Feb 23, 2024
1 parent 639a7e7 commit 5236d0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
def image_rename(instance, filename):
ext = filename.split(".")[-1]
file_name = "{}.{}".format(slugify(instance.title), ext)
return os.path.join("media/", file_name)
return os.path.join("", file_name)
2 changes: 1 addition & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ server {
}

location /media/ {
alias /home/app/web/media/;
alias /home/app/web/;
}

}

0 comments on commit 5236d0b

Please sign in to comment.