Skip to content

Commit 31ae173

Browse files
committed
a real copy from pingcrm
1 parent d01dc5d commit 31ae173

Some content is hidden

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

43 files changed

+1706
-1866
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,4 @@ node_modules
133133
coverage
134134
htmlcov
135135
tags
136+
./demo/static/dist

Bakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ test:
2525
coverage report
2626

2727
all: setup test docker-build
28+
29+
30+
update:
31+
cp ../pingcrm/resources/js/{Pages,Shared} demo/static/src/ -rf
32+
cp ../pingcrm/resources/css/*.css demo/static/src/

app/settings.py

Lines changed: 146 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,146 @@
1-
"""
2-
Django settings for app project.
3-
4-
Generated by 'django-admin startproject' using Django 3.0.2.
5-
6-
For more information on this file, see
7-
https://docs.djangoproject.com/en/3.0/topics/settings/
8-
9-
For the full list of settings and their values, see
10-
https://docs.djangoproject.com/en/3.0/ref/settings/
11-
"""
12-
13-
import os
14-
15-
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16-
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17-
18-
19-
# Quick-start development settings - unsuitable for production
20-
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
21-
22-
# SECURITY WARNING: keep the secret key used in production secret!
23-
SECRET_KEY = 'pteg6f_+4sl&1hnzq0^v-05%o79h3gq&m82$3=2rkx(3@%_mhs'
24-
25-
# SECURITY WARNING: don't run with debug turned on in production!
26-
DEBUG = True
27-
28-
ALLOWED_HOSTS = ['localhost', '128.0.0.1', 'pingcrm.fly.dev', "inertia.opensrc.mx"]
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-
'demo',
41-
'js_routes',
42-
'inertia',
43-
'django_seed',
44-
'django_webserver',
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-
'demo.middleware.DemoMiddleware',
56-
]
57-
58-
ROOT_URLCONF = 'app.urls'
59-
60-
TEMPLATES = [
61-
{
62-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
63-
'DIRS': [],
64-
'APP_DIRS': True,
65-
'OPTIONS': {
66-
'context_processors': [
67-
'django.template.context_processors.debug',
68-
'django.template.context_processors.request',
69-
'django.template.context_processors.static',
70-
'django.template.context_processors.media',
71-
'django.contrib.auth.context_processors.auth',
72-
'django.contrib.messages.context_processors.messages',
73-
],
74-
},
75-
},
76-
]
77-
78-
WSGI_APPLICATION = 'app.wsgi.application'
79-
80-
81-
# Database
82-
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
83-
84-
DATABASES = {
85-
'default': {
86-
'ENGINE': 'django.db.backends.sqlite3',
87-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
88-
}
89-
}
90-
91-
92-
# Password validation
93-
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
94-
95-
AUTH_PASSWORD_VALIDATORS = [
96-
{
97-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
98-
},
99-
{
100-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
101-
},
102-
{
103-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
104-
},
105-
{
106-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
107-
},
108-
]
109-
110-
111-
112-
113-
# Internationalization
114-
# https://docs.djangoproject.com/en/3.0/topics/i18n/
115-
116-
LANGUAGE_CODE = 'en-us'
117-
118-
TIME_ZONE = 'UTC'
119-
120-
USE_I18N = True
121-
122-
USE_L10N = True
123-
124-
USE_TZ = True
125-
126-
127-
# Static files (CSS, JavaScript, Images)
128-
# https://docs.djangoproject.com/en/3.0/howto/static-files/
129-
130-
STATIC_URL = '/static/'
131-
STATIC_ROOT = os.path.join(BASE_DIR, "static")
132-
133-
134-
JS_ROUTES_INCLUSION_LIST = [
135-
'demo',
136-
]
137-
138-
# CSRF_HEADER_NAME="HTTP_X_CSRFTOKEN"
139-
140-
VERSION=2
1+
"""
2+
Django settings for app project.
3+
4+
Generated by 'django-admin startproject' using Django 3.0.2.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.0/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/3.0/ref/settings/
11+
"""
12+
13+
import os
14+
15+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'pteg6f_+4sl&1hnzq0^v-05%o79h3gq&m82$3=2rkx(3@%_mhs'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = ['localhost', '128.0.0.1', 'pingcrm.fly.dev', "inertia.opensrc.mx"]
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+
'demo',
41+
'js_routes',
42+
'inertia',
43+
'django_seed',
44+
'django_webserver',
45+
'favicon',
46+
]
47+
48+
MIDDLEWARE = [
49+
'django.middleware.security.SecurityMiddleware',
50+
'django.contrib.sessions.middleware.SessionMiddleware',
51+
'django.middleware.common.CommonMiddleware',
52+
'django.middleware.csrf.CsrfViewMiddleware',
53+
'django.contrib.auth.middleware.AuthenticationMiddleware',
54+
'django.contrib.messages.middleware.MessageMiddleware',
55+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
56+
'demo.middleware.DemoMiddleware',
57+
'inertia.middleware.InertiaMiddleware',
58+
]
59+
60+
ROOT_URLCONF = 'app.urls'
61+
62+
TEMPLATES = [
63+
{
64+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
65+
'DIRS': [],
66+
'APP_DIRS': True,
67+
'OPTIONS': {
68+
'context_processors': [
69+
'django.template.context_processors.debug',
70+
'django.template.context_processors.request',
71+
'django.template.context_processors.static',
72+
'django.template.context_processors.media',
73+
'django.contrib.auth.context_processors.auth',
74+
'django.contrib.messages.context_processors.messages',
75+
],
76+
},
77+
},
78+
]
79+
80+
WSGI_APPLICATION = 'app.wsgi.application'
81+
82+
83+
# Database
84+
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
85+
86+
DATABASES = {
87+
'default': {
88+
'ENGINE': 'django.db.backends.sqlite3',
89+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
90+
}
91+
}
92+
93+
94+
# Password validation
95+
# https://docs.djangoproject.com/en/3.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+
114+
115+
# Internationalization
116+
# https://docs.djangoproject.com/en/3.0/topics/i18n/
117+
118+
LANGUAGE_CODE = 'en-us'
119+
120+
TIME_ZONE = 'UTC'
121+
122+
USE_I18N = True
123+
124+
USE_L10N = True
125+
126+
USE_TZ = True
127+
128+
129+
# Static files (CSS, JavaScript, Images)
130+
# https://docs.djangoproject.com/en/3.0/howto/static-files/
131+
132+
STATIC_URL = '/static/'
133+
STATIC_ROOT = os.path.join(BASE_DIR, "static")
134+
135+
136+
JS_ROUTES_INCLUSION_LIST = [
137+
'demo',
138+
]
139+
140+
FAVICON_PATH = STATIC_URL + 'favicon.png'
141+
142+
# CSRF_HEADER_NAME="HTTP_X_CSRFTOKEN"
143+
144+
VERSION=2
145+
CSRF_COOKIE_NAME = "XSRF-TOKEN"
146+
CSRF_HEADER_NAME = "HTTP_X_XSRF_TOKEN"

app/urls.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
2-
from django.contrib import admin
3-
from django.urls import path, include
4-
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
5-
6-
urlpatterns = [
7-
path('admin/', admin.site.urls),
8-
path('', include("demo.urls")),
9-
] + staticfiles_urlpatterns()
1+
2+
from django.contrib import admin
3+
from django.urls import path, include
4+
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
5+
6+
urlpatterns = [
7+
path('admin/', admin.site.urls),
8+
path('', include('favicon.urls')),
9+
path('', include("demo.urls")),
10+
] + staticfiles_urlpatterns()

demo/static/dist/app.css

Lines changed: 0 additions & 5 deletions
This file was deleted.

demo/static/dist/app.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)