randusertry commited on
Commit
e21ff46
·
verified ·
1 Parent(s): b752fdb

Upload 8 files

Browse files
core/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ # Core project package
core/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (149 Bytes). View file
 
core/__pycache__/settings.cpython-310.pyc ADDED
Binary file (2.41 kB). View file
 
core/__pycache__/urls.cpython-310.pyc ADDED
Binary file (326 Bytes). View file
 
core/__pycache__/wsgi.cpython-310.pyc ADDED
Binary file (317 Bytes). View file
 
core/settings.py ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+ import dj_database_url
4
+ import environ
5
+ from dotenv import load_dotenv
6
+
7
+ load_dotenv(os.path.join(Path(__file__).resolve().parent.parent, '.env'))
8
+
9
+ env = environ.Env()
10
+
11
+ BASE_DIR = Path(__file__).resolve().parent.parent
12
+
13
+ SECRET_KEY = env('SECRET_KEY', default='django-insecure-m_9^o6z(9)2i4*38#l+p_9^o6z(9)2i4*38#l+p_')
14
+ DEBUG = env.bool('DEBUG', default=True)
15
+ ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['localhost', '127.0.0.1', '.hf.space', '.huggingface.co'])
16
+ INSTALLED_APPS = [
17
+ 'django.contrib.admin',
18
+ 'django.contrib.auth',
19
+ 'django.contrib.contenttypes',
20
+ 'django.contrib.sessions',
21
+ 'django.contrib.messages',
22
+ 'django.contrib.staticfiles',
23
+ 'web', # the webapp part
24
+ ]
25
+
26
+ MIDDLEWARE = [
27
+ 'django.middleware.security.SecurityMiddleware',
28
+ 'django.contrib.sessions.middleware.SessionMiddleware',
29
+ 'django.middleware.common.CommonMiddleware',
30
+ 'django.middleware.csrf.CsrfViewMiddleware',
31
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
32
+ 'django.contrib.messages.middleware.MessageMiddleware',
33
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
34
+ ]
35
+
36
+ ROOT_URLCONF = 'core.urls'
37
+
38
+ TEMPLATES = [
39
+ {
40
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
41
+ 'DIRS': [],
42
+ 'APP_DIRS': True,
43
+ 'OPTIONS': {
44
+ 'context_processors': [
45
+ 'django.template.context_processors.debug',
46
+ 'django.template.context_processors.request',
47
+ 'django.contrib.auth.context_processors.auth',
48
+ 'django.contrib.messages.context_processors.messages',
49
+ ],
50
+ },
51
+ },
52
+ ]
53
+
54
+ WSGI_APPLICATION = 'core.wsgi.application'
55
+
56
+ DATABASES = {
57
+ 'default': dj_database_url.config(
58
+ default=env('DATABASE_URL', default='sqlite:///db.sqlite3'),
59
+ conn_max_age=600,
60
+ conn_health_checks=True,
61
+ )
62
+ }
63
+
64
+ AUTH_PASSWORD_VALIDATORS = [
65
+ {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
66
+ {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
67
+ {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
68
+ {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
69
+ ]
70
+
71
+ LANGUAGE_CODE = 'en-us'
72
+ TIME_ZONE = 'UTC'
73
+ USE_I18N = True
74
+ USE_TZ = True
75
+
76
+ STATIC_URL = 'static/'
77
+ STATIC_ROOT = BASE_DIR / 'staticfiles'
78
+ STATICFILES_DIRS = [BASE_DIR / 'static']
79
+
80
+
81
+
82
+ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
83
+
84
+ # Telegram Settings
85
+ TELEGRAM_TOKEN = env('TELEGRAM_TOKEN', default='')
86
+ HF_TOKEN = env('HF_TOKEN', default='')
core/urls.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from django.contrib import admin
2
+ from django.urls import path, include
3
+
4
+ urlpatterns = [
5
+ path('admin/', admin.site.urls),
6
+ path('', include('web.urls')),
7
+ ]
8
+
9
+
core/wsgi.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ from django.core.wsgi import get_wsgi_application
4
+
5
+ # Replace 'core.settings' with the actual path to your settings file
6
+ # if your configuration folder is named differently.
7
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
8
+
9
+ application = get_wsgi_application()