diff --git a/Day21-30/code/demo01/img/Thumbs.db b/Day21-30/code/demo01/img/Thumbs.db deleted file mode 100644 index cd04faa74b843f0e39a6a58c5b52617d6a704b77..0000000000000000000000000000000000000000 Binary files a/Day21-30/code/demo01/img/Thumbs.db and /dev/null differ diff --git a/Day21-30/code/demo02/img/Thumbs.db b/Day21-30/code/demo02/img/Thumbs.db deleted file mode 100644 index df429fa5c3d79f05eec998ab420a25dff8666796..0000000000000000000000000000000000000000 Binary files a/Day21-30/code/demo02/img/Thumbs.db and /dev/null differ diff --git a/Day41-55/car/car/__init__.py b/Day41-55/code/car/car/__init__.py similarity index 100% rename from Day41-55/car/car/__init__.py rename to Day41-55/code/car/car/__init__.py diff --git a/Day41-55/car/car/settings.py b/Day41-55/code/car/car/settings.py similarity index 100% rename from Day41-55/car/car/settings.py rename to Day41-55/code/car/car/settings.py diff --git a/Day41-55/car/car/urls.py b/Day41-55/code/car/car/urls.py similarity index 100% rename from Day41-55/car/car/urls.py rename to Day41-55/code/car/car/urls.py diff --git a/Day41-55/car/car/wsgi.py b/Day41-55/code/car/car/wsgi.py similarity index 100% rename from Day41-55/car/car/wsgi.py rename to Day41-55/code/car/car/wsgi.py diff --git a/Day41-55/car/manage.py b/Day41-55/code/car/manage.py similarity index 100% rename from Day41-55/car/manage.py rename to Day41-55/code/car/manage.py diff --git a/Day41-55/car/search/__init__.py b/Day41-55/code/car/search/__init__.py similarity index 100% rename from Day41-55/car/search/__init__.py rename to Day41-55/code/car/search/__init__.py diff --git a/Day41-55/car/search/admin.py b/Day41-55/code/car/search/admin.py similarity index 100% rename from Day41-55/car/search/admin.py rename to Day41-55/code/car/search/admin.py diff --git a/Day41-55/car/search/apps.py b/Day41-55/code/car/search/apps.py similarity index 100% rename from Day41-55/car/search/apps.py rename to Day41-55/code/car/search/apps.py diff --git a/Day41-55/car/search/migrations/0001_initial.py b/Day41-55/code/car/search/migrations/0001_initial.py similarity index 100% rename from Day41-55/car/search/migrations/0001_initial.py rename to Day41-55/code/car/search/migrations/0001_initial.py diff --git a/Day41-55/car/search/migrations/0002_auto_20180524_1420.py b/Day41-55/code/car/search/migrations/0002_auto_20180524_1420.py similarity index 100% rename from Day41-55/car/search/migrations/0002_auto_20180524_1420.py rename to Day41-55/code/car/search/migrations/0002_auto_20180524_1420.py diff --git a/Day41-55/car/search/migrations/__init__.py b/Day41-55/code/car/search/migrations/__init__.py similarity index 100% rename from Day41-55/car/search/migrations/__init__.py rename to Day41-55/code/car/search/migrations/__init__.py diff --git a/Day41-55/car/search/models.py b/Day41-55/code/car/search/models.py similarity index 100% rename from Day41-55/car/search/models.py rename to Day41-55/code/car/search/models.py diff --git a/Day41-55/car/search/tests.py b/Day41-55/code/car/search/tests.py similarity index 100% rename from Day41-55/car/search/tests.py rename to Day41-55/code/car/search/tests.py diff --git a/Day41-55/car/search/views.py b/Day41-55/code/car/search/views.py similarity index 100% rename from Day41-55/car/search/views.py rename to Day41-55/code/car/search/views.py diff --git a/Day41-55/car/static/images/icon-no.svg b/Day41-55/code/car/static/images/icon-no.svg similarity index 100% rename from Day41-55/car/static/images/icon-no.svg rename to Day41-55/code/car/static/images/icon-no.svg diff --git a/Day41-55/car/static/images/icon-yes.svg b/Day41-55/code/car/static/images/icon-yes.svg similarity index 100% rename from Day41-55/car/static/images/icon-yes.svg rename to Day41-55/code/car/static/images/icon-yes.svg diff --git a/Day41-55/car/templates/add.html b/Day41-55/code/car/templates/add.html similarity index 100% rename from Day41-55/car/templates/add.html rename to Day41-55/code/car/templates/add.html diff --git a/Day41-55/car/templates/search.html b/Day41-55/code/car/templates/search.html similarity index 100% rename from Day41-55/car/templates/search.html rename to Day41-55/code/car/templates/search.html diff --git a/Day41-55/car/templates/search2.html b/Day41-55/code/car/templates/search2.html similarity index 100% rename from Day41-55/car/templates/search2.html rename to Day41-55/code/car/templates/search2.html diff --git a/Day41-55/oa/hrs/__init__.py b/Day41-55/code/hellodjango/db.sqlite3 similarity index 100% rename from Day41-55/oa/hrs/__init__.py rename to Day41-55/code/hellodjango/db.sqlite3 diff --git a/Day41-55/oa/hrs/migrations/__init__.py b/Day41-55/code/hellodjango/demo/__init__.py similarity index 100% rename from Day41-55/oa/hrs/migrations/__init__.py rename to Day41-55/code/hellodjango/demo/__init__.py diff --git a/Day41-55/code/hellodjango/demo/admin.py b/Day41-55/code/hellodjango/demo/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..c6a7284ffd2fe544580341558bab08d712b2d93e --- /dev/null +++ b/Day41-55/code/hellodjango/demo/admin.py @@ -0,0 +1,12 @@ +from django.contrib import admin + +from demo.models import Teacher + + +class TeacherAdmin(admin.ModelAdmin): + list_display = ('no', 'name', 'job', 'intro', 'motto') + search_fields = ('name', 'intro') + ordering = ('no', ) + + +admin.site.register(Teacher, TeacherAdmin) diff --git a/Day41-55/code/hellodjango/demo/apps.py b/Day41-55/code/hellodjango/demo/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..57920c332b6e27a518c8aecf58c770f868328449 --- /dev/null +++ b/Day41-55/code/hellodjango/demo/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class DemoConfig(AppConfig): + name = 'demo' diff --git a/Day41-55/code/hellodjango/demo/migrations/0001_initial.py b/Day41-55/code/hellodjango/demo/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..ab29432cff27cc6475a136bf6490bdbce86e59d3 --- /dev/null +++ b/Day41-55/code/hellodjango/demo/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 2.0.6 on 2018-07-03 02:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Teacher', + fields=[ + ('no', models.AutoField(db_column='tno', primary_key=True, serialize=False)), + ('name', models.CharField(db_column='tname', max_length=20)), + ('job', models.CharField(db_column='tjob', max_length=10)), + ('intro', models.CharField(db_column='tintro', max_length=1023)), + ('motto', models.CharField(db_column='tmotto', max_length=255)), + ], + options={ + 'db_table': 'tb_teacher', + }, + ), + ] diff --git a/Day41-55/code/hellodjango/demo/migrations/0002_teacher_photo.py b/Day41-55/code/hellodjango/demo/migrations/0002_teacher_photo.py new file mode 100644 index 0000000000000000000000000000000000000000..b325a2ca59d3b22af7143f9a03635e5f70901921 --- /dev/null +++ b/Day41-55/code/hellodjango/demo/migrations/0002_teacher_photo.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.6 on 2018-07-03 03:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='teacher', + name='photo', + field=models.CharField(db_column='tphoto', max_length=511, null=True), + ), + ] diff --git a/Day41-55/code/hellodjango/demo/migrations/0003_auto_20180703_1355.py b/Day41-55/code/hellodjango/demo/migrations/0003_auto_20180703_1355.py new file mode 100644 index 0000000000000000000000000000000000000000..f1f1d088dd0dcd23fbbd1fb55e181b0d94c8c10d --- /dev/null +++ b/Day41-55/code/hellodjango/demo/migrations/0003_auto_20180703_1355.py @@ -0,0 +1,17 @@ +# Generated by Django 2.0.6 on 2018-07-03 05:55 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0002_teacher_photo'), + ] + + operations = [ + migrations.AlterModelTable( + name='teacher', + table=None, + ), + ] diff --git a/Day41-55/code/hellodjango/demo/migrations/0004_auto_20180703_1412.py b/Day41-55/code/hellodjango/demo/migrations/0004_auto_20180703_1412.py new file mode 100644 index 0000000000000000000000000000000000000000..2dfc593015a8274fa4618196ccea7d7c5602773c --- /dev/null +++ b/Day41-55/code/hellodjango/demo/migrations/0004_auto_20180703_1412.py @@ -0,0 +1,21 @@ +# Generated by Django 2.0.6 on 2018-07-03 06:12 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0003_auto_20180703_1355'), + ] + + operations = [ + migrations.AlterModelOptions( + name='teacher', + options={'ordering': ('-no',)}, + ), + migrations.AlterModelTable( + name='teacher', + table='tb_teacher', + ), + ] diff --git a/Day41-55/shop/cart/__init__.py b/Day41-55/code/hellodjango/demo/migrations/__init__.py similarity index 100% rename from Day41-55/shop/cart/__init__.py rename to Day41-55/code/hellodjango/demo/migrations/__init__.py diff --git a/Day41-55/code/hellodjango/demo/models.py b/Day41-55/code/hellodjango/demo/models.py new file mode 100644 index 0000000000000000000000000000000000000000..f6a7fcc97d15eefaf09c4b61fe9f84a97ce0883d --- /dev/null +++ b/Day41-55/code/hellodjango/demo/models.py @@ -0,0 +1,17 @@ +from django.db import models + +# Django框架中包含了ORM(对象关系映射)框架 +# ORM可以帮助我们完成对象模型到关系模型的双向转换 + + +class Teacher(models.Model): + no = models.AutoField(primary_key=True, db_column='tno', verbose_name='编号') + name = models.CharField(max_length=20, db_column='tname', verbose_name='姓名') + job = models.CharField(max_length=10, db_column='tjob', verbose_name='职位') + intro = models.CharField(max_length=1023, db_column='tintro', verbose_name='简介') + motto = models.CharField(max_length=255, db_column='tmotto', verbose_name='教学理念') + photo = models.CharField(max_length=511, db_column='tphoto', null=True) + + class Meta(object): + db_table = 'tb_teacher' + ordering = ('-no', ) diff --git a/Day41-55/oa/hrs/tests.py b/Day41-55/code/hellodjango/demo/tests.py similarity index 100% rename from Day41-55/oa/hrs/tests.py rename to Day41-55/code/hellodjango/demo/tests.py diff --git a/Day41-55/code/hellodjango/demo/views.py b/Day41-55/code/hellodjango/demo/views.py new file mode 100644 index 0000000000000000000000000000000000000000..d1e779d3bc46ae0ad637c6f635e833caa18c6a40 --- /dev/null +++ b/Day41-55/code/hellodjango/demo/views.py @@ -0,0 +1,9 @@ +from django.shortcuts import render + +from demo.models import Teacher + + +def home(request): + # 通过ORM框架实现持久化操作CRUD + ctx = {'teachers_list': list(Teacher.objects.all())} + return render(request, 'demo/home.html', ctx) diff --git a/Day41-55/oa/oa/__init__.py b/Day41-55/code/hellodjango/hellodjango/__init__.py similarity index 100% rename from Day41-55/oa/oa/__init__.py rename to Day41-55/code/hellodjango/hellodjango/__init__.py diff --git a/Day41-55/code/hellodjango/hellodjango/settings.py b/Day41-55/code/hellodjango/hellodjango/settings.py new file mode 100644 index 0000000000000000000000000000000000000000..96e21a3b6361b19f74d8ce2c4aa2f7b02c8d7e32 --- /dev/null +++ b/Day41-55/code/hellodjango/hellodjango/settings.py @@ -0,0 +1,127 @@ +""" +Django settings for hellodjango project. + +Generated by 'django-admin startproject' using Django 2.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/2.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.0/ref/settings/ +""" + +import os + +# 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/2.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'j*jr(3-it8$lrp&u@e^!f%8!ws*=jx)ga*ln%l6aqftu-uy1=1' + +# 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', + 'demo', +] + +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 = 'hellodjango.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(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 = 'hellodjango.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'demo', + 'HOST': '120.77.222.217', + 'PORT': 3306, + 'USER': 'root', + 'PASSWORD': '123456', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.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/2.0/topics/i18n/ + +LANGUAGE_CODE = 'zh-hans' + +TIME_ZONE = 'Asia/Chongqing' + +# internationalization +USE_I18N = True + +# localization +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.0/howto/static-files/ +STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] +STATIC_URL = '/static/' diff --git a/Day41-55/code/hellodjango/hellodjango/urls.py b/Day41-55/code/hellodjango/hellodjango/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..b0028fffcb12845e051feda775928a4dff108034 --- /dev/null +++ b/Day41-55/code/hellodjango/hellodjango/urls.py @@ -0,0 +1,24 @@ +"""hellodjango URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.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 + +from demo import views + +urlpatterns = [ + path('', views.home), + path('admin/', admin.site.urls), +] diff --git a/Day41-55/code/hellodjango/hellodjango/wsgi.py b/Day41-55/code/hellodjango/hellodjango/wsgi.py new file mode 100644 index 0000000000000000000000000000000000000000..661e9b4445f03b6777a32182abf4937c6f10fa2a --- /dev/null +++ b/Day41-55/code/hellodjango/hellodjango/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for hellodjango 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/2.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hellodjango.settings") + +application = get_wsgi_application() diff --git a/Day41-55/code/hellodjango/manage.py b/Day41-55/code/hellodjango/manage.py new file mode 100644 index 0000000000000000000000000000000000000000..f45676fa62816b13b235e9858356301354e8faee --- /dev/null +++ b/Day41-55/code/hellodjango/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hellodjango.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) diff --git a/Day41-55/code/hellodjango/static/images/andrew.png b/Day41-55/code/hellodjango/static/images/andrew.png new file mode 100644 index 0000000000000000000000000000000000000000..195e6e745a43d5901d21bba1df0e795dc7a5ac95 Binary files /dev/null and b/Day41-55/code/hellodjango/static/images/andrew.png differ diff --git a/Day41-55/code/hellodjango/static/images/dennis.png b/Day41-55/code/hellodjango/static/images/dennis.png new file mode 100644 index 0000000000000000000000000000000000000000..24533401b8e38d913dbdae7761e8fe586410dfd5 Binary files /dev/null and b/Day41-55/code/hellodjango/static/images/dennis.png differ diff --git a/Day41-55/code/hellodjango/static/images/ken.png b/Day41-55/code/hellodjango/static/images/ken.png new file mode 100644 index 0000000000000000000000000000000000000000..5d322c4ca9c5ea88e8b9a1db30caefebf764f480 Binary files /dev/null and b/Day41-55/code/hellodjango/static/images/ken.png differ diff --git a/Day41-55/code/hellodjango/static/images/linus.png b/Day41-55/code/hellodjango/static/images/linus.png new file mode 100644 index 0000000000000000000000000000000000000000..acbe3bf986e85c9875ce7459a9aa16b805805b85 Binary files /dev/null and b/Day41-55/code/hellodjango/static/images/linus.png differ diff --git a/Day41-55/code/hellodjango/templates/demo/home.html b/Day41-55/code/hellodjango/templates/demo/home.html new file mode 100644 index 0000000000000000000000000000000000000000..ea2c9584c0d00f2a8fdc94678a3f52d9227121e9 --- /dev/null +++ b/Day41-55/code/hellodjango/templates/demo/home.html @@ -0,0 +1,23 @@ + +{% load staticfiles %} + + + + 讲师信息 + + + {% for x in teachers_list %} +

{{ x.name }}老师 - {{ x.job }}

+

讲师简介

+

{{ x.intro }}

+

教学理念

+

{{ x.motto }}

+

+ {% if x.photo %} + + {% endif %} +

+
+ {% endfor %} + + \ No newline at end of file diff --git a/Day41-55/shop/cart/migrations/__init__.py b/Day41-55/code/oa/hrs/__init__.py similarity index 100% rename from Day41-55/shop/cart/migrations/__init__.py rename to Day41-55/code/oa/hrs/__init__.py diff --git a/Day41-55/oa/hrs/admin.py b/Day41-55/code/oa/hrs/admin.py similarity index 100% rename from Day41-55/oa/hrs/admin.py rename to Day41-55/code/oa/hrs/admin.py diff --git a/Day41-55/oa/hrs/apps.py b/Day41-55/code/oa/hrs/apps.py similarity index 100% rename from Day41-55/oa/hrs/apps.py rename to Day41-55/code/oa/hrs/apps.py diff --git a/Day41-55/oa/hrs/migrations/0001_initial.py b/Day41-55/code/oa/hrs/migrations/0001_initial.py similarity index 100% rename from Day41-55/oa/hrs/migrations/0001_initial.py rename to Day41-55/code/oa/hrs/migrations/0001_initial.py diff --git a/Day41-55/oa/hrs/migrations/0002_auto_20180523_0923.py b/Day41-55/code/oa/hrs/migrations/0002_auto_20180523_0923.py similarity index 100% rename from Day41-55/oa/hrs/migrations/0002_auto_20180523_0923.py rename to Day41-55/code/oa/hrs/migrations/0002_auto_20180523_0923.py diff --git a/Day41-55/oa/hrs/migrations/0003_auto_20180524_1646.py b/Day41-55/code/oa/hrs/migrations/0003_auto_20180524_1646.py similarity index 100% rename from Day41-55/oa/hrs/migrations/0003_auto_20180524_1646.py rename to Day41-55/code/oa/hrs/migrations/0003_auto_20180524_1646.py diff --git a/Day41-55/shop_origin/cart/__init__.py b/Day41-55/code/oa/hrs/migrations/__init__.py similarity index 100% rename from Day41-55/shop_origin/cart/__init__.py rename to Day41-55/code/oa/hrs/migrations/__init__.py diff --git a/Day41-55/oa/hrs/models.py b/Day41-55/code/oa/hrs/models.py similarity index 100% rename from Day41-55/oa/hrs/models.py rename to Day41-55/code/oa/hrs/models.py diff --git a/Day41-55/shop/cart/tests.py b/Day41-55/code/oa/hrs/tests.py similarity index 100% rename from Day41-55/shop/cart/tests.py rename to Day41-55/code/oa/hrs/tests.py diff --git a/Day41-55/oa/hrs/urls.py b/Day41-55/code/oa/hrs/urls.py similarity index 100% rename from Day41-55/oa/hrs/urls.py rename to Day41-55/code/oa/hrs/urls.py diff --git a/Day41-55/oa/hrs/views.py b/Day41-55/code/oa/hrs/views.py similarity index 100% rename from Day41-55/oa/hrs/views.py rename to Day41-55/code/oa/hrs/views.py diff --git a/Day41-55/oa/manage.py b/Day41-55/code/oa/manage.py similarity index 100% rename from Day41-55/oa/manage.py rename to Day41-55/code/oa/manage.py diff --git a/Day41-55/shop/shop/__init__.py b/Day41-55/code/oa/oa/__init__.py similarity index 100% rename from Day41-55/shop/shop/__init__.py rename to Day41-55/code/oa/oa/__init__.py diff --git a/Day41-55/oa/oa/settings.py b/Day41-55/code/oa/oa/settings.py similarity index 100% rename from Day41-55/oa/oa/settings.py rename to Day41-55/code/oa/oa/settings.py diff --git a/Day41-55/oa/oa/urls.py b/Day41-55/code/oa/oa/urls.py similarity index 100% rename from Day41-55/oa/oa/urls.py rename to Day41-55/code/oa/oa/urls.py diff --git a/Day41-55/oa/oa/wsgi.py b/Day41-55/code/oa/oa/wsgi.py similarity index 100% rename from Day41-55/oa/oa/wsgi.py rename to Day41-55/code/oa/oa/wsgi.py diff --git a/Day41-55/oa/static/css/bootstrap.min.css b/Day41-55/code/oa/static/css/bootstrap.min.css similarity index 100% rename from Day41-55/oa/static/css/bootstrap.min.css rename to Day41-55/code/oa/static/css/bootstrap.min.css diff --git a/Day41-55/oa/static/images/mm.jpg b/Day41-55/code/oa/static/images/mm.jpg similarity index 100% rename from Day41-55/oa/static/images/mm.jpg rename to Day41-55/code/oa/static/images/mm.jpg diff --git a/Day41-55/oa/static/js/bootstrap.min.js b/Day41-55/code/oa/static/js/bootstrap.min.js similarity index 100% rename from Day41-55/oa/static/js/bootstrap.min.js rename to Day41-55/code/oa/static/js/bootstrap.min.js diff --git a/Day41-55/oa/static/js/jquery.min.js b/Day41-55/code/oa/static/js/jquery.min.js similarity index 100% rename from Day41-55/oa/static/js/jquery.min.js rename to Day41-55/code/oa/static/js/jquery.min.js diff --git a/Day41-55/oa/templates/dept.html b/Day41-55/code/oa/templates/dept.html similarity index 100% rename from Day41-55/oa/templates/dept.html rename to Day41-55/code/oa/templates/dept.html diff --git a/Day41-55/oa/templates/emp.html b/Day41-55/code/oa/templates/emp.html similarity index 100% rename from Day41-55/oa/templates/emp.html rename to Day41-55/code/oa/templates/emp.html diff --git a/Day41-55/oa/templates/index.html b/Day41-55/code/oa/templates/index.html similarity index 100% rename from Day41-55/oa/templates/index.html rename to Day41-55/code/oa/templates/index.html diff --git a/Day41-55/shop_origin/cart/migrations/__init__.py b/Day41-55/code/shop/cart/__init__.py similarity index 100% rename from Day41-55/shop_origin/cart/migrations/__init__.py rename to Day41-55/code/shop/cart/__init__.py diff --git a/Day41-55/shop/cart/admin.py b/Day41-55/code/shop/cart/admin.py similarity index 100% rename from Day41-55/shop/cart/admin.py rename to Day41-55/code/shop/cart/admin.py diff --git a/Day41-55/shop/cart/apps.py b/Day41-55/code/shop/cart/apps.py similarity index 100% rename from Day41-55/shop/cart/apps.py rename to Day41-55/code/shop/cart/apps.py diff --git a/Day41-55/shop/cart/migrations/0001_initial.py b/Day41-55/code/shop/cart/migrations/0001_initial.py similarity index 100% rename from Day41-55/shop/cart/migrations/0001_initial.py rename to Day41-55/code/shop/cart/migrations/0001_initial.py diff --git a/Day41-55/code/shop/cart/migrations/__init__.py b/Day41-55/code/shop/cart/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Day41-55/shop/cart/models.py b/Day41-55/code/shop/cart/models.py similarity index 100% rename from Day41-55/shop/cart/models.py rename to Day41-55/code/shop/cart/models.py diff --git a/Day41-55/shop_origin/cart/tests.py b/Day41-55/code/shop/cart/tests.py similarity index 100% rename from Day41-55/shop_origin/cart/tests.py rename to Day41-55/code/shop/cart/tests.py diff --git a/Day41-55/shop/cart/views.py b/Day41-55/code/shop/cart/views.py similarity index 100% rename from Day41-55/shop/cart/views.py rename to Day41-55/code/shop/cart/views.py diff --git a/Day41-55/shop/manage.py b/Day41-55/code/shop/manage.py similarity index 100% rename from Day41-55/shop/manage.py rename to Day41-55/code/shop/manage.py diff --git a/Day41-55/code/shop/shop/__init__.py b/Day41-55/code/shop/shop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9c0f75627493779a57ce48f0b76e35cc87b8984a --- /dev/null +++ b/Day41-55/code/shop/shop/__init__.py @@ -0,0 +1,3 @@ +import pymysql + +pymysql.install_as_MySQLdb() diff --git a/Day41-55/shop/shop/settings.py b/Day41-55/code/shop/shop/settings.py similarity index 100% rename from Day41-55/shop/shop/settings.py rename to Day41-55/code/shop/shop/settings.py diff --git a/Day41-55/shop/shop/urls.py b/Day41-55/code/shop/shop/urls.py similarity index 100% rename from Day41-55/shop/shop/urls.py rename to Day41-55/code/shop/shop/urls.py diff --git a/Day41-55/shop/shop/wsgi.py b/Day41-55/code/shop/shop/wsgi.py similarity index 100% rename from Day41-55/shop/shop/wsgi.py rename to Day41-55/code/shop/shop/wsgi.py diff --git a/Day41-55/shop/static/images/dolbee.jpg b/Day41-55/code/shop/static/images/dolbee.jpg similarity index 100% rename from Day41-55/shop/static/images/dolbee.jpg rename to Day41-55/code/shop/static/images/dolbee.jpg diff --git a/Day41-55/shop/static/images/lay.jpg b/Day41-55/code/shop/static/images/lay.jpg similarity index 100% rename from Day41-55/shop/static/images/lay.jpg rename to Day41-55/code/shop/static/images/lay.jpg diff --git a/Day41-55/shop/static/images/noodle.jpg b/Day41-55/code/shop/static/images/noodle.jpg similarity index 100% rename from Day41-55/shop/static/images/noodle.jpg rename to Day41-55/code/shop/static/images/noodle.jpg diff --git a/Day41-55/shop/static/images/oil.jpg b/Day41-55/code/shop/static/images/oil.jpg similarity index 100% rename from Day41-55/shop/static/images/oil.jpg rename to Day41-55/code/shop/static/images/oil.jpg diff --git a/Day41-55/shop/static/images/wang.jpg b/Day41-55/code/shop/static/images/wang.jpg similarity index 100% rename from Day41-55/shop/static/images/wang.jpg rename to Day41-55/code/shop/static/images/wang.jpg diff --git a/Day41-55/shop/static/images/wine.jpg b/Day41-55/code/shop/static/images/wine.jpg similarity index 100% rename from Day41-55/shop/static/images/wine.jpg rename to Day41-55/code/shop/static/images/wine.jpg diff --git a/Day41-55/shop/templates/cart.html b/Day41-55/code/shop/templates/cart.html similarity index 100% rename from Day41-55/shop/templates/cart.html rename to Day41-55/code/shop/templates/cart.html diff --git a/Day41-55/shop/templates/goods.html b/Day41-55/code/shop/templates/goods.html similarity index 100% rename from Day41-55/shop/templates/goods.html rename to Day41-55/code/shop/templates/goods.html diff --git a/Day41-55/code/shop_origin/cart/__init__.py b/Day41-55/code/shop_origin/cart/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Day41-55/shop_origin/cart/admin.py b/Day41-55/code/shop_origin/cart/admin.py similarity index 100% rename from Day41-55/shop_origin/cart/admin.py rename to Day41-55/code/shop_origin/cart/admin.py diff --git a/Day41-55/shop_origin/cart/apps.py b/Day41-55/code/shop_origin/cart/apps.py similarity index 100% rename from Day41-55/shop_origin/cart/apps.py rename to Day41-55/code/shop_origin/cart/apps.py diff --git a/Day41-55/shop_origin/cart/migrations/0001_initial.py b/Day41-55/code/shop_origin/cart/migrations/0001_initial.py similarity index 100% rename from Day41-55/shop_origin/cart/migrations/0001_initial.py rename to Day41-55/code/shop_origin/cart/migrations/0001_initial.py diff --git a/Day41-55/code/shop_origin/cart/migrations/__init__.py b/Day41-55/code/shop_origin/cart/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Day41-55/shop_origin/cart/models.py b/Day41-55/code/shop_origin/cart/models.py similarity index 100% rename from Day41-55/shop_origin/cart/models.py rename to Day41-55/code/shop_origin/cart/models.py diff --git a/Day41-55/code/shop_origin/cart/tests.py b/Day41-55/code/shop_origin/cart/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..7ce503c2dd97ba78597f6ff6e4393132753573f6 --- /dev/null +++ b/Day41-55/code/shop_origin/cart/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Day41-55/shop_origin/cart/views.py b/Day41-55/code/shop_origin/cart/views.py similarity index 100% rename from Day41-55/shop_origin/cart/views.py rename to Day41-55/code/shop_origin/cart/views.py diff --git a/Day41-55/shop_origin/manage.py b/Day41-55/code/shop_origin/manage.py old mode 100755 new mode 100644 similarity index 100% rename from Day41-55/shop_origin/manage.py rename to Day41-55/code/shop_origin/manage.py diff --git a/Day41-55/shop_origin/shop/__init__.py b/Day41-55/code/shop_origin/shop/__init__.py similarity index 100% rename from Day41-55/shop_origin/shop/__init__.py rename to Day41-55/code/shop_origin/shop/__init__.py diff --git a/Day41-55/shop_origin/shop/settings.py b/Day41-55/code/shop_origin/shop/settings.py similarity index 100% rename from Day41-55/shop_origin/shop/settings.py rename to Day41-55/code/shop_origin/shop/settings.py diff --git a/Day41-55/shop_origin/shop/urls.py b/Day41-55/code/shop_origin/shop/urls.py similarity index 100% rename from Day41-55/shop_origin/shop/urls.py rename to Day41-55/code/shop_origin/shop/urls.py diff --git a/Day41-55/shop_origin/shop/wsgi.py b/Day41-55/code/shop_origin/shop/wsgi.py similarity index 100% rename from Day41-55/shop_origin/shop/wsgi.py rename to Day41-55/code/shop_origin/shop/wsgi.py diff --git a/Day41-55/shop_origin/shop_create_sql.sql b/Day41-55/code/shop_origin/shop_create_sql.sql similarity index 100% rename from Day41-55/shop_origin/shop_create_sql.sql rename to Day41-55/code/shop_origin/shop_create_sql.sql diff --git a/Day41-55/shop_origin/static/images/dolbee.jpg b/Day41-55/code/shop_origin/static/images/dolbee.jpg similarity index 100% rename from Day41-55/shop_origin/static/images/dolbee.jpg rename to Day41-55/code/shop_origin/static/images/dolbee.jpg diff --git a/Day41-55/shop_origin/static/images/lay.jpg b/Day41-55/code/shop_origin/static/images/lay.jpg similarity index 100% rename from Day41-55/shop_origin/static/images/lay.jpg rename to Day41-55/code/shop_origin/static/images/lay.jpg diff --git a/Day41-55/shop_origin/static/images/noodle.jpg b/Day41-55/code/shop_origin/static/images/noodle.jpg similarity index 100% rename from Day41-55/shop_origin/static/images/noodle.jpg rename to Day41-55/code/shop_origin/static/images/noodle.jpg diff --git a/Day41-55/shop_origin/static/images/oil.jpg b/Day41-55/code/shop_origin/static/images/oil.jpg similarity index 100% rename from Day41-55/shop_origin/static/images/oil.jpg rename to Day41-55/code/shop_origin/static/images/oil.jpg diff --git a/Day41-55/shop_origin/static/images/wang.jpg b/Day41-55/code/shop_origin/static/images/wang.jpg similarity index 100% rename from Day41-55/shop_origin/static/images/wang.jpg rename to Day41-55/code/shop_origin/static/images/wang.jpg diff --git a/Day41-55/shop_origin/static/images/wine.jpg b/Day41-55/code/shop_origin/static/images/wine.jpg similarity index 100% rename from Day41-55/shop_origin/static/images/wine.jpg rename to Day41-55/code/shop_origin/static/images/wine.jpg diff --git a/Day41-55/shop_origin/templates/cart.html b/Day41-55/code/shop_origin/templates/cart.html similarity index 100% rename from Day41-55/shop_origin/templates/cart.html rename to Day41-55/code/shop_origin/templates/cart.html diff --git a/Day41-55/shop_origin/templates/goods.html b/Day41-55/code/shop_origin/templates/goods.html similarity index 100% rename from Day41-55/shop_origin/templates/goods.html rename to Day41-55/code/shop_origin/templates/goods.html