开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (1)
master
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
项目仓库所选许可证以仓库主分支所使用许可证为准
master
分支 (1)
master
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (1)
master
python
/
unnamed.patch
python
/
unnamed.patch
unnamed.patch 27.92 KB
一键复制 编辑 原始数据 按行查看 历史
"用户名" 提交于 2018年12月25日 11:50 +08:00 . python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789
Index: TestModel/migrations/__init__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/__init__.py (date 1544064886759)
+++ TestModel/migrations/__init__.py (date 1544064886759)
@@ -0,0 +1,0 @@
Index: TestModel/migrations/0001_initial.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0001_initial.py (date 1544065134955)
+++ TestModel/migrations/0001_initial.py (date 1544065134955)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月06日 02:58
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Test',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=20)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0002_userinfo.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0002_userinfo.py (date 1544499422149)
+++ TestModel/migrations/0002_userinfo.py (date 1544499422149)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月06日 03:12
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='UserInfo',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('username', models.CharField(max_length=32)),
+ ('password', models.CharField(max_length=32)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0003_shoplist.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0003_shoplist.py (date 1544496355627)
+++ TestModel/migrations/0003_shoplist.py (date 1544496355627)
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月09日 14:22
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0002_userinfo'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='ShopList',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('title', models.CharField(max_length=1000)),
+ ('price', models.FloatField(max_length=100)),
+ ('href', models.CharField(max_length=1000)),
+ ('pic', models.CharField(max_length=1000)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0006_admininfo.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0006_admininfo.py (date 1545574715037)
+++ TestModel/migrations/0006_admininfo.py (date 1545574715037)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月23日 14:18
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0005_collection'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='AdminInfo',
+ fields=[
+ ('adminid', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('username', models.CharField(max_length=32)),
+ ('password', models.CharField(max_length=32)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0005_collection.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0005_collection.py (date 1544620432866)
+++ TestModel/migrations/0005_collection.py (date 1544620432866)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月12日 13:13
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0004_userinfonew'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Collection',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('uid', models.IntegerField(max_length=32)),
+ ('vid', models.IntegerField(max_length=32)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0004_userinfonew.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0004_userinfonew.py (date 1544500158496)
+++ TestModel/migrations/0004_userinfonew.py (date 1544500158496)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月11日 03:49
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0003_shoplist'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='UserInfoNew',
+ fields=[
+ ('uid', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('username', models.CharField(max_length=32)),
+ ('password', models.CharField(max_length=32)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0008_admininfonew.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0008_admininfonew.py (date 1545577819945)
+++ TestModel/migrations/0008_admininfonew.py (date 1545577819945)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月23日 15:10
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0007_auto_20181223_2309'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='AdminInfoNew',
+ fields=[
+ ('adminid', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('adminname', models.CharField(max_length=32)),
+ ('password', models.CharField(max_length=32)),
+ ],
+ ),
+ ]
Index: TestModel/migrations/0007_auto_20181223_2309.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0007_auto_20181223_2309.py (date 1545577770868)
+++ TestModel/migrations/0007_auto_20181223_2309.py (date 1545577770868)
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.17 on 2018年12月23日 15:09
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0006_admininfo'),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name='admininfo',
+ old_name='username',
+ new_name='adminname',
+ ),
+ ]
Index: TestModel/migrations/0009_auto_20181225_0843.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/migrations/0009_auto_20181225_0843.py (date 1545698599479)
+++ TestModel/migrations/0009_auto_20181225_0843.py (date 1545698599479)
@@ -0,0 +1,33 @@
+# Generated by Django 2.1.4 on 2018年12月25日 00:43
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('TestModel', '0008_admininfonew'),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name='admininfonew',
+ old_name='adminid',
+ new_name='id',
+ ),
+ migrations.RenameField(
+ model_name='admininfonew',
+ old_name='adminname',
+ new_name='name',
+ ),
+ migrations.RenameField(
+ model_name='userinfonew',
+ old_name='uid',
+ new_name='id',
+ ),
+ migrations.RenameField(
+ model_name='userinfonew',
+ old_name='username',
+ new_name='name',
+ ),
+ ]
Index: TestModel/__init__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/__init__.py (date 1544064886757)
+++ TestModel/__init__.py (date 1544064886757)
@@ -0,0 +1,0 @@
Index: manage.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- manage.py (date 1545709003248)
+++ manage.py (date 1545709003248)
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# manage.py: 一个实用的命令行工具,可让你以各种方式与该 Django 项目进行交互。
+import os
+import sys
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "py16110100722.settings")
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError:
+ # The above import may fail for some other reason. Ensure that the
+ # issue is really that Django is missing to avoid masking other
+ # exceptions on Python 2.
+ try:
+ import django
+ except ImportError:
+ 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?"
+ )
+ raise
+ execute_from_command_line(sys.argv)
+#python manage.py runserver 0.0.0.0:8000
\ No newline at end of file
Index: .idea/vcs.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- .idea/vcs.xml (date 1545708791416)
+++ .idea/vcs.xml (date 1545708791416)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
\ No newline at end of file
Index: py16110100722/urls.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- py16110100722/urls.py (date 1545709157951)
+++ py16110100722/urls.py (date 1545709157951)
@@ -0,0 +1,31 @@
+"""py16110100717 URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+ https://docs.djangoproject.com/en/1.11/topics/http/urls/
+Examples:
+Function views
+ 1. Add an import: from my_app import views
+ 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
+Class-based views
+ 1. Add an import: from other_app.views import Home
+ 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
+Including another URLconf
+ 1. Import the include() function: from django.conf.urls import url, include
+ 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
+"""
+from django.conf.urls import url
+from django.contrib import admin
+from . import view,doReg
+from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+from django.contrib import staticfiles
+
+urlpatterns = [
+ url(r'^reg$',doReg.reg_form),
+ url(r'^doreg$',doReg.reguser),
+
+
+
+ # url(r'^search-form$', search.search_form),
+ # url(r'^search$', search.search),
+]
+urlpatterns += staticfiles_urlpatterns()
\ No newline at end of file
Index: py16110100722/view.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- py16110100722/view.py (date 1545709364814)
+++ py16110100722/view.py (date 1545709364814)
@@ -0,0 +1,9 @@
+#-*-coding:utf-8-*-
+from django.http import HttpResponse
+
+from django.shortcuts import render
+
+def hello(request):
+ context = {}
+ context['hello'] = 'Hello World!'
+ return render(request,'reg.html', context)
\ No newline at end of file
Index: py16110100722/wsgi.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- py16110100722/wsgi.py (date 1545706572479)
+++ py16110100722/wsgi.py (date 1545706572479)
@@ -0,0 +1,16 @@
+"""
+WSGI config for py16110100722 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/1.11/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "py16110100722.settings")
+
+application = get_wsgi_application()
Index: py16110100722/doReg.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- py16110100722/doReg.py (date 1545701010663)
+++ py16110100722/doReg.py (date 1545701010663)
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+from django.shortcuts import render
+from django.http import HttpResponse
+from django.http import HttpResponseRedirect
+from django.shortcuts import render_to_response
+from TestModel.models import UserInfoNew
+from django.views.decorators import csrf
+import hashlib
+# 表单
+def reg_form(request):
+ return render_to_response('reg.html')
+
+def encryption(password):
+ # 生成一个md5对象
+ m1 = hashlib.md5()
+ # 使用md5对象里的update方法md5转换
+ m1.update(password.encode("utf-8"))
+ token = m1.hexdigest()
+ return token
+
+def checkname(username):
+ userlist = UserInfoNew.objects.all()
+ for var in userlist:
+ if var.name == username:
+ return True
+
+def reg(username,password):
+ user = UserInfoNew(name=username, password=encryption(password))
+ user.save()
+ message = "添加成功"
+ return message
+
+# 接收请求数据
+def reguser(request):
+ message={}
+ request.encoding = 'utf-8'
+ if request.POST:
+ if request.POST['password']!="" or request.POST['password']!="":
+ if checkname(request.POST['username']):
+ message['rlt']="用户名已被注册,请重新输入"
+ return render(request,"reg.html", message)
+ else:
+ message['rlt'] = reg(request.POST['username'], request.POST['password'])
+
+ return render(request, "login.html", message)
+ else:
+ message['rlt'] = "没有输入"
+
+ return render(request, "reg.html", message)
+
Index: py16110100722/__init__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- py16110100722/__init__.py (date 1545709029999)
+++ py16110100722/__init__.py (date 1545709029999)
@@ -0,0 +1,1 @@
+# HelloWorld/__init__.py: 一个空文件,告诉 Python 该目录是一个 Python 包。
\ No newline at end of file
Index: py16110100722/settings.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- py16110100722/settings.py (date 1545709157844)
+++ py16110100722/settings.py (date 1545709157844)
@@ -0,0 +1,135 @@
+"""
+Django settings for py16110100722 project.
+
+Generated by 'django-admin startproject' using Django 1.11.17.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.11/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/1.11/ref/settings/
+"""
+# HelloWorld/settings.py: 该 Django 项目的设置/配置
+import os
+import pymysql
+
+pymysql.install_as_MySQLdb()
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = '+gu1#tw1m%ctn-)+*kkx9lgh!xnfu1tyy_ederwp=&pdx=h!vk'
+
+# 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',
+ 'TestModel',
+
+]
+
+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 = 'py16110100722.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 = 'py16110100722.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql', # 或者使用 mysql.connector.django
+ 'NAME': 'python',
+ 'USER': 'root1',
+ 'PASSWORD': 'wang123456',
+ 'HOST':'cdb-lgouktmr.gz.tencentcdb.com',
+ 'PORT':'10048',
+ }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/1.11/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/1.11/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_L10N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/1.11/howto/static-files/
+
+
+STATIC_URL = '/static/'
+STATIC_ROOT = os.path.join(os.path.dirname(__file__),'static')
+STATICFILES_DIRS=(
+ os.path.join(BASE_DIR,'static').replace('\\','/'),
+ ('images',os.path.join(STATIC_ROOT,'images').replace('\\','/') ),
+)
+
Index: templates/reg.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- templates/reg.html (date 1545706572369)
+++ templates/reg.html (date 1545706572369)
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html >
+<head>
+<meta charset="UTF-8">
+<title>Login Form</title>
+models.py
+<link rel="stylesheet" href="css/normalize.css">
+
+<style type="text/css">
+.btn { display: inline-block; *display: inline; *zoom: 1; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; color: #333333; text-align: center;text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); vertical-align: middle; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(top, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffffff, endColorstr=#e6e6e6, GradientType=0); border-color: #e6e6e6 #e6e6e6 #e6e6e6; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); border: 1px solid #e6e6e6; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); cursor: pointer; *margin-left: .3em; }
+.btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { background-color: #e6e6e6; }
+.btn-large { padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
+.btn:hover { color: #333333; text-decoration: none; background-color: #e6e6e6; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; }
+.btn-primary, .btn-primary:hover { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); color: #ffffff; }
+.btn-primary.active { color: rgba(255, 255, 255, 0.75); }
+.btn-primary { background-color: #4a77d4; background-image: -moz-linear-gradient(top, #6eb6de, #4a77d4); background-image: -ms-linear-gradient(top, #6eb6de, #4a77d4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#6eb6de), to(#4a77d4)); background-image: -webkit-linear-gradient(top, #6eb6de, #4a77d4); background-image: -o-linear-gradient(top, #6eb6de, #4a77d4); background-image: linear-gradient(top, #6eb6de, #4a77d4); background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#6eb6de, endColorstr=#4a77d4, GradientType=0); border: 1px solid #3762bc; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.5); }
+.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { filter: none; background-color: #4a77d4; }
+.btn-block { width: 100%; display:block; }
+
+* { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -ms-box-sizing:border-box; -o-box-sizing:border-box; box-sizing:border-box; }
+
+html { width: 100%; height:100%; overflow:hidden; }
+
+body {
+ width: 100%;
+ height:100%;
+ font-family: 'Open Sans', sans-serif;
+ background: #092756;
+ background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%),-moz-linear-gradient(top, rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), -moz-linear-gradient(-45deg, #670d10 0%, #092756 100%);
+ background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -webkit-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -webkit-linear-gradient(-45deg, #670d10 0%,#092756 100%);
+ background: -o-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -o-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -o-linear-gradient(-45deg, #670d10 0%,#092756 100%);
+ background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -ms-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -ms-linear-gradient(-45deg, #670d10 0%,#092756 100%);
+ background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), linear-gradient(to bottom, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), linear-gradient(135deg, #670d10 0%,#092756 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3E1D6D', endColorstr='#092756',GradientType=1 );
+}
+.login {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin: -150px 0 0 -150px;
+ width:300px;
+ height:300px;
+}
+.login h1 { color: #fff; text-shadow: 0 0 10px rgba(0,0,0,0.3); letter-spacing:1px; text-align:center; }
+
+input {
+ width: 100%;
+ margin-bottom: 10px;
+ background: rgba(0,0,0,0.3);
+ border: none;
+ outline: none;
+ padding: 10px;
+ font-size: 13px;
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
+ border: 1px solid rgba(0,0,0,0.3);
+ border-radius: 4px;
+ box-shadow: inset 0 -5px 45px rgba(100,100,100,0.2), 0 1px 1px rgba(255,255,255,0.2);
+ -webkit-transition: box-shadow .5s ease;
+ -moz-transition: box-shadow .5s ease;
+ -o-transition: box-shadow .5s ease;
+ -ms-transition: box-shadow .5s ease;
+ transition: box-shadow .5s ease;
+}
+input:focus { box-shadow: inset 0 -5px 45px rgba(100,100,100,0.4), 0 1px 1px rgba(255,255,255,0.2); }
+
+</style>
+
+
+<script src="js/prefixfree.min.js"></script>
+
+
+</head>
+
+<body>
+
+<div class="login">
+ <h1>Reg</h1>
+ <form action="/doreg" method="POST">
+ {% csrf_token %}
+ <input type="text" name="username" placeholder="用户名" required="required" />
+ <input type="password" name="password" placeholder="密码" required="required" />
+ <button type="submit" class="btn btn-primary btn-block btn-large">注册</button>
+ </form>
+ {{ rlt }}
+</div>
+
+
+</body>
+</html>
Index: templates/__init__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- templates/__init__.py (date 1545706274606)
+++ templates/__init__.py (date 1545706274606)
@@ -0,0 +1,0 @@
Index: TestModel/apps.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/apps.py (date 1544064886749)
+++ TestModel/apps.py (date 1544064886749)
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class TestmodelConfig(AppConfig):
+ name = 'TestModel'
Index: TestModel/models.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- TestModel/models.py (date 1545706981998)
+++ TestModel/models.py (date 1545706981998)
@@ -0,0 +1,17 @@
+from django.db import models
+
+# Create your models here.
+# models.py
+from django.db import models
+
+
+class Test(models.Model):
+ name = models.CharField(max_length=20)
+
+class UserInfo(models.Model):
+ username = models.CharField(max_length=32)
+ password = models.CharField(max_length=32)
+class UserInfoNew(models.Model):
+ id=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')
+ name = models.CharField(max_length=32)
+ password = models.CharField(max_length=32)
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/python_iii_project/python.git
git@gitee.com:python_iii_project/python.git
python_iii_project
python
python三级项目-刘宇注册
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /