parent
086ba05c8a
commit
2cf73a24a8
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class App01Config(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'app01'
|
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
||||||
|
pic = models.ImageField(upload_to='pic/',verbose_name=u'图片地址')
|
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@
|
|||||||
|
"""
|
||||||
|
ASGI config for djangoProject project.
|
||||||
|
|
||||||
|
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')
|
||||||
|
|
||||||
|
application = get_asgi_application()
|
@ -0,0 +1,128 @@
|
|||||||
|
"""
|
||||||
|
Django settings for djangoProject project.
|
||||||
|
|
||||||
|
Generated by 'django-admin startproject' using Django 4.0.5.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/4.0/topics/settings/
|
||||||
|
|
||||||
|
For the full list of settings and their values, see
|
||||||
|
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
|
# Quick-start development settings - unsuitable for production
|
||||||
|
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
|
SECRET_KEY = 'django-insecure-wc1(xy__n)(-f8*#(kw4($mdicdnm%u$_@7d^ym!+&4)co+8w3'
|
||||||
|
|
||||||
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
|
DEBUG = True
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = []
|
||||||
|
|
||||||
|
|
||||||
|
# Application definition
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
'django.contrib.admin',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.sessions',
|
||||||
|
'django.contrib.messages',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
|
'app01.apps.App01Config',
|
||||||
|
]
|
||||||
|
|
||||||
|
MIDDLEWARE = [
|
||||||
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
#'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'djangoProject.urls'
|
||||||
|
|
||||||
|
TEMPLATES = [
|
||||||
|
{
|
||||||
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
|
'DIRS': [BASE_DIR / 'templates']
|
||||||
|
,
|
||||||
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
'django.template.context_processors.debug',
|
||||||
|
'django.template.context_processors.request',
|
||||||
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
WSGI_APPLICATION = 'djangoProject.wsgi.application'
|
||||||
|
|
||||||
|
|
||||||
|
# Database
|
||||||
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': BASE_DIR / 'db.sqlite3',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Password validation
|
||||||
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# Internationalization
|
||||||
|
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
||||||
|
|
||||||
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
|
TIME_ZONE = 'UTC'
|
||||||
|
|
||||||
|
USE_I18N = True
|
||||||
|
|
||||||
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
|
# Static files (CSS, JavaScript, Images)
|
||||||
|
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
||||||
|
|
||||||
|
STATIC_URL = 'static/'
|
||||||
|
# 自加静态目录配置
|
||||||
|
STATICFILES_DIRS = [
|
||||||
|
os.path.join(BASE_DIR, 'static')
|
||||||
|
]
|
||||||
|
# Default primary key field type
|
||||||
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
||||||
|
|
||||||
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
@ -0,0 +1,50 @@
|
|||||||
|
"""djangoProject URL Configuration
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/4.0/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.urls import include, path
|
||||||
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.contrib import admin
|
||||||
|
from django.urls import path,include
|
||||||
|
from app01 import views
|
||||||
|
urlpatterns = [
|
||||||
|
path('admin/', admin.site.urls),
|
||||||
|
path('home/', views.home),
|
||||||
|
path('login/', views.login),
|
||||||
|
path('photo/', views.photo),
|
||||||
|
path('index/', views.index),
|
||||||
|
path('f1_b/', views.f1_b),
|
||||||
|
path('f1_g/', views.f1_g),
|
||||||
|
path('f1_r/', views.f1_r),
|
||||||
|
path('f2_h/', views.f2_h),
|
||||||
|
path('f2_s/', views.f2_s),
|
||||||
|
path('f2_v/', views.f2_v),
|
||||||
|
path('f3/', views.f3),
|
||||||
|
path('f4_1/', views.f4_1),
|
||||||
|
path('f4_2/', views.f4_2),
|
||||||
|
path('f4_3/', views.f4_3),
|
||||||
|
path('f5/', views.f5),
|
||||||
|
path('f6/', views.f6),
|
||||||
|
path('f7/', views.f7),
|
||||||
|
path('f8/', views.f8),
|
||||||
|
path('f9/', views.f9),
|
||||||
|
path('f10/', views.f10),
|
||||||
|
path('f11/', views.f11),
|
||||||
|
path('f12/', views.f12),
|
||||||
|
path('f13_op/', views.f13_op),
|
||||||
|
path('f13_cl/', views.f13_cl),
|
||||||
|
path('f14/', views.f14),
|
||||||
|
path('f15/', views.f15),
|
||||||
|
path('f16/', views.f16),
|
||||||
|
path('f17/', views.f17),
|
||||||
|
#path('login2/', views.login2),
|
||||||
|
]
|
@ -0,0 +1,16 @@
|
|||||||
|
"""
|
||||||
|
WSGI config for djangoProject project.
|
||||||
|
|
||||||
|
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')
|
||||||
|
|
||||||
|
application = get_wsgi_application()
|
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""Django's command-line utility for administrative tasks."""
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Run administrative tasks."""
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')
|
||||||
|
try:
|
||||||
|
from django.core.management import execute_from_command_line
|
||||||
|
except ImportError as exc:
|
||||||
|
raise ImportError(
|
||||||
|
"Couldn't import Django. Are you sure it's installed and "
|
||||||
|
"available on your PYTHONPATH environment variable? Did you "
|
||||||
|
"forget to activate a virtual environment?"
|
||||||
|
) from exc
|
||||||
|
execute_from_command_line(sys.argv)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
After Width: | Height: | Size: 495 KiB |
After Width: | Height: | Size: 30 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>图像操作功能</h1>
|
||||||
|
<form action="/f1_b/" method="post"><button >B通道</button></form>
|
||||||
|
<form action="/f1_g/" method="post"><button >G通道</button></form>
|
||||||
|
<form action="/f1_r/" method="post"><button >R通道</button></form>
|
||||||
|
<form action="/f2_h/" method="post"><button >H通道</button></form>
|
||||||
|
<form action="/f2_s/" method="post"><button >S通道</button></form>
|
||||||
|
<form action="/f2_v/" method="post"><button >V通道</button></form>
|
||||||
|
<form action="/f3/" method="post"><button >旋转图片</button></form>
|
||||||
|
<form action="/f4_1/" method="post"><button >水平翻转</button></form>
|
||||||
|
<form action="/f4_2/" method="post"><button >垂直翻转</button></form>
|
||||||
|
<form action="/f4_3/" method="post"><button >对角翻转</button></form>
|
||||||
|
<form action="/f5/" method="post"><button >仿射变换</button></form>
|
||||||
|
<form action="/f6/" method="post"><button >灰度直方图</button></form>
|
||||||
|
<form action="/f7/" method="post"><button >彩色直方图</button></form>
|
||||||
|
<form action="/f8/" method="post"><button >直方图</button></form>
|
||||||
|
<form action="/f9/" method="post"><button >分段线性变换</button></form>
|
||||||
|
<form action="/f10/" method="post"><button >直线线条检测</button></form>
|
||||||
|
<form action="/f11/" method="post"><button >曲线线条检测</button></form>
|
||||||
|
<form action="/f12/" method="post"><button >边缘检测</button></form>
|
||||||
|
<form action="/f13_op/" method="post"><button >开运算</button></form>
|
||||||
|
<form action="/f13_cl/" method="post"><button >闭运算</button></form>
|
||||||
|
<form action="/f14/" method="post"><button >添加噪声</button></form>
|
||||||
|
<form action="/f15/" method="post"><button >去除噪声(滤波器)</button></form>
|
||||||
|
<form action="/f16/" method="post"><button >图像风格迁移</button></form>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>上传图片</h1>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="pic">图片</label>
|
||||||
|
<form action="/photo/" method="post" enctype="multipart/form-data">
|
||||||
|
<p>
|
||||||
|
<input id="image-uploadify" name="pic" type="file" accept=".xlsx,.xls,image/*,.doc,audio/*,.docx,video/*,.ppt,.pptx,.txt,.pdf" multiple>
|
||||||
|
</p>
|
||||||
|
<button>提交</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>上传要迁移的风格图片</h1>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="load">图片</label>
|
||||||
|
<form action="/f17/" method="post" enctype="multipart/form-data">
|
||||||
|
<p>
|
||||||
|
<input id="image-uploadify" name="load" type="file" accept=".xlsx,.xls,image/*,.doc,audio/*,.docx,video/*,.ppt,.pptx,.txt,.pdf" multiple>
|
||||||
|
</p>
|
||||||
|
<button>提交</button>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<img src="{{ image }}" width="500dp" height="500dp"/>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>登录</h1>
|
||||||
|
<form action="/login/" method="post" >
|
||||||
|
用户名:<input type="text" name="username">
|
||||||
|
密码:<input type="password" name="password">
|
||||||
|
<button>提交</button>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in new issue