slthcore 0.0.1__tar.gz → 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of slthcore might be problematic. Click here for more details.
- {slthcore-0.0.1 → slthcore-0.0.2}/MANIFEST.in +1 -0
- {slthcore-0.0.1/slthcore.egg-info → slthcore-0.0.2}/PKG-INFO +1 -1
- {slthcore-0.0.1 → slthcore-0.0.2}/setup.py +1 -1
- slthcore-0.0.2/slth/cmd/init/__main__.py +24 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/.DS_Store +0 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/.gitignore +9 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/base.env +15 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/application.yml +59 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/entrypoint.sh +3 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/manage.py +22 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/app/endpoints.py +1 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/app/models.py +1 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/app/tests.py +8 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/asgi.py +16 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/settings.py +187 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/urls.py +13 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/wsgi.py +16 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/django/requirements.txt +1 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/docker-compose.yml +64 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/local.env +3 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/reactjs/package.json +22 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/reactjs/src/main.jsx +11 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/reactjs/vite.config.js +22 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/run.sh +3 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/selenium/run.sh +2 -0
- slthcore-0.0.2/slth/cmd/init/boilerplate/test.sh +4 -0
- slthcore-0.0.2/slth/management/commands/__init__.py +0 -0
- slthcore-0.0.2/slth/migrations/__init__.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2/slthcore.egg-info}/PKG-INFO +1 -1
- {slthcore-0.0.1 → slthcore-0.0.2}/slthcore.egg-info/SOURCES.txt +25 -1
- slthcore-0.0.1/requirements.txt +0 -9
- {slthcore-0.0.1 → slthcore-0.0.2}/setup.cfg +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/__init__.py +0 -0
- {slthcore-0.0.1/slth/management → slthcore-0.0.2/slth/cmd/init/boilerplate/django/project}/__init__.py +0 -0
- {slthcore-0.0.1/slth/management/commands → slthcore-0.0.2/slth/cmd/init/boilerplate/django/project/app}/__init__.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/components.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/db/__init__.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/db/models.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/endpoints.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/exceptions.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/factory.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/forms.py +0 -0
- {slthcore-0.0.1/slth/migrations → slthcore-0.0.2/slth/management}/__init__.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/management/commands/integration_test.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/management/commands/sync.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0001_initial.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0002_email_role_pushsubscription_error.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0003_rename_photo_profile_alter_profile_options.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0004_alter_profile_photo.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0005_alter_profile_photo.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0006_user.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/models.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/notifications.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/oauth.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/permissions.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/queryset.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/roles.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/selenium/__init__.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/selenium/browser.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/serializer.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/static/.DS_Store +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/static/css/.DS_Store +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/static/css/slth.css +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/static/js/index.min.js +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/static/js/react.min.js +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/static/js/slth.min.js +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/statistics.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/templates/index.html +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/templates/service-worker.js +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/tests.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/urls.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/utils.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slth/views.py +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slthcore.egg-info/dependency_links.txt +0 -0
- {slthcore-0.0.1 → slthcore-0.0.2}/slthcore.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
|
|
5
|
+
NO_OVERRIDE = ['endpoints.py', 'forms.py', 'models.py', 'tests.py', 'application.yml', 'requirements.txt']
|
|
6
|
+
IGNORE = ['.deploy']
|
|
7
|
+
def copy_files(src, dest):
|
|
8
|
+
src_files = os.listdir(src)
|
|
9
|
+
for file_name in src_files:
|
|
10
|
+
if file_name not in IGNORE:
|
|
11
|
+
full_file_name = os.path.join(src, file_name)
|
|
12
|
+
if os.path.isfile(full_file_name):
|
|
13
|
+
full_path = os.path.join(dest, file_name)
|
|
14
|
+
if file_name not in NO_OVERRIDE or not os.path.exists(full_path):
|
|
15
|
+
shutil.copy(full_file_name, dest)
|
|
16
|
+
if os.path.isdir(full_file_name):
|
|
17
|
+
dirname = os.path.join(dest, file_name)
|
|
18
|
+
os.makedirs(dirname, exist_ok=True)
|
|
19
|
+
copy_files(full_file_name, dirname)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
src = os.path.join(os.path.dirname(__file__), 'boilerplate')
|
|
23
|
+
dest = os.path.abspath('.')
|
|
24
|
+
copy_files(src, dest)
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
FRONTEND_HOST=frontend
|
|
2
|
+
FRONTEND_PORT=5173
|
|
3
|
+
BACKEND_HOST=backend
|
|
4
|
+
BACKEND_PORT=8000
|
|
5
|
+
SELENIUM_HOST=selenium
|
|
6
|
+
SELENIUM_PORT=4444
|
|
7
|
+
REDIS_HOST=redis
|
|
8
|
+
POSTGRES_HOST=postgres
|
|
9
|
+
POSTGRES_DB=database
|
|
10
|
+
POSTGRES_PASSWORD=password
|
|
11
|
+
POSTGRES_PORT=5432
|
|
12
|
+
DOMAIN=localhost
|
|
13
|
+
SITE_URL=http://localhost:5173
|
|
14
|
+
API_URL=http://localhost:8000
|
|
15
|
+
ENVIRONMENT=DEV
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
application:
|
|
2
|
+
lang: pt-br
|
|
3
|
+
title: Sloth
|
|
4
|
+
subtitle: Take your time!
|
|
5
|
+
icon: /static/images/logo.png
|
|
6
|
+
logo: /static/images/logo.png
|
|
7
|
+
version: 1.0.5
|
|
8
|
+
oauth:
|
|
9
|
+
govbr:
|
|
10
|
+
name: gov.br
|
|
11
|
+
client_id: $GOVBR_CLIENTE_ID
|
|
12
|
+
client_secret: $GOVBR_CLIENT_SECRET
|
|
13
|
+
redirect_uri: /app/login/govbr/
|
|
14
|
+
authorize_url: $GOVBR_AUTHORIZE_URL
|
|
15
|
+
access_token_url: $GOVBR_ACCESS_TOKEN_URL
|
|
16
|
+
user_data_url: $GOVBR_USER_DATA_URL
|
|
17
|
+
user_logout_url: $GOVBR_LOGOUT_URL
|
|
18
|
+
user_scope:
|
|
19
|
+
user_data:
|
|
20
|
+
create: false
|
|
21
|
+
username: sub
|
|
22
|
+
email: email
|
|
23
|
+
groups:
|
|
24
|
+
administrador: Administrador
|
|
25
|
+
operador: Operador
|
|
26
|
+
index: dashboard
|
|
27
|
+
dashboard:
|
|
28
|
+
actions:
|
|
29
|
+
toolbar:
|
|
30
|
+
top:
|
|
31
|
+
center:
|
|
32
|
+
boxes:
|
|
33
|
+
search:
|
|
34
|
+
usermenu:
|
|
35
|
+
- icons
|
|
36
|
+
- users
|
|
37
|
+
- logout
|
|
38
|
+
adder:
|
|
39
|
+
tools:
|
|
40
|
+
settings:
|
|
41
|
+
menu:
|
|
42
|
+
users:Item 1:
|
|
43
|
+
Item 1.1:
|
|
44
|
+
Sair: logout
|
|
45
|
+
Sair: logout
|
|
46
|
+
theme:
|
|
47
|
+
colors:
|
|
48
|
+
primary: "#1351b4"
|
|
49
|
+
secondary: "#071e41"
|
|
50
|
+
auxiliary: "#2670e8"
|
|
51
|
+
highlight: "#0c326f"
|
|
52
|
+
info: "#1351b4"
|
|
53
|
+
success: "#1351b4"
|
|
54
|
+
warning: "#fff5c2"
|
|
55
|
+
danger: "#e52207"
|
|
56
|
+
border:
|
|
57
|
+
radius: 100em"
|
|
58
|
+
background:
|
|
59
|
+
info: "#d4e5ff"
|
|
@@ -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', 'project.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,0 +1 @@
|
|
|
1
|
+
from slth.endpoints import Endpoint
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from slth.db import models, role, meta
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASGI config for app 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/4.1/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', 'project.settings')
|
|
15
|
+
|
|
16
|
+
application = get_asgi_application()
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
"""
|
|
4
|
+
Django settings for app project.
|
|
5
|
+
|
|
6
|
+
Generated by 'django-admin startproject' using Django 4.1.
|
|
7
|
+
|
|
8
|
+
For more information on this file, see
|
|
9
|
+
https://docs.djangoproject.com/en/4.1/topics/settings/
|
|
10
|
+
|
|
11
|
+
For the full list of settings and their values, see
|
|
12
|
+
https://docs.djangoproject.com/en/4.1/ref/settings/
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
18
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Quick-start development settings - unsuitable for production
|
|
22
|
+
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
|
|
23
|
+
|
|
24
|
+
# SECURITY WARNING: keep the secret key used in production secret!
|
|
25
|
+
SECRET_KEY = 'django-insecure-p&2#cx&qubz4-$cl)dv#=_k7#ni^_%$1o1vm-x(3qq+r8oyg-@'
|
|
26
|
+
|
|
27
|
+
# SECURITY WARNING: don't run with debug turned on in production!
|
|
28
|
+
DEBUG = True
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Application definition
|
|
32
|
+
|
|
33
|
+
INSTALLED_APPS = [
|
|
34
|
+
'slthlib',
|
|
35
|
+
'slthcore',
|
|
36
|
+
'project.app',
|
|
37
|
+
'whitenoise.runserver_nostatic',
|
|
38
|
+
'django.contrib.auth',
|
|
39
|
+
'django.contrib.contenttypes',
|
|
40
|
+
'django.contrib.sessions',
|
|
41
|
+
'django.contrib.messages',
|
|
42
|
+
'django.contrib.staticfiles',
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
MIDDLEWARE = [
|
|
46
|
+
'django.middleware.security.SecurityMiddleware',
|
|
47
|
+
'whitenoise.middleware.WhiteNoiseMiddleware',
|
|
48
|
+
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
49
|
+
'django.middleware.common.CommonMiddleware',
|
|
50
|
+
'django.middleware.csrf.CsrfViewMiddleware',
|
|
51
|
+
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
52
|
+
'django.contrib.messages.middleware.MessageMiddleware',
|
|
53
|
+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
ROOT_URLCONF = 'project.urls'
|
|
57
|
+
|
|
58
|
+
TEMPLATES = [
|
|
59
|
+
{
|
|
60
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
61
|
+
'DIRS': [],
|
|
62
|
+
'APP_DIRS': True,
|
|
63
|
+
'OPTIONS': {
|
|
64
|
+
'context_processors': [
|
|
65
|
+
'django.template.context_processors.debug',
|
|
66
|
+
'django.template.context_processors.request',
|
|
67
|
+
'django.contrib.auth.context_processors.auth',
|
|
68
|
+
'django.contrib.messages.context_processors.messages',
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
WSGI_APPLICATION = 'project.wsgi.application'
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Database
|
|
78
|
+
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
|
|
79
|
+
|
|
80
|
+
DATABASES = {
|
|
81
|
+
'default': {
|
|
82
|
+
'ENGINE': 'django.db.backends.sqlite3',
|
|
83
|
+
'NAME': BASE_DIR / 'db.sqlite3',
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# Password validation
|
|
89
|
+
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
|
|
90
|
+
|
|
91
|
+
AUTH_PASSWORD_VALIDATORS = [
|
|
92
|
+
{
|
|
93
|
+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
103
|
+
},
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
107
|
+
|
|
108
|
+
####### SLTH ########
|
|
109
|
+
|
|
110
|
+
LANGUAGE_CODE = 'pt-br'
|
|
111
|
+
TIME_ZONE = 'America/Recife'
|
|
112
|
+
USE_I18N = True
|
|
113
|
+
USE_L10N = True
|
|
114
|
+
USE_TZ = False
|
|
115
|
+
MEDIA_ROOT = 'media'
|
|
116
|
+
MEDIA_URL = 'media/'
|
|
117
|
+
SITE_URL = os.environ.get('SITE_URL', 'http://localhost:8000')
|
|
118
|
+
STATIC_ROOT = 'static'
|
|
119
|
+
STATIC_URL = os.path.join(SITE_URL, 'static/')
|
|
120
|
+
ALLOWED_HOSTS = ['selenium', '127.0.0.1', 'localhost', '*']
|
|
121
|
+
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
|
122
|
+
X_FRAME_OPTIONS = 'ALLOWALL'
|
|
123
|
+
|
|
124
|
+
DECIMAL_SEPARATOR = ','
|
|
125
|
+
USE_THOUSAND_SEPARATOR = False
|
|
126
|
+
USE_X_FORWARDED_HOST = True
|
|
127
|
+
USE_X_FORWARDED_PORT = True
|
|
128
|
+
|
|
129
|
+
LOGGING_ = {
|
|
130
|
+
'version': 1,
|
|
131
|
+
'filters': {
|
|
132
|
+
'require_debug_true': {
|
|
133
|
+
'()': 'django.utils.log.RequireDebugTrue',
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
'handlers': {
|
|
137
|
+
'console': {
|
|
138
|
+
'level': 'DEBUG',
|
|
139
|
+
'filters': ['require_debug_true'],
|
|
140
|
+
'class': 'logging.StreamHandler',
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
'loggers': {
|
|
144
|
+
'django.db.backends': {
|
|
145
|
+
'level': 'DEBUG',
|
|
146
|
+
'handlers': ['console'],
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
_CACHES = {
|
|
152
|
+
"default": {
|
|
153
|
+
"BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
|
|
154
|
+
"LOCATION": "/var/tmp/cache",
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if os.environ.get('REDIS_HOST') and 'test' not in sys.argv:
|
|
159
|
+
REDIS_HOST = os.environ.get('REDIS_HOST', 'redis')
|
|
160
|
+
REDIS_PORT = os.environ.get('REDIS_PORT', 6379)
|
|
161
|
+
REDIS_PASSWORD = os.environ.get('REDIS_PASSWORD', None)
|
|
162
|
+
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
|
|
163
|
+
SESSION_CACHE_ALIAS = 'default'
|
|
164
|
+
|
|
165
|
+
CACHES = {
|
|
166
|
+
'default': {
|
|
167
|
+
'BACKEND': 'django_redis.cache.RedisCache',
|
|
168
|
+
'LOCATION': 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT),
|
|
169
|
+
'OPTIONS': {
|
|
170
|
+
"PASSWORD": REDIS_PASSWORD,
|
|
171
|
+
'CLIENT_CLASS': 'django_redis.client.DefaultClient'
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
if os.environ.get('POSTGRES_HOST') and 'test' not in sys.argv:
|
|
178
|
+
DATABASES = {
|
|
179
|
+
'default': {
|
|
180
|
+
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
181
|
+
'NAME': os.environ.get('DATABASE_NAME', 'database'),
|
|
182
|
+
'USER': os.environ.get('DATABASE_USER', 'postgres'),
|
|
183
|
+
'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'password'),
|
|
184
|
+
'HOST': os.environ.get('DATABASE_HOST', 'postgres'),
|
|
185
|
+
'PORT': os.environ.get('DATABASE_PORT', '5432'),
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from django.urls import path, re_path, include
|
|
2
|
+
from slth import urls
|
|
3
|
+
from django.conf import settings
|
|
4
|
+
from slth.views import dispatcher, index, service_worker
|
|
5
|
+
from django.conf.urls.static import static
|
|
6
|
+
|
|
7
|
+
urlpatterns = [
|
|
8
|
+
path('', index),
|
|
9
|
+
path('service-worker.js', service_worker),
|
|
10
|
+
re_path(r'^app/(?P<path>.*)/$', index),
|
|
11
|
+
path('api/', include(urls)),
|
|
12
|
+
path('', dispatcher)
|
|
13
|
+
] + static('media', document_root=settings.MEDIA_ROOT)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
WSGI config for app 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/4.1/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', 'project.settings')
|
|
15
|
+
|
|
16
|
+
application = get_wsgi_application()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyslth
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
services:
|
|
2
|
+
app: &app
|
|
3
|
+
hostname: app
|
|
4
|
+
env_file:
|
|
5
|
+
- base.env
|
|
6
|
+
- local.env
|
|
7
|
+
ports:
|
|
8
|
+
- "8000:8000"
|
|
9
|
+
build:
|
|
10
|
+
context: django
|
|
11
|
+
dockerfile: Dockerfile
|
|
12
|
+
restart: always
|
|
13
|
+
volumes:
|
|
14
|
+
- .deploy/media:/opt/deploy/media
|
|
15
|
+
- .deploy/static:/opt/deploy/static
|
|
16
|
+
depends_on:
|
|
17
|
+
postgres:
|
|
18
|
+
condition: service_healthy
|
|
19
|
+
healthcheck:
|
|
20
|
+
test: curl http://127.0.0.1:8000/api/login/
|
|
21
|
+
working_dir: /opt/deploy
|
|
22
|
+
entrypoint: ./entrypoint.sh
|
|
23
|
+
tester:
|
|
24
|
+
<<: *app
|
|
25
|
+
depends_on:
|
|
26
|
+
selenium:
|
|
27
|
+
condition: service_started
|
|
28
|
+
entrypoint: ./test.sh
|
|
29
|
+
selenium:
|
|
30
|
+
hostname: selenium
|
|
31
|
+
env_file:
|
|
32
|
+
- base.env
|
|
33
|
+
- local.env
|
|
34
|
+
ports:
|
|
35
|
+
- "4444"
|
|
36
|
+
build:
|
|
37
|
+
context: selenium
|
|
38
|
+
dockerfile: Dockerfile
|
|
39
|
+
restart: always
|
|
40
|
+
entrypoint: ./run.sh
|
|
41
|
+
redis:
|
|
42
|
+
hostname: redis
|
|
43
|
+
env_file:
|
|
44
|
+
- base.env
|
|
45
|
+
- local.env
|
|
46
|
+
image: redis
|
|
47
|
+
restart: always
|
|
48
|
+
ports:
|
|
49
|
+
- "6379"
|
|
50
|
+
command: redis-server --loglevel warning
|
|
51
|
+
volumes:
|
|
52
|
+
- .deploy/redis:/data
|
|
53
|
+
postgres:
|
|
54
|
+
env_file:
|
|
55
|
+
- base.env
|
|
56
|
+
- local.env
|
|
57
|
+
image: postgres
|
|
58
|
+
hostname: postgres
|
|
59
|
+
ports:
|
|
60
|
+
- "5432"
|
|
61
|
+
volumes:
|
|
62
|
+
- .deploy/postgres:/var/lib/postgresql/data
|
|
63
|
+
healthcheck:
|
|
64
|
+
test: psql -U postgres -d $$POSTGRES_DB -c "SELECT version();"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "project",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"react": "^18.2.0",
|
|
13
|
+
"react-dom": "^18.2.0",
|
|
14
|
+
"sloth": "latest"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/react": "^18.2.74",
|
|
18
|
+
"@types/react-dom": "^18.2.24",
|
|
19
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
20
|
+
"vite": "^5.2.8"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ReactDOM from "react-dom/client";
|
|
2
|
+
import ComponentFactory from "slth";
|
|
3
|
+
// import ComponentFactory from "/Users/breno/Documents/Workspace/slth/src/reactjs/src/Root";
|
|
4
|
+
|
|
5
|
+
function Hello(props) {
|
|
6
|
+
return <p>Hello {props.data.name}!</p>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
ComponentFactory.register("hello-world", (data) => <Hello data={data} />);
|
|
10
|
+
|
|
11
|
+
ComponentFactory.render(ReactDOM.createRoot(document.getElementById("root")));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
// https://vitejs.dev/config/
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [react()],
|
|
6
|
+
build: {
|
|
7
|
+
chunkSizeWarningLimit: 1000,
|
|
8
|
+
rollupOptions: {
|
|
9
|
+
output: {
|
|
10
|
+
manualChunks: (id) => {
|
|
11
|
+
if (id.includes("node_modules")) return "vendor";
|
|
12
|
+
if (id.includes("slth/src/reactjs/src/")) return "slth";
|
|
13
|
+
if (id.includes("service-worker")) return "service-worker";
|
|
14
|
+
},
|
|
15
|
+
dir: "../django/project/app/static",
|
|
16
|
+
entryFileNames: `[name].js`,
|
|
17
|
+
chunkFileNames: `[name].js`,
|
|
18
|
+
assetFileNames: `[name].[ext]`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
MANIFEST.in
|
|
2
|
-
requirements.txt
|
|
3
2
|
setup.py
|
|
4
3
|
slth/__init__.py
|
|
5
4
|
slth/components.py
|
|
@@ -19,6 +18,31 @@ slth/tests.py
|
|
|
19
18
|
slth/urls.py
|
|
20
19
|
slth/utils.py
|
|
21
20
|
slth/views.py
|
|
21
|
+
slth/cmd/init/__main__.py
|
|
22
|
+
slth/cmd/init/boilerplate/.DS_Store
|
|
23
|
+
slth/cmd/init/boilerplate/.gitignore
|
|
24
|
+
slth/cmd/init/boilerplate/base.env
|
|
25
|
+
slth/cmd/init/boilerplate/docker-compose.yml
|
|
26
|
+
slth/cmd/init/boilerplate/local.env
|
|
27
|
+
slth/cmd/init/boilerplate/run.sh
|
|
28
|
+
slth/cmd/init/boilerplate/test.sh
|
|
29
|
+
slth/cmd/init/boilerplate/django/application.yml
|
|
30
|
+
slth/cmd/init/boilerplate/django/entrypoint.sh
|
|
31
|
+
slth/cmd/init/boilerplate/django/manage.py
|
|
32
|
+
slth/cmd/init/boilerplate/django/requirements.txt
|
|
33
|
+
slth/cmd/init/boilerplate/django/project/__init__.py
|
|
34
|
+
slth/cmd/init/boilerplate/django/project/asgi.py
|
|
35
|
+
slth/cmd/init/boilerplate/django/project/settings.py
|
|
36
|
+
slth/cmd/init/boilerplate/django/project/urls.py
|
|
37
|
+
slth/cmd/init/boilerplate/django/project/wsgi.py
|
|
38
|
+
slth/cmd/init/boilerplate/django/project/app/__init__.py
|
|
39
|
+
slth/cmd/init/boilerplate/django/project/app/endpoints.py
|
|
40
|
+
slth/cmd/init/boilerplate/django/project/app/models.py
|
|
41
|
+
slth/cmd/init/boilerplate/django/project/app/tests.py
|
|
42
|
+
slth/cmd/init/boilerplate/reactjs/package.json
|
|
43
|
+
slth/cmd/init/boilerplate/reactjs/vite.config.js
|
|
44
|
+
slth/cmd/init/boilerplate/reactjs/src/main.jsx
|
|
45
|
+
slth/cmd/init/boilerplate/selenium/run.sh
|
|
22
46
|
slth/db/__init__.py
|
|
23
47
|
slth/db/models.py
|
|
24
48
|
slth/management/__init__.py
|
slthcore-0.0.1/requirements.txt
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{slthcore-0.0.1 → slthcore-0.0.2}/slth/migrations/0003_rename_photo_profile_alter_profile_options.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|