Skip to content

Commit dd244a1

Browse files
author
banerye
committed
add bank
0 parents  commit dd244a1

File tree

103 files changed

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

103 files changed

+2071
-0
lines changed

bank/bank/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pymysql
2+
3+
4+
pymysql.version_info = (1, 4, 13, "final", 0) # set the certain version of sql so that no wrong occur.
5+
pymysql.install_as_MySQLdb()
6+
256 Bytes
Binary file not shown.
2.37 KB
Binary file not shown.
1.09 KB
Binary file not shown.
553 Bytes
Binary file not shown.

bank/bank/asgi.py

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

bank/bank/settings.py

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
"""
2+
Django settings for bank project.
3+
4+
Generated by 'django-admin startproject' using Django 3.1.3.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/3.1/ref/settings/
11+
"""
12+
import os
13+
from pathlib import Path
14+
15+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+
BASE_DIR = Path(__file__).resolve().parent.parent
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = '^22xl(vks7!&ztbr)2w!6-0-wxuq3oq807hn1qbv&-f)gx(0qm'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = False
27+
28+
ALLOWED_HOSTS = ['*']
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+
41+
'users', # user module
42+
'home', # home page
43+
'payment' # payment page.
44+
45+
]
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+
]
57+
58+
ROOT_URLCONF = 'bank.urls'
59+
60+
TEMPLATES = [
61+
{
62+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
63+
'DIRS': [os.path.join(BASE_DIR, 'templates')],
64+
'APP_DIRS': True,
65+
'OPTIONS': {
66+
'context_processors': [
67+
'django.template.context_processors.debug',
68+
'django.template.context_processors.request',
69+
'django.contrib.auth.context_processors.auth',
70+
'django.contrib.messages.context_processors.messages',
71+
],
72+
},
73+
},
74+
]
75+
76+
WSGI_APPLICATION = 'bank.wsgi.application'
77+
78+
79+
# Database
80+
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
81+
82+
DATABASES = {
83+
'default': {
84+
'ENGINE': 'django.db.backends.mysql',
85+
'NAME': 'reliablebank',
86+
'USER': 'root',
87+
'PASSWORD': '',
88+
'HOST': 'localhost',
89+
'POST': 3306,
90+
}
91+
}
92+
93+
94+
# Password validation
95+
# https://docs.djangoproject.com/en/3.1/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+
# Internationalization
114+
# https://docs.djangoproject.com/en/3.1/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.1/howto/static-files/
129+
130+
STATIC_URL = '/static/'
131+
132+
STATICFILES_DIRS = [
133+
os.path.join(BASE_DIR, 'static')
134+
]

bank/bank/urls.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""bank URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/3.1/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 django.contrib import admin
17+
from django.urls import path, include
18+
19+
urlpatterns = [
20+
path('admin/', admin.site.urls),
21+
path(r'user/', include(('users.urls', 'users'), namespace='user')),
22+
path(r'', include(('home.urls', 'home'), namespace='home')),
23+
path(r'payment/', include(('payment.urls', 'payment'), namespace='payment'))
24+
]

bank/bank/wsgi.py

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

bank/db/__init__.py

Whitespace-only changes.
154 Bytes
Binary file not shown.
776 Bytes
Binary file not shown.

bank/db/base_model.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.db import models
2+
3+
4+
class BaseModel(models.Model):
5+
'''abstract model class'''
6+
is_delete = models.BooleanField(default=False, verbose_name='delete tag')
7+
create_time = models.DateTimeField(auto_now_add=True, verbose_name='create time')
8+
update_time = models.DateTimeField(auto_now=True, verbose_name='update time')
9+
10+
class Meta:
11+
abstract = True

bank/home/__init__.py

Whitespace-only changes.
156 Bytes
Binary file not shown.
197 Bytes
Binary file not shown.
241 Bytes
Binary file not shown.
283 Bytes
Binary file not shown.
329 Bytes
Binary file not shown.

bank/home/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.

bank/home/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 HomeConfig(AppConfig):
5+
name = 'home'

bank/home/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.

bank/home/models.py

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

bank/home/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.

bank/home/urls.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.urls import path
2+
from home import views
3+
4+
5+
urlpatterns = [
6+
path(r'', views.index, name='index'), # index front
7+
]

bank/home/views.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.
4+
5+
def index(request):
6+
7+
return render(request, 'home/index.html')

bank/key/server_priv_key.pem

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-----BEGIN RSA PRIVATE KEY-----
2+
MIIEowIBAAKCAQEAkXLAYu+vT/vcuXn5Mucq4Fl/rTvFV1VL6Eo15crLQ5CGvJBWkk5LxGyHnyrgxykdnhnqaJuKPezYP4SLfgpxlagQA8FavQJX5apWTQaLgEcIiDn8lLqUtrebwPM1IOQkIIWvP7vn32mZYTTT/7GK+KL+sHU/u8ZiqDK+zacOYrbmYlsx7PoXYOycWfPzhOmzXnp8YzNbYciPO7TcYDtHdytQR+tCwwGB07YuZZ4tFmBd0Vr+aqzW22CDg6GQJlt0Gu4Cj2kJFK0KCnzYzJjnwALQLRjCYs6Bxc6yufjoNfk6tUWl1z0EQ1MLvO8XyySzv0dr6XJurFZ+JztaFcTexwIDAQABAoIBAGnwALyPA0vokI3vj1hKE2qxBVOx8zx2/gDE/JjQqlgdzmVNZCDQMlNxER8XZfzpr47WJWvnzjroZWFuMwOsq6prbK6viF2edVLsTEtx9u2Jz2cZhST2+RZUiXdyLUI1qTKe7FQpkuugyHyKs9bLBAOxBHyWCcPE7VrBC0RS5yFyI7XWJFvqQh+OaLBUSCdAlqQs7d8H4mNak3U/xdOcKyGG21X9oqgXKTZ4P713WaP8G5w1LR5BNPAQhgorkIoDpin/Dk+3wkmacGTgTBJQRaa4qZVxnlh7T3WVt+fpYkZVrmLB9tzCi2WatrPn+9ef3OVwR7dHwz9mOd3W9C226dECgYEA6tvF9WBTn7kD28aTKqjQgbNipJEA0JL8dw0jx/0L32Nb9kaeDgPIBjVofCeG0NpqlTbO6OAb5TaNWBBA8ujJj41uv3vpKdKIk0fwcr/PU1OEP11CkPmGGaV4cQNyANYgKATxVJGkSRQaRMZ8qFhrXcdzarsmhHXu5Ms4la0vL70CgYEAnoqNaogsliE39paiM1cfdWkLSFPS4RI84scNnVz2zQh7tyrhqaF+JPmQaVl1W6Mai01j3WdkvveGq6q3K4vInc4jBs1RddA87h+t9J47SZUaDLgi4sRT8AgyZuyBKhIjNT72mEOaz6unnoAfpxCq381jrLRScbsL6o5CGtM//tMCgYEAjHk9c2HVQsCn9SlV1vs4E4vXIXV1lkuEZDTgxPquwkOsuqZMXTeXyVbikvgVZBBwFaW9pn59UOELM7QtFN11yb4fkrqroI9Dj0xFHm1ptX5LqJbAfPQyaF6XpokYBDYO78DdE+c061zxxVcvMoYIWgQ1HY6pICtl40VGKAh5I8UCgYA9KZCC78PbqzcOz3AFxG+jeQHcRlJNeB67EjXDZrDjyokH0eg6681hcFHxAo0O7C56XUHQkWnBbnaq1XJSv1uG3ZaPsjfh7pMC/n+6piyTJ41kKMl0mG8VY+Ql5smxtEuW6BJ0DWi1AzDoKd+MMRbqvi7c2rgPnixrsbP461R99wKBgECq2KadxyWJPYRRt4rrPCxqQQIsVbkFtEp3Fvi7tVAeRiOUUqvoUE4w3HNQSgPbrD3FZAkmAukGi3r43Gi/OamtRLqaCu17oSQrTw2ilYoE8x2q327j9X2m40O4TpI57mMTeKuX87ugaHT75xGMFlKfN+UaO7Of1gxElxnTNAEd
3+
-----END RSA PRIVATE KEY-----

bank/key/server_pub_key.pem

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-----BEGIN PUBLIC KEY-----
2+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkXLAYu+vT/vcuXn5Mucq4Fl/rTvFV1VL6Eo15crLQ5CGvJBWkk5LxGyHnyrgxykdnhnqaJuKPezYP4SLfgpxlagQA8FavQJX5apWTQaLgEcIiDn8lLqUtrebwPM1IOQkIIWvP7vn32mZYTTT/7GK+KL+sHU/u8ZiqDK+zacOYrbmYlsx7PoXYOycWfPzhOmzXnp8YzNbYciPO7TcYDtHdytQR+tCwwGB07YuZZ4tFmBd0Vr+aqzW22CDg6GQJlt0Gu4Cj2kJFK0KCnzYzJjnwALQLRjCYs6Bxc6yufjoNfk6tUWl1z0EQ1MLvO8XyySzv0dr6XJurFZ+JztaFcTexwIDAQAB
3+
-----END PUBLIC KEY-----

bank/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', 'bank.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()

bank/payment/__init__.py

Whitespace-only changes.
159 Bytes
Binary file not shown.
273 Bytes
Binary file not shown.
1.75 KB
Binary file not shown.
372 Bytes
Binary file not shown.
3.28 KB
Binary file not shown.

bank/payment/admin.py

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

bank/payment/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 PaymentConfig(AppConfig):
5+
name = 'payment'
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Django 3.1.3 on 2021-01-01 13:02
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Payment',
16+
fields=[
17+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('is_delete', models.BooleanField(default=False, verbose_name='delete tag')),
19+
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='create time')),
20+
('update_time', models.DateTimeField(auto_now=True, verbose_name='update time')),
21+
('payer', models.CharField(max_length=20, verbose_name='payer')),
22+
('payee', models.CharField(max_length=20, verbose_name='payee')),
23+
('account', models.IntegerField(verbose_name='account')),
24+
('timestamp', models.TimeField(verbose_name='timestamp')),
25+
],
26+
options={
27+
'db_table': 's_payment',
28+
},
29+
),
30+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 3.1.3 on 2021-01-03 07:43
2+
3+
from django.db import migrations, models
4+
import django.utils.timezone
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('payment', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='payment',
16+
name='dual_sign',
17+
field=models.TextField(default=django.utils.timezone.now, verbose_name='dual_sign'),
18+
preserve_default=False,
19+
),
20+
migrations.AlterField(
21+
model_name='payment',
22+
name='timestamp',
23+
field=models.TimeField(auto_now_add=True, verbose_name='timestamp'),
24+
),
25+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 3.1.3 on 2021-01-03 07:47
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('payment', '0002_auto_20210103_0743'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='payment',
15+
name='payee',
16+
field=models.CharField(max_length=30, verbose_name='payee'),
17+
),
18+
migrations.AlterField(
19+
model_name='payment',
20+
name='payer',
21+
field=models.CharField(max_length=30, verbose_name='payer'),
22+
),
23+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.1.3 on 2021-01-03 07:51
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('payment', '0003_auto_20210103_0747'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='payment',
15+
name='account',
16+
field=models.FloatField(verbose_name='account'),
17+
),
18+
]

0 commit comments

Comments
 (0)