Skip to content

Commit 4c1250e

Browse files
authored
Merge pull request #28 from farooq13/base
bugfix
2 parents b4a960a + f40cdf8 commit 4c1250e

File tree

10 files changed

+23
-56
lines changed

10 files changed

+23
-56
lines changed
-1 Bytes
Binary file not shown.

base/media/uploads/profile_pictures/avatar.svg

-49
This file was deleted.

base/templates/base/index.html base/templates/base/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" href="{% if debug %} {% static 'css/style.css' %} {% else %} {% static 'css/style.min.css' %} {% endif %}">
1111

1212
{% tailwind_css %}
13-
<title>Document</title>
13+
<title>Trendify</title>
1414
</head>
1515
<body class="max-w-screen bg-slate-500">
1616
{% include 'base/navbar.html' %}

base/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get(self, request, *args, **kwargs):
2424
'posts': posts,
2525
'form': form
2626
}
27-
return render(request, 'base/index.html', context)
27+
return render(request, 'base/base.html', context)
2828

2929
def post(self, request, *args, **kwargs):
3030
posts = Post.objects.filter(
@@ -42,7 +42,7 @@ def post(self, request, *args, **kwargs):
4242
'posts': posts,
4343
'form': form
4444
}
45-
return render(request, 'base/index.html', context)
45+
return render(request, 'base/base.html', context)
4646

4747

4848
class PostDetail(View, LoginRequiredMixin):

db.sqlite3

0 Bytes
Binary file not shown.

trendy/.env

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ENVIROMENT=development
22
SECRET_KEY=django-insecure-^kf9lb-c&@uv3tj1+1#k21kmdg6jnh(-39-5&zmt139iwu1!p!
33
DATABASE_URL=postgresql://trendify_postgresql_user:gYNHjtiyhU0Q6MGYWqWO7nGIr69bLffe@dpg-cunniohopnds73da9q4g-a.oregon-postgres.render.com/trendify_postgresql
4-
5-
4+
CLOUD_NAME=de6yw68yw
5+
CLOUD_API_KEY=339117379228366
6+
CLOUD_API_SECRET=xPHRpyFZDdGgZVAM-MZS6B8DpGE
343 Bytes
Binary file not shown.

trendy/settings.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
'django.contrib.messages',
3939
'django.contrib.staticfiles',
4040

41+
'cloudinary_storage',
42+
'cloudinary',
43+
4144
'django.contrib.sites',
4245
'allauth',
4346
'allauth.account',
@@ -168,7 +171,18 @@
168171

169172
STATIC_ROOT = BASE_DIR / 'staticfiles'
170173

171-
MEDIA_ROOT = BASE_DIR / 'media'
174+
175+
176+
if ENVIROMENT == 'Production' or POSTGRES_LOCALLY == True:
177+
DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'
178+
else:
179+
MEDIA_ROOT = BASE_DIR / 'media'
180+
181+
CLOUDINARY_STORAGE = {
182+
'CLOUD_NAME': env('CLOUD_NAME'),
183+
'API_KEY': env('CLOUD_API_KEY'),
184+
'API_SECRET': env('CLOUD_API_SECRET'),
185+
}
172186

173187

174188
LOGIN_REDIRECT_URL = 'home'
@@ -180,4 +194,5 @@
180194

181195
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
182196

183-
ACCOUNT_USERNAME_BLACKLIST = ['admin', 'profile', 'post', 'encrypt']
197+
ACCOUNT_USERNAME_BLACKLIST = ['admin', 'profile', 'post', 'encrypt']
198+
Loading
Loading

0 commit comments

Comments
 (0)