Skip to content

Commit 8f5db06

Browse files
author
mousa-mohamed.abdelmaksoud
committed
django setup and core apps installed
0 parents  commit 8f5db06

File tree

7 files changed

+195
-0
lines changed

7 files changed

+195
-0
lines changed

djackets_django/db.sqlite3

140 KB
Binary file not shown.

djackets_django/djackets_django/__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 djackets_django 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', 'djackets_django.settings')
15+
16+
application = get_asgi_application()
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
"""
2+
Django settings for djackets_django 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-45gwdhnv5qew(xr-=*(to1^slpi8jq(lom%p4no)957a(v0ctm'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'django.contrib.admin',
35+
'django.contrib.auth',
36+
'django.contrib.contenttypes',
37+
'django.contrib.sessions',
38+
'django.contrib.messages',
39+
'django.contrib.staticfiles',
40+
41+
'rest_framework',
42+
'rest_framework.authtoken',
43+
'corsheaders',
44+
'djoser',
45+
]
46+
47+
CORS_ALLOWED_ORIGINS = [
48+
'http://localhost:8080',
49+
]
50+
51+
MIDDLEWARE = [
52+
'django.middleware.security.SecurityMiddleware',
53+
'django.contrib.sessions.middleware.SessionMiddleware',
54+
'corsheaders.middleware.CorsMiddleware',
55+
'django.middleware.common.CommonMiddleware',
56+
'django.middleware.csrf.CsrfViewMiddleware',
57+
'django.contrib.auth.middleware.AuthenticationMiddleware',
58+
'django.contrib.messages.middleware.MessageMiddleware',
59+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
60+
]
61+
62+
ROOT_URLCONF = 'djackets_django.urls'
63+
64+
TEMPLATES = [
65+
{
66+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
67+
'DIRS': [],
68+
'APP_DIRS': True,
69+
'OPTIONS': {
70+
'context_processors': [
71+
'django.template.context_processors.debug',
72+
'django.template.context_processors.request',
73+
'django.contrib.auth.context_processors.auth',
74+
'django.contrib.messages.context_processors.messages',
75+
],
76+
},
77+
},
78+
]
79+
80+
WSGI_APPLICATION = 'djackets_django.wsgi.application'
81+
82+
83+
# Database
84+
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
85+
86+
DATABASES = {
87+
'default': {
88+
'ENGINE': 'django.db.backends.sqlite3',
89+
'NAME': BASE_DIR / 'db.sqlite3',
90+
}
91+
}
92+
93+
94+
# Password validation
95+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
96+
97+
AUTH_PASSWORD_VALIDATORS = [
98+
{
99+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
100+
},
101+
{
102+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
103+
},
104+
{
105+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
106+
},
107+
{
108+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
109+
},
110+
]
111+
112+
113+
# Internationalization
114+
# https://docs.djangoproject.com/en/5.0/topics/i18n/
115+
116+
LANGUAGE_CODE = 'en-us'
117+
118+
TIME_ZONE = 'UTC'
119+
120+
USE_I18N = True
121+
122+
USE_TZ = True
123+
124+
125+
# Static files (CSS, JavaScript, Images)
126+
# https://docs.djangoproject.com/en/5.0/howto/static-files/
127+
128+
STATIC_URL = 'static/'
129+
130+
# Default primary key field type
131+
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
132+
133+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from django.contrib import admin
2+
from django.urls import path, include
3+
4+
urlpatterns = [
5+
path('admin/', admin.site.urls),
6+
path('api/v1/', include('djoser.urls')),
7+
path('api/v1/', include('djoser.urls.authtoken'))
8+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for djackets_django 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', 'djackets_django.settings')
15+
16+
application = get_wsgi_application()

djackets_django/manage.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djackets_django.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

0 commit comments

Comments
 (0)