Skip to content

Commit dab7511

Browse files
committed
first commit
0 parents  commit dab7511

File tree

102 files changed

+812057
-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.

102 files changed

+812057
-0
lines changed

.gitignore

Whitespace-only changes.

config/__init__.py

Whitespace-only changes.
169 Bytes
Binary file not shown.
3.34 KB
Binary file not shown.
1.98 KB
Binary file not shown.
689 Bytes
Binary file not shown.

config/asgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for config 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', 'config.settings')
15+
16+
application = get_asgi_application()

config/settings.py

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
"""
2+
Django settings for config project.
3+
4+
Generated by 'django-admin startproject' using Django 5.0.7.
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+
from django.contrib.messages import constants as messages
15+
16+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
17+
BASE_DIR = Path(__file__).resolve().parent.parent
18+
19+
20+
# Quick-start development settings - unsuitable for production
21+
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
22+
23+
# SECURITY WARNING: keep the secret key used in production secret!
24+
SECRET_KEY = 'django-insecure-24@d95tn-7ot13dx#xy5*l&&cs)w58f@nl29k7+pxqbyvwtu$('
25+
26+
# SECURITY WARNING: don't run with debug turned on in production!
27+
DEBUG = True
28+
29+
ALLOWED_HOSTS = []
30+
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+
"django_browser_reload",
42+
'widget_tweaks',
43+
'main',
44+
'uploads',
45+
]
46+
47+
MIDDLEWARE = [
48+
'django.middleware.security.SecurityMiddleware',
49+
'django.contrib.sessions.middleware.SessionMiddleware',
50+
'django.middleware.common.CommonMiddleware',
51+
'django.middleware.csrf.CsrfViewMiddleware',
52+
'django.contrib.auth.middleware.AuthenticationMiddleware',
53+
'django.contrib.messages.middleware.MessageMiddleware',
54+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
55+
"django_browser_reload.middleware.BrowserReloadMiddleware",
56+
]
57+
58+
MESSAGE_TAGS = {
59+
messages.DEBUG: 'secondary',
60+
messages.INFO: 'info',
61+
messages.SUCCESS: 'success',
62+
messages.WARNING: 'warning',
63+
messages.ERROR: 'danger',
64+
}
65+
66+
67+
ROOT_URLCONF = 'config.urls'
68+
69+
TEMPLATES = [
70+
{
71+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
72+
'DIRS': [BASE_DIR.joinpath('templates')],
73+
'APP_DIRS': True,
74+
'OPTIONS': {
75+
'context_processors': [
76+
'django.template.context_processors.debug',
77+
'django.template.context_processors.request',
78+
'django.contrib.auth.context_processors.auth',
79+
'django.contrib.messages.context_processors.messages',
80+
],
81+
},
82+
},
83+
]
84+
85+
WSGI_APPLICATION = 'config.wsgi.application'
86+
87+
88+
# Database
89+
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
90+
91+
DATABASES = {
92+
'default': {
93+
'ENGINE': 'django.db.backends.sqlite3',
94+
'NAME': BASE_DIR / 'db.sqlite3',
95+
}
96+
}
97+
98+
99+
# Password validation
100+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
101+
102+
AUTH_PASSWORD_VALIDATORS = [
103+
{
104+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
105+
},
106+
{
107+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
108+
},
109+
{
110+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
111+
},
112+
{
113+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
114+
},
115+
]
116+
117+
118+
# Internationalization
119+
# https://docs.djangoproject.com/en/5.0/topics/i18n/
120+
121+
LANGUAGE_CODE = 'en-us'
122+
123+
TIME_ZONE = 'Asia/Kolkata'
124+
125+
USE_I18N = True
126+
127+
USE_TZ = True
128+
129+
130+
# Static files (CSS, JavaScript, Images)
131+
# https://docs.djangoproject.com/en/5.0/howto/static-files/
132+
133+
STATIC_URL = 'static/'
134+
STATICFILES_DIRS = [BASE_DIR.joinpath('assets')]
135+
STATIC_ROOT = BASE_DIR.joinpath('staticfiles')
136+
137+
import os
138+
MEDIA_URL = '/media/'
139+
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
140+
141+
# Default primary key field type
142+
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
143+
144+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
145+

config/urls.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""
2+
URL configuration for config 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+
# urls.py
18+
from django.contrib import admin
19+
from django.urls import path, include
20+
from django.conf import settings
21+
from django.conf.urls.static import static
22+
from uploads import views
23+
24+
25+
urlpatterns = [
26+
path('admin/', admin.site.urls),
27+
path("__reload__/", include("django_browser_reload.urls")),
28+
# path('', include('uploads.urls')),
29+
# upload
30+
path('',views.upload_file, name='upload_file'),
31+
path('files/', views.file_list, name='file_list'),
32+
path('files/<int:file_id>/', views.file_detail, name='file_detail'),
33+
path('files/<int:file_id>/select/', views.select_file, name='select_file'),
34+
35+
]
36+
37+
if settings.DEBUG:
38+
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
39+
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

config/wsgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for config 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', 'config.settings')
15+
16+
application = get_wsgi_application()

db.sqlite3

140 KB
Binary file not shown.

main/__init__.py

Whitespace-only changes.
167 Bytes
Binary file not shown.
222 Bytes
Binary file not shown.

main/__pycache__/apps.cpython-311.pyc

534 Bytes
Binary file not shown.
219 Bytes
Binary file not shown.

main/admin.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

main/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class MainConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'main'

main/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.

main/models.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

main/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

main/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

manage.py

+22
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', 'config.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)