Skip to content

Commit 6e2298c

Browse files
committed
Merge feature/small-change into main
2 parents dc0c393 + a62ad44 commit 6e2298c

File tree

153 files changed

+94
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+94
-13
lines changed
Lines changed: 0 additions & 1 deletion
This file was deleted.
-177 Bytes
Binary file not shown.
-3.38 KB
Binary file not shown.
-1.52 KB
Binary file not shown.
-687 Bytes
Binary file not shown.

Videogames_project/settings.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@
5555

5656
MIDDLEWARE = [
5757
'django.middleware.security.SecurityMiddleware',
58+
'whitenoise.middleware.WhiteNoiseMiddleware',
5859
'django.contrib.sessions.middleware.SessionMiddleware',
5960
'django.middleware.common.CommonMiddleware',
6061
'django.middleware.csrf.CsrfViewMiddleware',
6162
'django.contrib.auth.middleware.AuthenticationMiddleware',
6263
'django.contrib.messages.middleware.MessageMiddleware',
6364
'django.middleware.clickjacking.XFrameOptionsMiddleware',
65+
66+
6467
]
6568

6669
ROOT_URLCONF = 'Videogames_project.urls'
@@ -135,8 +138,13 @@
135138
# Static files (CSS, JavaScript, Images)
136139
# https://docs.djangoproject.com/en/5.1/howto/static-files/
137140

138-
STATIC_URL = 'static/'
139-
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
141+
STATIC_URL = '/static/'
142+
STATICFILES_DIRS = [BASE_DIR / "staticfiles"]
143+
STATIC_ROOT = BASE_DIR / "static"
144+
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
145+
146+
147+
140148

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

Videogames_project/urls.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,22 @@
1717
from django.contrib import admin
1818
from django.urls import path, include
1919
from django.contrib.auth import views as auth_views
20+
from django.shortcuts import render
21+
22+
from videogames_register.models import VideoGame
2023

2124
urlpatterns = [
2225
path('admin/', admin.site.urls),
2326
path('videogame/',include('videogames_register.urls')),
2427
path('accounts/login/', auth_views.LoginView.as_view(template_name='registration/login.html'), name='login'),
2528
path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'),
26-
]
29+
path('test/', lambda request: render(request, 'videogames_register/videogame_list.html')),
30+
31+
32+
]
33+
34+
def test_view(request):
35+
return render(request, 'videogames_register/videogame_list.html', {
36+
'videogame_list': VideoGame.objects.all()
37+
})
38+

requirements.txt

122 Bytes
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)