Skip to content

Commit 14b8f9d

Browse files
authored
Merge pull request #125 from MAYANK12SHARMA/GamingPlatformJarvisArena
Add Django-Based JavaScript Games Project
2 parents 91c296a + b554bbb commit 14b8f9d

File tree

219 files changed

+17462
-0
lines changed

Some content is hidden

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

219 files changed

+17462
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5501
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Welcome to the world of Jarvis Arena

GamingPlatform_JarvisArena/jarvis/__init__.py

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for jarvis project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jarvis.settings')
15+
16+
application = get_asgi_application()
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
"""
2+
Django settings for jarvis project.
3+
4+
Generated by 'django-admin startproject' using Django 5.0.1.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.0/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/5.0/ref/settings/
11+
"""
12+
13+
from pathlib import Path
14+
15+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+
BASE_DIR = Path(__file__).resolve().parent.parent
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'django-insecure-ql)(+xkzabkw*896vf#i9rjr0ga^&uiz1z)t@hk659!h4c(8d1'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = False
27+
28+
ALLOWED_HOSTS = ["*"]
29+
30+
SITE_ID = 3
31+
32+
# Application definition
33+
34+
INSTALLED_APPS = [
35+
'django.contrib.admin',
36+
'django.contrib.auth',
37+
'django.contrib.contenttypes',
38+
'django.contrib.sessions',
39+
'django.contrib.messages',
40+
'django.contrib.staticfiles',
41+
42+
#?---------------------- Custom apps ----------------------?#
43+
'jarvisapp',
44+
'allauth',
45+
'allauth.account',
46+
'django.contrib.sites',
47+
'allauth.socialaccount',
48+
'allauth.socialaccount.providers.google',
49+
'allauth.socialaccount.providers.github', # new for GitHub provider
50+
51+
52+
53+
54+
55+
]
56+
57+
58+
MIDDLEWARE = [
59+
'django.middleware.security.SecurityMiddleware',
60+
'django.contrib.sessions.middleware.SessionMiddleware',
61+
'django.middleware.common.CommonMiddleware',
62+
'allauth.account.middleware.AccountMiddleware',
63+
'django.middleware.csrf.CsrfViewMiddleware',
64+
'django.contrib.auth.middleware.AuthenticationMiddleware',
65+
'django.contrib.messages.middleware.MessageMiddleware',
66+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
67+
]
68+
69+
AUTHENTICATION_BACKENDS = (
70+
'django.contrib.auth.backends.ModelBackend',
71+
'allauth.account.auth_backends.AuthenticationBackend',
72+
)
73+
74+
SOCIALACCOUNT_PROVIDERS = {
75+
"google": {
76+
"SCOPE": ["profile", "email"],
77+
"AUTH_PARAMS": {
78+
"access_type": "online",
79+
},
80+
'APP': {
81+
'key': ''
82+
}
83+
},
84+
'github': {
85+
'SCOPE': ['user'],
86+
'AUTH_PARAMS': {
87+
'scope': 'user:email',
88+
},
89+
'APP': {
90+
'key': ''
91+
}
92+
}
93+
}
94+
95+
96+
97+
98+
99+
LOGIN_REDIRECT_URL = "/"
100+
# LOGIN_REDIRECT_URL = "/"
101+
102+
ACCOUNT_EMAIL_VERIFICATION = "none" # new
103+
104+
105+
# SOCIALACCOUNT_PROVIDERS = {
106+
# 'github': {
107+
# 'SCOPE': ['user'],
108+
# 'AUTH_PARAMS': {
109+
# 'scope': 'user:email',
110+
# },
111+
# 'APP': {
112+
# 'client_id': '2489d6ef85b22cf62f52',
113+
# 'secret': 'f569cc7acdffe295964341fea7b6e13e922980e4',
114+
# 'key': ''
115+
# }
116+
# }
117+
# }
118+
119+
120+
import os
121+
ROOT_URLCONF = 'jarvis.urls'
122+
123+
TEMPLATES = [
124+
{
125+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
126+
'DIRS': [os.path.join(BASE_DIR, 'templates')],
127+
'APP_DIRS': True,
128+
'OPTIONS': {
129+
'context_processors': [
130+
'django.template.context_processors.debug',
131+
'django.template.context_processors.request',
132+
'django.contrib.auth.context_processors.auth',
133+
'django.contrib.messages.context_processors.messages',
134+
],
135+
},
136+
},
137+
]
138+
139+
WSGI_APPLICATION = 'jarvis.wsgi.application'
140+
141+
142+
# Database
143+
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
144+
145+
DATABASES = {
146+
'default': {
147+
'ENGINE': 'django.db.backends.sqlite3',
148+
'NAME': BASE_DIR / 'db.sqlite3',
149+
}
150+
}
151+
152+
153+
# Password validation
154+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
155+
156+
AUTH_PASSWORD_VALIDATORS = [
157+
{
158+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
159+
},
160+
{
161+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
162+
},
163+
{
164+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
165+
},
166+
{
167+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
168+
},
169+
]
170+
171+
172+
# Internationalization
173+
# https://docs.djangoproject.com/en/5.0/topics/i18n/
174+
175+
LANGUAGE_CODE = 'en-us'
176+
177+
TIME_ZONE = 'UTC'
178+
179+
USE_I18N = True
180+
181+
USE_TZ = True
182+
183+
184+
# Static files (CSS, JavaScript, Images)
185+
# https://docs.djangoproject.com/en/5.0/howto/static-files/
186+
187+
STATIC_URL = 'static/'
188+
189+
# Default primary key field type
190+
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
191+
192+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
193+
194+
195+
#?-------------------------------------- Adiitional settings --------------------------------------?#
196+
197+
#! --------------------- Static files directory -----------------------------------#
198+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
199+
200+
STATICFILES_DIRS = [
201+
os.path.join(BASE_DIR, 'static'),
202+
os.path.join(BASE_DIR, 'download_games')
203+
]
204+
205+
206+
207+
#! --------------------- Sending email -----------------------------------#
208+
209+
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
210+
EMAIL_HOST = 'smtp.gmail.com'
211+
EMAIL_PORT = 587
212+
EMAIL_USE_TLS = True
213+
EMAIL_USE_SSL = False
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
URL configuration for jarvis project.
3+
4+
The `urlpatterns` list routes URLs to views. For more information please see:
5+
https://docs.djangoproject.com/en/5.0/topics/http/urls/
6+
Examples:
7+
Function views
8+
1. Add an import: from my_app import views
9+
2. Add a URL to urlpatterns: path('', views.home, name='home')
10+
Class-based views
11+
1. Add an import: from other_app.views import Home
12+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13+
Including another URLconf
14+
1. Import the include() function: from django.urls import include, path
15+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16+
"""
17+
from django.contrib import admin
18+
from django.urls import path, include
19+
20+
urlpatterns = [
21+
path('admin/', admin.site.urls),
22+
path('', include('jarvisapp.urls')),
23+
path('accounts/', include('allauth.urls')), # Include allauth URLs
24+
25+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for jarvis project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jarvis.settings')
15+
16+
application = get_wsgi_application()

GamingPlatform_JarvisArena/jarvisapp/__init__.py

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from django.contrib import admin
2+
3+
from .models import Profile
4+
5+
6+
# Register your models here.
7+
8+
9+
admin.site.register(Profile)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class JarvisappConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'jarvisapp'

0 commit comments

Comments
 (0)