Skip to content

Commit 53e1153

Browse files
author
chenhao
committed
first update
0 parents  commit 53e1153

File tree

1,875 files changed

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

1,875 files changed

+357114
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# IntelliJ project files
2+
.idea/
3+
4+
5+
# Python packages build temp files
6+
build/
7+
dist/
8+
*.egg-info/
9+
10+
__pycache__/
11+
12+
venv/

CHANGELOG.md

Whitespace-only changes.

LICENSE

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) Django vueSuit and individual contributors.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
14+
3. Neither the name of Django vueSuit nor the names of its contributors may be used
15+
to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include LICENSE
2+
include MANIFEST.in
3+
include CHANGELOG.md
4+
include __init__.py
5+
6+
graft docs
7+
graft vueSuit

__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# ==================================================
4+
# @Author : Copyright@Ryuchen
5+
# ==================================================

demo/app/__init__.py

Whitespace-only changes.

demo/app/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.

demo/app/apps.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AppConfig(AppConfig):
5+
name = 'app'

demo/app/migrations/__init__.py

Whitespace-only changes.

demo/app/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.

demo/app/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.

demo/app/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.

demo/db.sqlite3

128 KB
Binary file not shown.

demo/demo/__init__.py

Whitespace-only changes.

demo/demo/settings.py

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
"""
2+
Django settings for demo project.
3+
4+
Generated by 'django-admin startproject' using Django 2.2.3.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/2.2/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/2.2/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/2.2/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'reu4v1oyw*l=$5x90ys*+a2^7)8cy%et=fs+0(_+=&723ozsnx'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
# Application definition
31+
32+
INSTALLED_APPS = [
33+
'django.contrib.admin',
34+
'django.contrib.auth',
35+
'django.contrib.contenttypes',
36+
'django.contrib.sessions',
37+
'django.contrib.messages',
38+
'django.contrib.staticfiles',
39+
'vueSuit.vueAdmin',
40+
'vueSuit.vueForms',
41+
'vueSuit.vuePacks'
42+
]
43+
44+
MIDDLEWARE = [
45+
'django.middleware.security.SecurityMiddleware',
46+
'django.contrib.sessions.middleware.SessionMiddleware',
47+
'django.middleware.common.CommonMiddleware',
48+
'django.middleware.csrf.CsrfViewMiddleware',
49+
'django.contrib.auth.middleware.AuthenticationMiddleware',
50+
'django.contrib.messages.middleware.MessageMiddleware',
51+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
52+
]
53+
54+
ROOT_URLCONF = 'demo.urls'
55+
56+
TEMPLATES = [
57+
{
58+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
59+
'DIRS': [],
60+
'APP_DIRS': True,
61+
'OPTIONS': {
62+
'context_processors': [
63+
'django.template.context_processors.debug',
64+
'django.template.context_processors.request',
65+
'django.contrib.auth.context_processors.auth',
66+
'django.contrib.messages.context_processors.messages',
67+
],
68+
},
69+
},
70+
]
71+
72+
WSGI_APPLICATION = 'demo.wsgi.application'
73+
74+
75+
# Database
76+
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
77+
78+
DATABASES = {
79+
'default': {
80+
'ENGINE': 'django.db.backends.sqlite3',
81+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
82+
}
83+
}
84+
85+
86+
# Password validation
87+
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
88+
89+
AUTH_PASSWORD_VALIDATORS = [
90+
{
91+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
92+
},
93+
{
94+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
95+
},
96+
{
97+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
98+
},
99+
{
100+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
101+
},
102+
]
103+
104+
105+
# Internationalization
106+
# https://docs.djangoproject.com/en/2.2/topics/i18n/
107+
108+
LANGUAGE_CODE = 'en-us'
109+
110+
TIME_ZONE = 'UTC'
111+
112+
USE_I18N = True
113+
114+
USE_L10N = True
115+
116+
USE_TZ = True
117+
118+
119+
# Static files (CSS, JavaScript, Images)
120+
# https://docs.djangoproject.com/en/2.2/howto/static-files/
121+
122+
STATIC_URL = '/static/'

demo/demo/urls.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""demo URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/2.2/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+
"""
16+
from vueSuit import vueAdmin
17+
from django.urls import path
18+
19+
urlpatterns = [
20+
path('', vueAdmin.site.urls),
21+
]

demo/demo/wsgi.py

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

demo/manage.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo.settings')
9+
try:
10+
from django.core.management import execute_from_command_line
11+
except ImportError as exc:
12+
raise ImportError(
13+
"Couldn't import Django. Are you sure it's installed and "
14+
"available on your PYTHONPATH environment variable? Did you "
15+
"forget to activate a virtual environment?"
16+
) from exc
17+
execute_from_command_line(sys.argv)
18+
19+
20+
if __name__ == '__main__':
21+
main()

docs/Chinese/.gitkeep

Whitespace-only changes.

docs/English/.gitkeep

Whitespace-only changes.

setup.py

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# ==================================================
4+
# @Author : Copyright@Ryuchen
5+
# ==================================================
6+
from io import open
7+
from setuptools import find_packages, setup
8+
9+
REQUIRED_PYTHON = (3, 7)
10+
11+
version_tuple = __import__("vueSuit").VERSION
12+
version = ".".join([str(v) for v in version_tuple])
13+
14+
setup(
15+
name='vueSuit',
16+
version=version,
17+
python_requires='>={}.{}'.format(*REQUIRED_PYTHON),
18+
description='Create django application comes with lots of goodies easily, '
19+
'fully extensible with plugin support, '
20+
'pretty UI based on Ant Design Vue.',
21+
url='https://ryuchen.github.io',
22+
author='Ryuchen',
23+
author_email='[email protected]',
24+
license=open('LICENSE', encoding='utf-8').read(),
25+
packages=find_packages(),
26+
include_package_data=True,
27+
install_requires=[
28+
'django>=2.0'
29+
],
30+
zip_safe=False,
31+
keywords=['Full Stack', 'Django', 'vueAdmin', 'vuePacks', 'vueForms', 'ant design'],
32+
classifiers=[
33+
'Development Status :: 1 - Beta',
34+
'Environment :: Web Environment',
35+
'Framework :: Django',
36+
'Intended Audience :: Developers',
37+
'License :: OSI Approved :: BSD License',
38+
'Operating System :: OS Independent',
39+
"Programming Language :: JavaScript",
40+
'Programming Language :: Python',
41+
"Programming Language :: Python :: 2.7",
42+
"Programming Language :: Python :: 3.4",
43+
"Topic :: Internet :: WWW/HTTP",
44+
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
45+
"Topic :: Software Development :: Libraries :: Python Modules",
46+
]
47+
)

vueSuit/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# ==================================================
4+
# @Author : Copyright@Ryuchen
5+
# ==================================================
6+
7+
from .version import VERSION
8+
9+
__all__ = [
10+
"VERSION"
11+
]

vueSuit/version.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# ==================================================
4+
# @Author : Copyright@Ryuchen
5+
# ==================================================
6+
7+
VERSION = (0, 1, 0)

vueSuit/vueAdmin/__init__.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# ==================================================
4+
# @Author : Copyright@Ryuchen
5+
# ==================================================
6+
7+
from django.utils.module_loading import autodiscover_modules
8+
9+
from .decorators import register
10+
from .filters import (
11+
AllValuesFieldListFilter, BooleanFieldListFilter, ChoicesFieldListFilter,
12+
DateFieldListFilter, FieldListFilter, ListFilter, RelatedFieldListFilter,
13+
RelatedOnlyFieldListFilter, SimpleListFilter,
14+
)
15+
from .options import (
16+
HORIZONTAL, VERTICAL, ModelAdmin, StackedInline, TabularInline,
17+
)
18+
from .sites import AdminSite, site
19+
20+
__all__ = [
21+
"register", "ModelAdmin", "HORIZONTAL", "VERTICAL",
22+
"StackedInline", "TabularInline", "AdminSite", "site", "ListFilter",
23+
"SimpleListFilter", "FieldListFilter", "BooleanFieldListFilter",
24+
"RelatedFieldListFilter", "ChoicesFieldListFilter", "DateFieldListFilter",
25+
"AllValuesFieldListFilter", "RelatedOnlyFieldListFilter", "autodiscover",
26+
]
27+
28+
29+
def autodiscover():
30+
autodiscover_modules('vueAdmin', register_to=site)
31+
32+
33+
default_app_config = 'vueSuit.vueAdmin.apps.VueAdminConfig'

vueSuit/vueAdmin/apps.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# ==================================================
4+
# @Author : Copyright@Ryuchen
5+
# ==================================================
6+
7+
from django.apps import AppConfig
8+
from django.core import checks
9+
from django.utils.translation import gettext_lazy as _
10+
11+
from .checks import check_admin_app, check_dependencies
12+
13+
14+
class SimpleAdminConfig(AppConfig):
15+
"""Simple AppConfig which does not do automatic discovery."""
16+
17+
default_site = 'vueSuit.vueAdmin.sites.AdminSite'
18+
name = 'vueSuit.vueAdmin'
19+
verbose_name = _("Administration")
20+
21+
def ready(self):
22+
checks.register(check_dependencies, checks.Tags.admin)
23+
checks.register(check_admin_app, checks.Tags.admin)
24+
25+
26+
class VueAdminConfig(SimpleAdminConfig):
27+
"""The default AppConfig for admin which does auto discovery."""
28+
29+
def ready(self):
30+
super().ready()
31+
self.module.autodiscover()

0 commit comments

Comments
 (0)