Skip to content

Commit

Permalink
trying media files to serve from server itself
Browse files Browse the repository at this point in the history
  • Loading branch information
mittal-ishaan committed Dec 28, 2023
1 parent b8d64e9 commit 27f4468
Show file tree
Hide file tree
Showing 45 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ db.sqlite3
db1.sqlite3
__pycache__
migrations
venv
venv
media
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3
FROM python:3.10

ENV PYTHONUNBUFFERED 1

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- 8000:8000
volumes:
- ./db/db.sqlite3:/app/db.sqlite3
# - ./media:/app/
env_file:
- ./.env

Expand All @@ -16,5 +17,6 @@ services:
- 80:80
volumes:
- ./db/db.sqlite3:/app/db.sqlite3
# - ./media:/app/
depends_on:
- web
2 changes: 1 addition & 1 deletion home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def addLongRebateBill(request):
text = "Allocation ID for the entered email does not exist"
print(e)
except:
text = "Email ID does not exist in the database. Please eneter the correct email ID"
text = "Email ID does not exist in the database. Please login using the correct email ID"
request.session["text"] = text
return redirect(request.path)
text = request.session.get("text", "")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed media/static/images/Aladdin.JPG
Binary file not shown.
Binary file removed media/static/images/Amul.JPG
Binary file not shown.
Binary file removed media/static/images/Amul_Parlor.JPG
Binary file not shown.
Binary file removed media/static/images/Asoosiate_Dining_Warden.jpg
Binary file not shown.
Binary file not shown.
Binary file removed media/static/images/Bakelogy.JPG
Binary file not shown.
Binary file removed media/static/images/Bakeology.jpg
Binary file not shown.
Binary file removed media/static/images/Committee_Member_1.png
Binary file not shown.
Binary file removed media/static/images/Committee_Member_2.png.jpg
Binary file not shown.
Binary file removed media/static/images/Cutting_edge.jpg
Binary file not shown.
Binary file removed media/static/images/DSC09907.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09907_54bsHKG.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09908.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09908_2kixziT.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09909.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09909_YWcU03b.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09910_Ps4lp9e.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09910_Ps4lp9e_gh94aA9.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09911_F8UqzUJ.JPG
Binary file not shown.
Binary file removed media/static/images/DSC09913_SJSrIuf.JPG
Binary file not shown.
Binary file removed media/static/images/Electronic_Shop.JPG
Binary file not shown.
Binary file removed media/static/images/IITI3.png
Binary file not shown.
Binary file removed media/static/images/IMG-7560.jpg
Binary file not shown.
Binary file removed media/static/images/Laundry.jpg
Binary file not shown.
Binary file removed media/static/images/Ms_Laundary.JPG
Binary file not shown.
Binary file removed media/static/images/Pic_Lfresco1.jpg
Diff not rendered.
Binary file removed media/static/images/dining_Warden.jpg
Diff not rendered.
Binary file removed media/static/images/lalit.png
Diff not rendered.
Binary file removed media/static/images/lalit_1tIEzDx.png
Diff not rendered.
Binary file removed media/static/images/lalit_5sfWUPA.png
Diff not rendered.
Binary file removed media/static/images/lalit_n2OgA71.png
Diff not rendered.
Binary file removed media/static/images/lalit_oPgQj2W.png
Diff not rendered.
Binary file removed media/static/images/mess_cover.jpg
Diff not rendered.
Binary file removed media/static/images/teapost.jpg
Diff not rendered.
2 changes: 1 addition & 1 deletion messWebsite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@

DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.RawMediaCloudinaryStorage'
DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'
# MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
MEDIA_URL= '/media/'


# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

Expand Down
8 changes: 3 additions & 5 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ server{
location /{
proxy_pass http://django;
}
location /media {
autoindex on;
alias /home/myusername/myproject/media/;
}

# location /media/ {
# alias /app/media/;
# }
}

0 comments on commit 27f4468

Please sign in to comment.