├── apps ├── __init__.py ├── cart │ ├── __init__.py │ ├── models.py │ ├── migrations │ │ └── __init__.py │ ├── admin.py │ ├── tests.py │ ├── apps.py │ ├── urls.py │ └── views.py ├── goods │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0002_auto_20200529_1047.py │ ├── tests.py │ ├── apps.py │ ├── admin.py │ ├── urls.py │ ├── search_indexes.py │ └── models.py ├── order │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0003_auto_20200529_1047.py │ │ ├── 0002_auto_20200422_1239.py │ │ └── 0001_initial.py │ ├── tests.py │ ├── apps.py │ ├── admin.py │ ├── alipay_public_key.pem │ ├── urls.py │ ├── app_private_key.pem │ └── models.py └── user │ ├── __init__.py │ ├── migrations │ ├── __init__.py │ ├── 0002_user_image.py │ └── 0001_initial.py │ ├── tests.py │ ├── apps.py │ ├── admin.py │ ├── urls.py │ └── models.py ├── db ├── __init__.py └── base_model.py ├── utils ├── __init__.py ├── fdfs │ ├── __init__.py │ ├── client.conf │ └── storage.py ├── image_code │ ├── __init__.py │ └── code.py └── mixin.py ├── celery_tasks ├── __init__.py └── tasks.py ├── whoosh_index ├── MAIN_WRITELOCK ├── _MAIN_48.toc ├── MAIN_8thewgrpua0pgm7x.seg └── MAIN_fusgv71c9lvjdhx1.seg ├── .idea ├── .gitignore ├── vcs.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── modules.xml ├── misc.xml └── dailyfresh.iml ├── dailyfresh ├── __init__.py ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── Scripts ├── pip.exe ├── pip3.exe ├── celery.exe ├── mid3cp.exe ├── mid3v2.exe ├── pip3.7.exe ├── python.exe ├── futurize.exe ├── mid3iconv.exe ├── moggsplit.exe ├── pip-script.py ├── pythonw.exe ├── sqlformat.exe ├── chardetect.exe ├── pasteurize.exe ├── pip3-script.py ├── django-admin.exe ├── easy_install.exe ├── futurize-script.py ├── mutagen-pony.exe ├── pip3.7-script.py ├── easy_install-3.7.exe ├── mutagen-inspect.exe ├── pasteurize-script.py ├── easy_install-script.py ├── easy_install-3.7-script.py ├── django-admin.py ├── deactivate.bat ├── activate.bat ├── Activate.ps1 └── activate ├── pyvenv.cfg ├── static ├── static │ ├── 1.jpg │ ├── tinymce │ │ ├── skins │ │ │ ├── ui │ │ │ │ ├── oxide │ │ │ │ │ ├── fonts │ │ │ │ │ │ └── tinymce-mobile.woff │ │ │ │ │ └── content.mobile.min.css │ │ │ │ └── oxide-dark │ │ │ │ │ ├── fonts │ │ │ │ │ └── tinymce-mobile.woff │ │ │ │ │ └── content.mobile.min.css │ │ │ └── content │ │ │ │ ├── default │ │ │ │ └── content.min.css │ │ │ │ ├── writer │ │ │ │ └── content.min.css │ │ │ │ └── document │ │ │ │ └── content.min.css │ │ ├── langs │ │ │ └── readme.md │ │ └── plugins │ │ │ ├── textcolor │ │ │ └── plugin.min.js │ │ │ ├── colorpicker │ │ │ └── plugin.min.js │ │ │ ├── contextmenu │ │ │ └── plugin.min.js │ │ │ ├── hr │ │ │ └── plugin.min.js │ │ │ ├── print │ │ │ └── plugin.min.js │ │ │ ├── code │ │ │ └── plugin.min.js │ │ │ ├── nonbreaking │ │ │ └── plugin.min.js │ │ │ ├── visualblocks │ │ │ └── plugin.min.js │ │ │ ├── save │ │ │ └── plugin.min.js │ │ │ ├── noneditable │ │ │ └── plugin.min.js │ │ │ ├── pagebreak │ │ │ └── plugin.min.js │ │ │ ├── tabfocus │ │ │ └── plugin.min.js │ │ │ ├── preview │ │ │ └── plugin.min.js │ │ │ ├── anchor │ │ │ └── plugin.min.js │ │ │ ├── autoresize │ │ │ └── plugin.min.js │ │ │ ├── autolink │ │ │ └── plugin.min.js │ │ │ ├── legacyoutput │ │ │ └── plugin.min.js │ │ │ ├── bbcode │ │ │ └── plugin.min.js │ │ │ ├── insertdatetime │ │ │ └── plugin.min.js │ │ │ ├── autosave │ │ │ └── plugin.min.js │ │ │ ├── toc │ │ │ └── plugin.min.js │ │ │ ├── advlist │ │ │ └── plugin.min.js │ │ │ ├── directionality │ │ │ └── plugin.min.js │ │ │ └── importcss │ │ │ └── plugin.min.js │ └── django_tinymce │ │ └── init_tinymce.js ├── images │ ├── adv01.jpg │ ├── adv02.jpg │ ├── down.png │ ├── fruit.jpg │ ├── goods.jpg │ ├── icons.png │ ├── logo.png │ ├── slide.jpg │ ├── banner01.jpg │ ├── banner02.jpg │ ├── banner03.jpg │ ├── banner04.jpg │ ├── banner05.jpg │ ├── banner06.jpg │ ├── goods02.jpg │ ├── icons02.png │ ├── left_bg.jpg │ ├── logo02.png │ ├── slide02.jpg │ ├── slide03.jpg │ ├── slide04.jpg │ ├── pay_icons.png │ ├── shop_cart.png │ ├── goods_detail.jpg │ ├── interval_line.png │ ├── login_banner.png │ ├── goods │ │ ├── goods001.jpg │ │ ├── goods002.jpg │ │ ├── goods003.jpg │ │ ├── goods004.jpg │ │ ├── goods005.jpg │ │ ├── goods006.jpg │ │ ├── goods007.jpg │ │ ├── goods008.jpg │ │ ├── goods009.jpg │ │ ├── goods010.jpg │ │ ├── goods011.jpg │ │ ├── goods012.jpg │ │ ├── goods013.jpg │ │ ├── goods014.jpg │ │ ├── goods015.jpg │ │ ├── goods016.jpg │ │ ├── goods017.jpg │ │ ├── goods018.jpg │ │ ├── goods019.jpg │ │ ├── goods020.jpg │ │ └── goods021.jpg │ └── register_banner.png ├── css │ └── reset.css ├── test.html └── js │ ├── register.js │ ├── slide.js │ └── jquery.cookie.js ├── templates ├── search │ ├── indexes │ │ ├── goods │ │ │ └── goodssku_text.txt │ │ └── list.html │ ├── search1.html │ └── search.html ├── base_nocart.html ├── base_user_center.html ├── base_detail_list.html ├── login.html ├── order_comment.html ├── register.html ├── list.html ├── index.html ├── user_center_info.html ├── base.html ├── user_center_site.html ├── place_order.html ├── changepassword.html └── user_center_order.html ├── uwsgi.ini ├── manage.py ├── README.md ├── share └── man │ └── man1 │ ├── mutagen-pony.1 │ ├── mutagen-inspect.1 │ ├── mid3iconv.1 │ ├── moggsplit.1 │ ├── mid3cp.1 │ └── mid3v2.1 └── Include └── site └── python3.7 └── greenlet └── greenlet.h /apps/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/cart/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/cart/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/goods/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/order/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/user/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/fdfs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /celery_tasks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/image_code/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /whoosh_index/MAIN_WRITELOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/cart/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/goods/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/order/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/user/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /dailyfresh/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # super_user_name:admin password:123456 -------------------------------------------------------------------------------- /Scripts/pip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pip.exe -------------------------------------------------------------------------------- /Scripts/pip3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pip3.exe -------------------------------------------------------------------------------- /Scripts/celery.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/celery.exe -------------------------------------------------------------------------------- /Scripts/mid3cp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/mid3cp.exe -------------------------------------------------------------------------------- /Scripts/mid3v2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/mid3v2.exe -------------------------------------------------------------------------------- /Scripts/pip3.7.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pip3.7.exe -------------------------------------------------------------------------------- /Scripts/python.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/python.exe -------------------------------------------------------------------------------- /Scripts/futurize.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/futurize.exe -------------------------------------------------------------------------------- /Scripts/mid3iconv.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/mid3iconv.exe -------------------------------------------------------------------------------- /Scripts/moggsplit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/moggsplit.exe -------------------------------------------------------------------------------- /Scripts/pip-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pip-script.py -------------------------------------------------------------------------------- /Scripts/pythonw.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pythonw.exe -------------------------------------------------------------------------------- /Scripts/sqlformat.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/sqlformat.exe -------------------------------------------------------------------------------- /apps/cart/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/cart/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/goods/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/order/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/user/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /pyvenv.cfg: -------------------------------------------------------------------------------- 1 | home = E:\python 2 | include-system-site-packages = false 3 | version = 3.7.3 4 | -------------------------------------------------------------------------------- /static/static/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/static/1.jpg -------------------------------------------------------------------------------- /Scripts/chardetect.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/chardetect.exe -------------------------------------------------------------------------------- /Scripts/pasteurize.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pasteurize.exe -------------------------------------------------------------------------------- /Scripts/pip3-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pip3-script.py -------------------------------------------------------------------------------- /static/images/adv01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/adv01.jpg -------------------------------------------------------------------------------- /static/images/adv02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/adv02.jpg -------------------------------------------------------------------------------- /static/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/down.png -------------------------------------------------------------------------------- /static/images/fruit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/fruit.jpg -------------------------------------------------------------------------------- /static/images/goods.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods.jpg -------------------------------------------------------------------------------- /static/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/icons.png -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/logo.png -------------------------------------------------------------------------------- /static/images/slide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/slide.jpg -------------------------------------------------------------------------------- /Scripts/django-admin.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/django-admin.exe -------------------------------------------------------------------------------- /Scripts/easy_install.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/easy_install.exe -------------------------------------------------------------------------------- /Scripts/futurize-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/futurize-script.py -------------------------------------------------------------------------------- /Scripts/mutagen-pony.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/mutagen-pony.exe -------------------------------------------------------------------------------- /Scripts/pip3.7-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pip3.7-script.py -------------------------------------------------------------------------------- /static/images/banner01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/banner01.jpg -------------------------------------------------------------------------------- /static/images/banner02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/banner02.jpg -------------------------------------------------------------------------------- /static/images/banner03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/banner03.jpg -------------------------------------------------------------------------------- /static/images/banner04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/banner04.jpg -------------------------------------------------------------------------------- /static/images/banner05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/banner05.jpg -------------------------------------------------------------------------------- /static/images/banner06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/banner06.jpg -------------------------------------------------------------------------------- /static/images/goods02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods02.jpg -------------------------------------------------------------------------------- /static/images/icons02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/icons02.png -------------------------------------------------------------------------------- /static/images/left_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/left_bg.jpg -------------------------------------------------------------------------------- /static/images/logo02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/logo02.png -------------------------------------------------------------------------------- /static/images/slide02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/slide02.jpg -------------------------------------------------------------------------------- /static/images/slide03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/slide03.jpg -------------------------------------------------------------------------------- /static/images/slide04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/slide04.jpg -------------------------------------------------------------------------------- /whoosh_index/_MAIN_48.toc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/whoosh_index/_MAIN_48.toc -------------------------------------------------------------------------------- /Scripts/easy_install-3.7.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/easy_install-3.7.exe -------------------------------------------------------------------------------- /Scripts/mutagen-inspect.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/mutagen-inspect.exe -------------------------------------------------------------------------------- /Scripts/pasteurize-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/pasteurize-script.py -------------------------------------------------------------------------------- /static/images/pay_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/pay_icons.png -------------------------------------------------------------------------------- /static/images/shop_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/shop_cart.png -------------------------------------------------------------------------------- /Scripts/easy_install-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/easy_install-script.py -------------------------------------------------------------------------------- /static/images/goods_detail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods_detail.jpg -------------------------------------------------------------------------------- /static/images/interval_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/interval_line.png -------------------------------------------------------------------------------- /static/images/login_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/login_banner.png -------------------------------------------------------------------------------- /static/images/goods/goods001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods001.jpg -------------------------------------------------------------------------------- /static/images/goods/goods002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods002.jpg -------------------------------------------------------------------------------- /static/images/goods/goods003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods003.jpg -------------------------------------------------------------------------------- /static/images/goods/goods004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods004.jpg -------------------------------------------------------------------------------- /static/images/goods/goods005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods005.jpg -------------------------------------------------------------------------------- /static/images/goods/goods006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods006.jpg -------------------------------------------------------------------------------- /static/images/goods/goods007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods007.jpg -------------------------------------------------------------------------------- /static/images/goods/goods008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods008.jpg -------------------------------------------------------------------------------- /static/images/goods/goods009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods009.jpg -------------------------------------------------------------------------------- /static/images/goods/goods010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods010.jpg -------------------------------------------------------------------------------- /static/images/goods/goods011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods011.jpg -------------------------------------------------------------------------------- /static/images/goods/goods012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods012.jpg -------------------------------------------------------------------------------- /static/images/goods/goods013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods013.jpg -------------------------------------------------------------------------------- /static/images/goods/goods014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods014.jpg -------------------------------------------------------------------------------- /static/images/goods/goods015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods015.jpg -------------------------------------------------------------------------------- /static/images/goods/goods016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods016.jpg -------------------------------------------------------------------------------- /static/images/goods/goods017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods017.jpg -------------------------------------------------------------------------------- /static/images/goods/goods018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods018.jpg -------------------------------------------------------------------------------- /static/images/goods/goods019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods019.jpg -------------------------------------------------------------------------------- /static/images/goods/goods020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods020.jpg -------------------------------------------------------------------------------- /static/images/goods/goods021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/goods/goods021.jpg -------------------------------------------------------------------------------- /static/images/register_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/images/register_banner.png -------------------------------------------------------------------------------- /Scripts/easy_install-3.7-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/Scripts/easy_install-3.7-script.py -------------------------------------------------------------------------------- /apps/cart/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CartConfig(AppConfig): 5 | name = 'apps.cart' 6 | -------------------------------------------------------------------------------- /apps/goods/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class GoodsConfig(AppConfig): 5 | name = 'apps.goods' 6 | -------------------------------------------------------------------------------- /apps/order/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class OrderConfig(AppConfig): 5 | name = 'apps.order' 6 | -------------------------------------------------------------------------------- /apps/user/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserConfig(AppConfig): 5 | name = 'apps.user' 6 | -------------------------------------------------------------------------------- /whoosh_index/MAIN_8thewgrpua0pgm7x.seg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/whoosh_index/MAIN_8thewgrpua0pgm7x.seg -------------------------------------------------------------------------------- /whoosh_index/MAIN_fusgv71c9lvjdhx1.seg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/whoosh_index/MAIN_fusgv71c9lvjdhx1.seg -------------------------------------------------------------------------------- /static/static/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/static/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff -------------------------------------------------------------------------------- /static/static/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CY-1/dailyfresh/HEAD/static/static/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff -------------------------------------------------------------------------------- /Scripts/django-admin.py: -------------------------------------------------------------------------------- 1 | #!E:\P语言程序\dailyfresh\Scripts\python.exe 2 | from django.core import management 3 | 4 | if __name__ == "__main__": 5 | management.execute_from_command_line() 6 | -------------------------------------------------------------------------------- /templates/search/indexes/goods/goodssku_text.txt: -------------------------------------------------------------------------------- 1 | # 指定根据与表中的哪些字段建立索引数据 2 | {{ object.name }} # 根据商品的名称建立索引 3 | {{ object.desc }} # 根据简介建立索引 4 | {{ object.goods.detail }} # 根据商品的详情建立索引 5 | 6 | -------------------------------------------------------------------------------- /apps/user/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from user.models import User, Address 3 | # Register your models here. 4 | 5 | 6 | admin.site.register(User) 7 | admin.site.register(Address) -------------------------------------------------------------------------------- /static/static/tinymce/langs/readme.md: -------------------------------------------------------------------------------- 1 | This is where language files should be placed. 2 | 3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ 4 | -------------------------------------------------------------------------------- /apps/order/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from order.models import OrderInfo, OrderGoods 3 | # Register your models here. 4 | admin.site.register(OrderInfo) 5 | admin.site.register(OrderGoods) -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/goods/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from goods.models import GoodsType, GoodsSKU, Goods, IndexTypeGoodsBanner 3 | # Register your models here. 4 | 5 | admin.site.register(GoodsType) 6 | admin.site.register(GoodsSKU) 7 | admin.site.register(Goods) 8 | admin.site.register(IndexTypeGoodsBanner) 9 | -------------------------------------------------------------------------------- /utils/mixin.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | 3 | class LoginRequireMixin(object): 4 | @classmethod 5 | def as_view(cls, **initkwargs): 6 | # 调用cls父类的as_view 因为调用第二次所以调用view 7 | view = super(LoginRequireMixin, cls).as_view(**initkwargs) 8 | return login_required(view) 9 | 10 | -------------------------------------------------------------------------------- /templates/search/search1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 搜索的关键字 {{ query }}
9 | 当前页的page对象 {{ page }}
10 | 15 | 分页对象 {{ paginator }} 16 | 17 | -------------------------------------------------------------------------------- /db/base_model.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class BaseModel(models.Model): 5 | '''模型抽象基类''' 6 | create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") 7 | update_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") 8 | is_delete = models.BooleanField(default=False, verbose_name="删除基类") 9 | 10 | class Meta: 11 | # 抽象模型类 12 | abstract= True -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /Scripts/deactivate.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if defined _OLD_VIRTUAL_PROMPT ( 4 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%" 5 | ) 6 | set _OLD_VIRTUAL_PROMPT= 7 | 8 | if defined _OLD_VIRTUAL_PYTHONHOME ( 9 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" 10 | set _OLD_VIRTUAL_PYTHONHOME= 11 | ) 12 | 13 | if defined _OLD_VIRTUAL_PATH ( 14 | set "PATH=%_OLD_VIRTUAL_PATH%" 15 | ) 16 | 17 | set _OLD_VIRTUAL_PATH= 18 | 19 | set VIRTUAL_ENV= 20 | 21 | :END 22 | -------------------------------------------------------------------------------- /apps/order/alipay_public_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5laI2k1o0QUUCrYYUJ9WWrjWmOFxTv5zkEL1keOr4OPyMh9EvfKXucjbCaKR3PVfa9KVzK3ilvLTb/X4UWhzwOgqOSzyTsLOvgK4hUfEdEoEtT01D5X+k6Jij00YpbbiYduqVcF99eiH1bpL8Di+x/x6bxmnLa+muL4PZPPjj6WqjFVD0cyE+K49wxSdjpWXotmTq1ZEvSnA96mX6GkL+bq3PWX4RE/XWx82jPrWITqXcvWQMDHsr/gzAiOho/a5A2D7/kdCIeydNxQlkDc+CKPAJVR3ZwB+R+3sDMuCHxmKcAYONIvWbamWNS0DdRxXT9yt3IHSssT7iNtlviGFWQIDAQAB 3 | -----END PUBLIC KEY----- -------------------------------------------------------------------------------- /dailyfresh/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for dailyfresh 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.0/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', 'dailyfresh.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /dailyfresh/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for dailyfresh 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.0/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', 'dailyfresh.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | # 使用nginx连接时使用,Django程序所在服务器地址 3 | socket=127.0.0.1:8080 4 | # 直接做web服务器使用,Django程序所在服务器地址 5 | # http=127.0.0.1:8080 6 | # 项目目录 7 | chdir=/pythondemo/dailyfresh 8 | # 项目中wsgi.py文件的目录,相对于项目目录 9 | wsgi-file=dailyfresh/wsgi.py 10 | # 进程数 11 | processes=4 12 | # 线程数 13 | threads=2 14 | # uwsgi服务器的角色 15 | master=True 16 | # 存放进程编号的文件 17 | pidfile=uwsgi.pid 18 | # 日志文件,因为uwsgi可以脱离终端在后台运行,日志看不见。我们以前的runserver是依赖终端的 19 | daemonize=uwsgi.log 20 | # 指定依赖的虚拟环境 21 | virtualenv=/dailyfresh/venv -------------------------------------------------------------------------------- /apps/goods/migrations/0002_auto_20200529_1047.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-05-29 02:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('goods', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='indexpromotionbanner', 15 | name='url', 16 | field=models.CharField(max_length=256, verbose_name='活动链接'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/user/migrations/0002_user_image.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-05-29 02:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='user', 15 | name='image', 16 | field=models.ImageField(default=1, upload_to='image', verbose_name='头像'), 17 | preserve_default=False, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/cart/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path 4 | from django.urls import path,include,re_path 5 | from cart.views import CartAddView,CartInfoView, CartUpdateView,CartDeleteView 6 | app_name = 'cart' 7 | urlpatterns = [ 8 | re_path(r"^add/$", CartAddView.as_view(), name='add'), 9 | re_path(r"^$", CartInfoView.as_view(), name='show'),# 购物车页面显示 10 | re_path(r"^update/$", CartUpdateView.as_view(), name='update'),# 购物车页面添加商品数 11 | re_path(r"^delete/$", CartDeleteView.as_view(), name='delete'),# 购物车删除一项订单 12 | ] -------------------------------------------------------------------------------- /apps/goods/urls.py: -------------------------------------------------------------------------------- 1 | from goods.views import IndexView, DetailView, ListView 2 | from django.contrib import admin 3 | from django.urls import path 4 | from django.urls import path,include,re_path 5 | from goods import views 6 | from django.urls import re_path 7 | from django.conf.urls import url 8 | app_name = 'goods' 9 | urlpatterns = [ 10 | url(r'^$', IndexView.as_view(), name='index'), 11 | url(r"^list/(?P\d+)/(?P\d+)/$", ListView.as_view(), name='list'), 12 | url(r'^goods/(?P\d+)/$', DetailView.as_view(), name='detail'), 13 | ] -------------------------------------------------------------------------------- /apps/goods/search_indexes.py: -------------------------------------------------------------------------------- 1 | # 定义索引类 2 | from haystack import indexes 3 | # 导入模型类 4 | from goods.models import GoodsSKU 5 | 6 | 7 | # 指定对于某个类的某些数据建立索引 8 | # 索引类名格式:模型类名+index 9 | class GoodsSKUIndex(indexes.SearchIndex, indexes.Indexable): 10 | # 索引字段 use_template=True 根据哪些字段建立字段 把说明放在一个文件中 11 | text = indexes.CharField(document=True, use_template=True) 12 | 13 | def get_model(self): 14 | return GoodsSKU 15 | 16 | # 建立索引的数据 17 | def index_queryset(self, using=None): 18 | # 返回什么 对什么建立索引 19 | return self.get_model().objects.all() -------------------------------------------------------------------------------- /templates/base_nocart.html: -------------------------------------------------------------------------------- 1 | {# 购物车和提交页面#} 2 | {% extends 'base.html' %} 3 | {% load static %} 4 | {% block search_bar %} 5 | 13 | {% endblock %} -------------------------------------------------------------------------------- /static/static/tinymce/plugins/textcolor/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); -------------------------------------------------------------------------------- /static/static/tinymce/skins/ui/oxide/content.mobile.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | */ 7 | .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} 8 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); -------------------------------------------------------------------------------- /static/static/tinymce/plugins/contextmenu/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); -------------------------------------------------------------------------------- /static/static/tinymce/skins/ui/oxide-dark/content.mobile.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | */ 7 | .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} 8 | -------------------------------------------------------------------------------- /static/css/reset.css: -------------------------------------------------------------------------------- 1 | /* 把标签默认的间距设为0 */ 2 | body,ul,ol,p,h1,h2,h3,h4,h5,h6,dl,dd,select,input,textarea,form{margin:0;padding:0} 3 | 4 | /* 让h标签文字大小继承body的文字设置 */ 5 | h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} 6 | 7 | /* 去掉列表默认的图标 */ 8 | ul,ol{list-style:none;} 9 | 10 | /* 去掉em默认的斜体 */ 11 | em{font-style: normal;} 12 | 13 | /* 去掉a标签默认的下划线 */ 14 | a{text-decoration:none;} 15 | 16 | 17 | /* 去掉加链接时产生的框线 */ 18 | img{border:0;} 19 | 20 | /* 清除浮动 */ 21 | .clearfix:before,.clearfix:after{content:"";display:table} 22 | .clearfix:after{clear:both;} 23 | .clearfix{zoom:1} 24 | 25 | /* 浮动 */ 26 | .fl{float:left} 27 | .fr{float:right} -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dailyfresh.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /apps/order/migrations/0003_auto_20200529_1047.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-05-29 02:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('order', '0002_auto_20200422_1239'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='ordergoods', 15 | name='comment', 16 | field=models.CharField(default='', max_length=256, verbose_name='评论'), 17 | ), 18 | migrations.AlterField( 19 | model_name='orderinfo', 20 | name='trade_no', 21 | field=models.CharField(default='', max_length=128, verbose_name='支付编号'), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /templates/base_user_center.html: -------------------------------------------------------------------------------- 1 | {#用户中心#} 2 | {% extends 'base_nocart.html' %} 3 | {% block title %}天天生鲜-用户中心{% endblock title %} 4 | {% block page_title %}用户中心{% endblock page_title %} 5 | {% block body %} 6 |
7 |
8 |

用户中心

9 | 14 |
15 | {% block right_content %}{% endblock right_content %} 16 |
17 | {% endblock body %} -------------------------------------------------------------------------------- /apps/order/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path 4 | from django.urls import path,include,re_path 5 | from order.views import OrderPlaceView, OrderCommitView, OrderCommitView2, OrderPayView, OrderCheck, OrderCommentView\ 6 | , OrderDelete 7 | from django.conf.urls import url 8 | app_name = 'order' 9 | urlpatterns = [ 10 | url(r'^place/$', OrderPlaceView.as_view(), name='place'),# 提交订单页面显示 11 | url(r'^commit/$', OrderCommitView.as_view(), name='commit'),# 订单创建 12 | url(r'^pay/$', OrderPayView.as_view(), name='pay'),# 支付 13 | url(r'^check/$', OrderCheck.as_view(), name='check'),# 验证支付 14 | url(r'^delete/$', OrderDelete.as_view(), name='delete'),# 删除订单 15 | url(r'^comment/(?P.+)/$', OrderCommentView.as_view(), name='comment'),# 验证支付 16 | ]# pgcshl9204@sandbox.com -------------------------------------------------------------------------------- /static/static/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}(); -------------------------------------------------------------------------------- /templates/base_detail_list.html: -------------------------------------------------------------------------------- 1 | {# 详情页和列表页#} 2 | {% extends "base.html" %} 3 | {% block body%} 4 | 24 | {# 详情页 列表页主体内容模板#} 25 | {% block main_content %} 26 | {% endblock main_content %} 27 | {% endblock body %} -------------------------------------------------------------------------------- /static/static/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),i=function(n){n.addCommand("mcePrint",function(){t.ie&&t.ie<=11?n.getDoc().execCommand("print",!1,null):n.getWin().print()})},e=function(n){n.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return n.execCommand("mcePrint")}}),n.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return n.execCommand("mcePrint")}})};!function o(){n.add("print",function(n){i(n),e(n),n.addShortcut("Meta+P","","mcePrint")})}()}(); -------------------------------------------------------------------------------- /static/static/tinymce/skins/content/default/content.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | */ 7 | body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} 8 | -------------------------------------------------------------------------------- /static/static/tinymce/skins/content/writer/content.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | */ 7 | body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} 8 | -------------------------------------------------------------------------------- /static/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |     自定义使用tinymce 6 | 7 |     8 | 18 | 19 | 20 |
21 | 24 |
25 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /static/static/tinymce/skins/content/document/content.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | */ 7 | @media screen{html{background:#f4f4f4}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dailyfresh 2 | B2B by Django3.0.5 3 | 黑马程序员Django练习项目重构到到新版本Django3.0.5 4 | ## 用户 5 | - ### 用户注册 6 | - 注册用户后发送激活邮件, 点击激活邮件里面对应的网页链接可激活账户 7 | - 激活链接的身份标识用itsdangerous的TimedJSONWebSignatureSerializer加密 8 | - celery任务队列来发送激活邮件(我的是在window使用,有报错但能正常运行), redis作为中间人 9 | - ### 用户登录 10 | - 使用自带的user认证系统 11 | - redis作为session缓存 12 | - 在需要判断登录的视图用Mixin方法,以此检测是否登录 13 | - ### 用户中心 14 | - redis作为储存历史游览记录 15 | - 可以上传多个地址 设置默认地址待补充 16 | - ### 搜索 17 | - 采用haystack框架 jieba分词 18 | - 为了兼容新版本Django模块 安装six模块 复制到了django.utils里面 19 | - ### 购物车 20 | - 后台通过ajax添加购物车 21 | - 存在redis中 22 | - 订单并发问题用悲观锁解决和mysql事务解决 23 | - 支付宝沙盒账号测试 24 | ### win下简单启动项目 25 | - 下载压缩包 解压缩 pycharm打开 26 | - 启动celery(把项目放到linux中 然后启动celery win下celery有bug) 27 | - 执行迁移生成mysql表 配置redis服务器端 fdfs_trackerd和fdfs_storaged启动 nginx启动 28 | - 修改好数据库中对应的fastDFS内容 29 | - 支付宝获取公钥私钥放在order文件夹下的 alipy_public_key_pem和app_private_key.pem 30 | - 在购买商品时 必须选择支付宝支付 31 | - 到Scripts文件夹下执行 python ../manage.py runserver 32 | - 详细过程在Issue里面有课件 33 | ## 已完成扩展功能 34 | - 更换默认地址 35 | - 删除指定指定 36 | - 使用模块美化后台管理页面 37 | - 删除订单功能完成 38 | - 种类页的添加购物车 39 | - 用户上传头像 40 | - 修改密码 通过邮箱验证码 -------------------------------------------------------------------------------- /Scripts/activate.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem This file is UTF-8 encoded, so we need to update the current code page while executing it 4 | for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do ( 5 | set "_OLD_CODEPAGE=%%a" 6 | ) 7 | if defined _OLD_CODEPAGE ( 8 | "%SystemRoot%\System32\chcp.com" 65001 > nul 9 | ) 10 | 11 | set "VIRTUAL_ENV=E:\P语言程序\dailyfresh" 12 | 13 | if not defined PROMPT ( 14 | set "PROMPT=$P$G" 15 | ) 16 | 17 | if defined _OLD_VIRTUAL_PROMPT ( 18 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%" 19 | ) 20 | 21 | if defined _OLD_VIRTUAL_PYTHONHOME ( 22 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" 23 | ) 24 | 25 | set "_OLD_VIRTUAL_PROMPT=%PROMPT%" 26 | set "PROMPT=(dailyfresh) %PROMPT%" 27 | 28 | if defined PYTHONHOME ( 29 | set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%" 30 | set PYTHONHOME= 31 | ) 32 | 33 | if defined _OLD_VIRTUAL_PATH ( 34 | set "PATH=%_OLD_VIRTUAL_PATH%" 35 | ) else ( 36 | set "_OLD_VIRTUAL_PATH=%PATH%" 37 | ) 38 | 39 | set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%" 40 | 41 | :END 42 | if defined _OLD_CODEPAGE ( 43 | "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul 44 | set "_OLD_CODEPAGE=" 45 | ) 46 | -------------------------------------------------------------------------------- /dailyfresh/urls.py: -------------------------------------------------------------------------------- 1 | """dailyfresh URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/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 18 | from django.urls import path,include,re_path 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | re_path(r"^tinymce/", include("tinymce.urls")), # 富文本编辑器 22 | re_path(r"^user/", include("user.urls")), 23 | re_path(r"^cart/", include("cart.urls")), 24 | re_path(r"^order/", include("order.urls")), 25 | re_path(r"^", include("goods.urls")), 26 | re_path(r"^search/", include('haystack.urls')),# 去交给全文检索框架 27 | ] 28 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,n){e.focus(),e.undoManager.transact(function(){e.setContent(n)}),e.selection.setCursorLocation(),e.nodeChanged()},o=function(e){return e.getContent({source_view:!0})},n=function(n){var e=o(n);n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){t(n,e.getData().code),e.close()}})},c=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},i=function(e){e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return n(e)}}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return n(e)}})};!function u(){e.add("code",function(e){return c(e),i(e),{}})}()}(); -------------------------------------------------------------------------------- /.idea/dailyfresh.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | 31 | -------------------------------------------------------------------------------- /share/man/man1/mutagen-pony.1: -------------------------------------------------------------------------------- 1 | .\" Man page generated from reStructuredText. 2 | . 3 | .TH MUTAGEN-PONY 1 "" "" "" 4 | .SH NAME 5 | mutagen-pony \- scan a collection of MP3 files 6 | . 7 | .nr rst2man-indent-level 0 8 | . 9 | .de1 rstReportMargin 10 | \\$1 \\n[an-margin] 11 | level \\n[rst2man-indent-level] 12 | level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] 13 | - 14 | \\n[rst2man-indent0] 15 | \\n[rst2man-indent1] 16 | \\n[rst2man-indent2] 17 | .. 18 | .de1 INDENT 19 | .\" .rstReportMargin pre: 20 | . RS \\$1 21 | . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] 22 | . nr rst2man-indent-level +1 23 | .\" .rstReportMargin post: 24 | .. 25 | .de UNINDENT 26 | . RE 27 | .\" indent \\n[an-margin] 28 | .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] 29 | .nr rst2man-indent-level -1 30 | .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] 31 | .in \\n[rst2man-indent\\n[rst2man-indent-level]]u 32 | .. 33 | .SH SYNOPSIS 34 | .sp 35 | \fBmutagen\-pony\fP \fIdirectory\fP ... 36 | .SH DESCRIPTION 37 | .sp 38 | \fBmutagen\-pony\fP scans any directories given and reports on the kinds of 39 | tags in the MP3s it finds in them. Ride the pony. 40 | .sp 41 | It is primarily intended as a debugging tool for Mutagen. 42 | .SH AUTHORS 43 | .sp 44 | Michael Urman and Joe Wreschnig 45 | .\" Generated by docutils manpage writer. 46 | . 47 | -------------------------------------------------------------------------------- /apps/user/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path 4 | from django.urls import path,include,re_path 5 | from user.views import RegisterView, ActiveView, LoginView, UserOrderView, UserInfoView, UserAddressView, \ 6 | LogoutView,UserChangeAddress, UserImage,ChangePassword, SendCode,ImageCode 7 | from django.conf.urls import url 8 | from django.contrib.auth.decorators import login_required 9 | 10 | app_name = 'user' 11 | urlpatterns = [ 12 | url(r"^register/$", RegisterView.as_view(), name='register'), 13 | url(r"^login/$", LoginView.as_view(), name="login"), 14 | url(r"^active/(?P.*)/$", ActiveView.as_view()), 15 | url(r"^$", UserInfoView.as_view(), name='user'),# 用户中心信息页 16 | url(r"^order/(?P\d+)/$", UserOrderView.as_view(), name='order'), 17 | url(r"^address/$", UserAddressView.as_view(), name='address'), 18 | url(r"^logout/$", LogoutView.as_view(), name='logout'),# 注销登录 19 | url(r'^change_address/$', UserChangeAddress.as_view(), name='change_address'),# 修改地址 20 | url(r'^change_image/$', UserImage.as_view(), name='change_image'),# 修改头像 21 | url(r'^change_password/$', ChangePassword.as_view(), name='ChangePassword'),# 修改密码 22 | url(r'^send_code/$', SendCode.as_view(), name='SendCode'),# 修改密码 23 | url(r'^ImageCode/$', ImageCode.as_view(), name='ImageCode'),# 验证码图片 24 | 25 | ] -------------------------------------------------------------------------------- /share/man/man1/mutagen-inspect.1: -------------------------------------------------------------------------------- 1 | .\" Man page generated from reStructuredText. 2 | . 3 | .TH MUTAGEN-INSPECT 1 "" "" "" 4 | .SH NAME 5 | mutagen-inspect \- view Mutagen-supported audio tags 6 | . 7 | .nr rst2man-indent-level 0 8 | . 9 | .de1 rstReportMargin 10 | \\$1 \\n[an-margin] 11 | level \\n[rst2man-indent-level] 12 | level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] 13 | - 14 | \\n[rst2man-indent0] 15 | \\n[rst2man-indent1] 16 | \\n[rst2man-indent2] 17 | .. 18 | .de1 INDENT 19 | .\" .rstReportMargin pre: 20 | . RS \\$1 21 | . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] 22 | . nr rst2man-indent-level +1 23 | .\" .rstReportMargin post: 24 | .. 25 | .de UNINDENT 26 | . RE 27 | .\" indent \\n[an-margin] 28 | .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] 29 | .nr rst2man-indent-level -1 30 | .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] 31 | .in \\n[rst2man-indent\\n[rst2man-indent-level]]u 32 | .. 33 | .SH SYNOPSIS 34 | .sp 35 | \fBmutagen\-inspect\fP \fIfilename\fP ... 36 | .SH DESCRIPTION 37 | .sp 38 | \fBmutagen\-inspect\fP loads and prints information about an audio file and 39 | its tags. 40 | .sp 41 | It is primarily intended as a debugging tool for Mutagen, but can be useful 42 | for extracting tags from the command line. 43 | .SH AUTHOR 44 | .sp 45 | Joe Wreschnig 46 | .\" Generated by docutils manpage writer. 47 | . 48 | -------------------------------------------------------------------------------- /celery_tasks/tasks.py: -------------------------------------------------------------------------------- 1 | # 使用celery 2 | from celery import Celery 3 | from django.conf import settings 4 | from django.core.mail import send_mail 5 | # 在任务处理者加入 6 | import os 7 | import django 8 | # 因为依赖了django里面的setting初始化 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dailyfresh.settings') 10 | django.setup() 11 | 12 | 13 | # 创建一个Celery对象 redis 作为中间人 8表示8号数据库 14 | app = Celery("celery_task.tasks", broker='redis://192.168.80.132:6379/8') 15 | 16 | # 定义任务函数 17 | @app.task 18 | def send_register_active_email(to_email, username, token): 19 | '''发送激活邮件''' 20 | # 组织邮件信息 21 | subject = '天天生鲜欢迎信息' 22 | message = "" 23 | sender = settings.EMAIL_FROM 24 | receiver = [to_email] 25 | html_message = r' http://127.0.0.1:8000/user/active/%s/ ' % \ 26 | (token, token) 27 | send_mail(subject, message=message, from_email=sender, recipient_list=receiver, html_message=html_message) 28 | 29 | 30 | # 定义任务函数 31 | @app.task 32 | def send_verify_code(to_email, username, token): 33 | '''发送激活邮件''' 34 | # 组织邮件信息 35 | subject = '天天生鲜验证信息' 36 | message = "" 37 | sender = settings.EMAIL_FROM 38 | receiver = [to_email] 39 | html_message = r'code is %s' % token 40 | send_mail(subject, message=message, from_email=sender, recipient_list=receiver, html_message=html_message) 41 | 42 | 43 | -------------------------------------------------------------------------------- /apps/order/migrations/0002_auto_20200422_1239.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-04-22 04:39 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ('goods', '0001_initial'), 14 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 15 | ('user', '0001_initial'), 16 | ('order', '0001_initial'), 17 | ] 18 | 19 | operations = [ 20 | migrations.AddField( 21 | model_name='orderinfo', 22 | name='addr', 23 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Address', verbose_name='地址'), 24 | ), 25 | migrations.AddField( 26 | model_name='orderinfo', 27 | name='user', 28 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户'), 29 | ), 30 | migrations.AddField( 31 | model_name='ordergoods', 32 | name='order', 33 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order.OrderInfo', verbose_name='订单'), 34 | ), 35 | migrations.AddField( 36 | model_name='ordergoods', 37 | name='sku', 38 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSKU', verbose_name='商品SKU'), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block title %}天天生鲜-登录{% endblock title %} 4 | {% block header_con %}{% endblock header_con %} 5 | {% block search_bar %}{% endblock search_bar %} 6 | {% block body %} 7 | 10 | 11 | 41 | 42 | 43 | {% endblock body %} -------------------------------------------------------------------------------- /static/static/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},i=function(n){return n.getParam("nonbreaking_wrap",!0,"boolean")},a=function(n,e){for(var t="",o=0;o'+a(" ",e)+"":a(" ",e);n.undoManager.transact(function(){return n.insertContent(o)})},e=function(n){n.addCommand("mceNonBreaking",function(){r(n,1)})},c=tinymce.util.Tools.resolve("tinymce.util.VK"),t=function(e){var t=o(e);0 12 | {{ query }} 13 | > 14 | 搜索结果如下 15 | 16 | 17 |
18 | 19 | 20 | 21 |
    22 | {% for item in page %} 23 |
  • 24 | 25 |

    {{ item.object.name }}

    26 |
    27 | ¥{{ item.object.price }} 28 | {{ item.object.unite }} 29 | 30 |
    31 |
  • 32 | {% endfor %} 33 |
34 | 35 |
36 | {% if page.has_previous %} 37 | <上一页 38 | {% endif %} 39 | {% for pindex in paginator.page_range %} 40 | {% if pindex == skus_page.number %} 41 | {{ pindex }} 42 | {% else %} 43 | {{ pindex }} 44 | {% endif %} 45 | {% endfor %} 46 | {% if page.has_next %} 47 | 下一页> 48 | {% endif %} 49 |
50 | 51 |
52 | {% endblock %} 53 | 54 | 55 | -------------------------------------------------------------------------------- /utils/fdfs/storage.py: -------------------------------------------------------------------------------- 1 | from django.core.files.storage import Storage 2 | from fdfs_client.client import Fdfs_client 3 | from django.conf import settings 4 | 5 | class FDFSStorage(Storage): 6 | '''fast_dfs文件存储类''' 7 | 8 | def __init__(self, client_conf=None, base_url=None): 9 | '''初始化''' 10 | if client_conf is None: 11 | client_conf = settings.FDFS_CLIENT_CONF 12 | self.client_conf = client_conf 13 | if base_url is None: 14 | base_url = settings.FDFS_URL 15 | self.base_url = base_url 16 | 17 | def _open(self, name, mode='rb'): 18 | '''打开文件使用''' 19 | pass 20 | 21 | def _save(self, name, content): 22 | '''保存文件使用''' 23 | # name选择的上传文件的名字 24 | # content是File对象 包涵上传文件内容 25 | # 下面的路径是相对于项目的 26 | client = Fdfs_client(self.client_conf) 27 | # 上传文件 返回一个字典 28 | # @return dict { 29 | # 'Group name' : group_name, 30 | # 'Remote file_id' : remote_file_id, 31 | # 'Status' : 'Upload successed.', 32 | # 'Local file name' : '', 33 | # 'Uploaded size' : upload_size, 34 | # 'Storage IP' : storage_ip 35 | # } if success else None 36 | res = client.upload_by_buffer(content.read()) 37 | if res.get("Status") !='Upload successed.': 38 | # 上传失败 39 | raise Exception("上传文件失败") 40 | else: 41 | # 获取返回的remote_file_id 42 | filename = res.get("Remote file_id") 43 | return filename 44 | 45 | def exists(self, name): 46 | '''判断文件是否可用''' 47 | # 因为我们存在fdfs里面会自动区别是否一样的文件 48 | return False 49 | 50 | def url(self, name): 51 | '''返回访问文件的url路径''' 52 | # 就是返回了文件id 53 | return self.base_url+name -------------------------------------------------------------------------------- /static/static/tinymce/plugins/save/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},i=function(n){return!!n.getParam("save_onsavecallback")},c=function(n){return!!n.getParam("save_oncancelcallback")},r=function(n,e){n.notificationManager.open({text:e,type:"error"})},e=function(n){var e;if(e=t.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),i(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();e?(n.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():r(n,"Error: Form submit field collision.")),n.nodeChanged()):r(n,"Error: No form element found.")}},u=function(n){var e=o.trim(n.startContent);c(n)?n.execCallback("save_oncancelcallback",n):n.resetContent(e)},l=function(n){n.addCommand("mceSave",function(){e(n)}),n.addCommand("mceCancel",function(){u(n)})},s=function(t){return function(n){var e=function(){n.setDisabled(a(t)&&!t.isDirty())};return t.on("NodeChange dirty",e),function(){return t.off("NodeChange dirty",e)}}},d=function(n){n.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:s(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:s(n)}),n.addShortcut("Meta+S","","mceSave")};!function m(){n.add("save",function(n){d(n),l(n)})}()}(); -------------------------------------------------------------------------------- /share/man/man1/mid3iconv.1: -------------------------------------------------------------------------------- 1 | .\" Man page generated from reStructuredText. 2 | . 3 | .TH MID3ICONV 1 "" "" "" 4 | .SH NAME 5 | mid3iconv \- convert ID3 tag encodings 6 | . 7 | .nr rst2man-indent-level 0 8 | . 9 | .de1 rstReportMargin 10 | \\$1 \\n[an-margin] 11 | level \\n[rst2man-indent-level] 12 | level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] 13 | - 14 | \\n[rst2man-indent0] 15 | \\n[rst2man-indent1] 16 | \\n[rst2man-indent2] 17 | .. 18 | .de1 INDENT 19 | .\" .rstReportMargin pre: 20 | . RS \\$1 21 | . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] 22 | . nr rst2man-indent-level +1 23 | .\" .rstReportMargin post: 24 | .. 25 | .de UNINDENT 26 | . RE 27 | .\" indent \\n[an-margin] 28 | .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] 29 | .nr rst2man-indent-level -1 30 | .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] 31 | .in \\n[rst2man-indent\\n[rst2man-indent-level]]u 32 | .. 33 | .SH SYNOPSIS 34 | .sp 35 | \fBmid3iconv\fP [\fIoptions\fP] \fIfilename\fP ... 36 | .SH DESCRIPTION 37 | .sp 38 | \fBmid3iconv\fP converts ID3 tags from legacy encodings to Unicode and stores 39 | them using the ID3v2 format. 40 | .SH OPTIONS 41 | .INDENT 0.0 42 | .TP 43 | .B \-\-debug\fP,\fB \-d 44 | Print updated tags 45 | .TP 46 | .B \-\-dry\-run\fP,\fB \-p 47 | Do not actually modify files 48 | .TP 49 | .B \-\-encoding\fP,\fB \-e 50 | Convert from this encoding. By default, your locale\(aqs default encoding is 51 | used. 52 | .TP 53 | .B \-\-force\-v1 54 | Use an ID3v1 tag even if an ID3v2 tag is present 55 | .TP 56 | .B \-\-quiet\fP,\fB \-q 57 | Only output errors 58 | .TP 59 | .B \-\-remove\-v1 60 | Remove any ID3v1 tag after processing the files 61 | .UNINDENT 62 | .SH AUTHOR 63 | .sp 64 | Emfox Zhou. 65 | .sp 66 | Based on id3iconv (\fI\%http://www.cs.berkeley.edu/~zf/id3iconv/\fP) by Feng Zhou. 67 | .\" Generated by docutils manpage writer. 68 | . 69 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/noneditable/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},u=function(t){return t.getParam("noneditable_editable_class","mceEditable")},f=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},s=function(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}},d=function(i,o,c){return function(t){var n=arguments,e=n[n.length-2],r=0"===r){var a=o.lastIndexOf("<",e);if(-1!==a)if(-1!==o.substring(a,e).indexOf('contenteditable="false"'))return t}return''+i.dom.encode("string"==typeof n[1]?n[1]:n[0])+""}},n=function(n){var t,e,r="contenteditable";t=" "+c.trim(u(n))+" ",e=" "+c.trim(l(n))+" ";var a=s(t),i=s(e),o=f(n);n.on("PreInit",function(){0'},o=function(o){var c=a(o),n=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");o.on("BeforeSetContent",function(e){e.content=e.content.replace(n,r())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var n,a,t=e.length;t--;)if((a=(n=e[t]).attr("class"))&&-1!==a.indexOf("mce-pagebreak")){var r=n.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,n.remove();continue}n.type=3,n.value=c,n.raw=!0}})})},c=r,u=t,g=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("

"+c()+"

"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};!function l(){e.add("pagebreak",function(e){g(e),s(e),o(e),m(e)})}()}(); -------------------------------------------------------------------------------- /static/static/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},v=t.DOM,n=function(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0 6 |

订单评价

7 |
    8 |
  • {{ order.create_time }}
  • 9 |
  • 订单号:{{ order.order_id }}
  • 10 |
  • {{ order.status_name }}
  • 11 |
12 | 13 |
14 | {% csrf_token %} 15 | 16 | {# 订单有多少个商品 #} 17 | 18 | 19 | {% for order_sku in order.order_skus %} 20 | 21 | 22 | 23 | 30 | 31 | 32 | 33 |
24 |
    25 |
  • 26 |
  • {{ order_sku.sku.name }}单价:{{ order_sku.sku.price }}/{{ order_sku.sku.unite }}
  • 27 |
  • 购买数量: {{ order_sku.count }}
  • 28 |
29 |
小计: {{ order_sku.amount }}元
34 |
35 | 36 |
37 | 38 | 39 |
40 |
41 | {% endfor %} 42 | 43 | 44 |
45 | 46 | 47 | {% endblock right_content %} -------------------------------------------------------------------------------- /share/man/man1/mid3cp.1: -------------------------------------------------------------------------------- 1 | .\" Man page generated from reStructuredText. 2 | . 3 | .TH MID3CP 1 "" "" "" 4 | .SH NAME 5 | mid3cp \- copy ID3 tags 6 | . 7 | .nr rst2man-indent-level 0 8 | . 9 | .de1 rstReportMargin 10 | \\$1 \\n[an-margin] 11 | level \\n[rst2man-indent-level] 12 | level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] 13 | - 14 | \\n[rst2man-indent0] 15 | \\n[rst2man-indent1] 16 | \\n[rst2man-indent2] 17 | .. 18 | .de1 INDENT 19 | .\" .rstReportMargin pre: 20 | . RS \\$1 21 | . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] 22 | . nr rst2man-indent-level +1 23 | .\" .rstReportMargin post: 24 | .. 25 | .de UNINDENT 26 | . RE 27 | .\" indent \\n[an-margin] 28 | .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] 29 | .nr rst2man-indent-level -1 30 | .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] 31 | .in \\n[rst2man-indent\\n[rst2man-indent-level]]u 32 | .. 33 | .SH SYNOPSIS 34 | .sp 35 | \fBmid3cp\fP [\fIoptions\fP] \fIsource\fP \fIdest\fP 36 | .SH DESCRIPTION 37 | .sp 38 | \fBmid3cp\fP copies the ID3 tags from a source file to a destination file. 39 | .sp 40 | It is designed to provide similar functionality to id3lib\(aqs id3cp tool, and can 41 | optionally write ID3v1 tags. It can also exclude specific tags from being 42 | copied. 43 | .SH OPTIONS 44 | .INDENT 0.0 45 | .TP 46 | .B \-\-verbose\fP,\fB \-v 47 | Be verbose: state all operations performed, and list tags in source file. 48 | .TP 49 | .B \-\-write\-v1 50 | Write ID3v1 tags to the destination file, derived from the ID3v2 tags. 51 | .TP 52 | .B \-\-exclude\-tag\fP,\fB \-x 53 | Exclude a specific tag from being copied. Can be specified multiple times. 54 | .TP 55 | .B \-\-merge 56 | Copy over frames instead of replacing the whole ID3 tag. The tag version 57 | of \fIdest\fP will be used. In case \fIdest\fP has no ID3 tag this option has no 58 | effect. 59 | .UNINDENT 60 | .SH AUTHOR 61 | .sp 62 | Marcus Sundman. 63 | .sp 64 | Based on id3cp (part of id3lib) by Dirk Mahoney and Scott Thomas Haug. 65 | .\" Generated by docutils manpage writer. 66 | . 67 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return e.getParam("content_style","")},m=function(e){return e.getParam("content_css_cors",!1,"boolean")},i=function(t){var n="",i=t.dom.encode,e=l(t);n+='',e&&(n+='");var o=m(t)?' crossorigin="anonymous"':"";d.each(t.contentCSS,function(e){n+='"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c=t.getBody().dir,s=c?' dir="'+i(c)+'"':"";return""+n+'"+t.getContent()+' 7 | 8 | {% endblock topfiles %} 9 | 10 | {% block header_con %}{% endblock header_con %} 11 | {% block search_bar %}{% endblock search_bar %} 12 | {% block body %} 13 |
14 |
15 | 16 |
足不出户 · 新鲜每一天
17 |
18 |
19 | 20 |
21 |
22 |

用户注册

23 | 登录 24 |
25 |
26 |
27 | {% csrf_token %} 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 | {{ errmsg }} 60 |
61 |
62 |
63 | {% endblock body%} 64 | 65 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/autoresize/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var i=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return i(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(e){return e.fire("ResizeEditor")},v=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},y=function(e){return e.getParam("max_height",0,"number")},o=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},p=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},u=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?a(e,t,n,i,o):o&&o()},i)},z=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},C=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r=e.dom,u=e.getDoc();if(u)if((a=e).plugins.fullscreen&&a.plugins.fullscreen.isFullscreen())z(e,!0);else{var a,s=u.documentElement,f=p(e);i=v(e);var c=C(r,s,"margin-top",!0),g=C(r,s,"margin-bottom",!0);(o=s.offsetHeight+c+g+f)<0&&(o=0);var l=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+l>v(e)&&(i=o+l);var m=y(e);m&&m 12 | 全部分类 13 | > 14 | {{ type.name }} 15 | 16 | 17 |
18 |
19 |
20 |

新品推荐

21 |
    22 | {% for sku in new_skus %} 23 |
  • 24 | 25 |

    {{ sku.name }}

    26 |
    {{ sku.price }}
    27 |
  • 28 | {% endfor %} 29 |
30 |
31 |
32 | 33 |
34 |
35 | 默认 36 | 价格 37 | 人气 38 |
39 | 40 |
    41 | {% for sku in skus_page %} 42 |
  • 43 | 44 |

    {{ sku.name }}

    45 |
    46 | ¥{{ sku.price }} 47 | {{ sku.unite }} 48 | 49 |
    50 |
  • 51 | {% endfor %} 52 |
53 | 54 |
55 | {% if skus_page.has_previous %} 56 | <上一页 57 | {% endif %} 58 | {% for pindex in pages %} 59 | {% if pindex == skus_page.number %} 60 | {{ pindex }} 61 | {% else %} 62 | {{ pindex }} 63 | {% endif %} 64 | {% endfor %} 65 | {% if skus_page.has_next %} 66 | 下一页> 67 | {% endif %} 68 |
69 |
70 |
71 | {% endblock %} 72 | 73 | 74 | -------------------------------------------------------------------------------- /apps/order/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-04-22 04:39 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='OrderGoods', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), 19 | ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), 20 | ('is_delete', models.BooleanField(default=False, verbose_name='删除基类')), 21 | ('count', models.IntegerField(default=1, verbose_name='商品数目')), 22 | ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='商品价格')), 23 | ('comment', models.CharField(max_length=256, verbose_name='评论')), 24 | ], 25 | options={ 26 | 'verbose_name': '订单商品', 27 | 'verbose_name_plural': '订单商品', 28 | 'db_table': 'df_order_goods', 29 | }, 30 | ), 31 | migrations.CreateModel( 32 | name='OrderInfo', 33 | fields=[ 34 | ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), 35 | ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), 36 | ('is_delete', models.BooleanField(default=False, verbose_name='删除基类')), 37 | ('order_id', models.CharField(max_length=128, primary_key=True, serialize=False, verbose_name='订单id')), 38 | ('pay_method', models.SmallIntegerField(choices=[(1, '货到付款'), (2, '微信支付'), (3, '支付宝'), (4, '银联支付')], default=3, verbose_name='支付方式')), 39 | ('total_count', models.IntegerField(default=1, verbose_name='商品数量')), 40 | ('total_price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='商品总价')), 41 | ('transit_price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='订单运费')), 42 | ('order_status', models.SmallIntegerField(choices=[(1, '待支付'), (2, '待发货'), (3, '待收货'), (4, '待评价'), (5, '已完成')], default=1, verbose_name='订单状态')), 43 | ('trade_no', models.CharField(max_length=128, verbose_name='支付编号')), 44 | ], 45 | options={ 46 | 'verbose_name': '订单', 47 | 'verbose_name_plural': '订单', 48 | 'db_table': 'df_order_info', 49 | }, 50 | ), 51 | ] 52 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block title %}天天生鲜-首页{% endblock title %} 4 | {% block topfiles %} 5 | 6 | 7 | 8 | {% endblock topfiles %} 9 | 10 | 11 | {% block body %} 12 | 24 | 25 |
26 | 31 |
32 |
    33 | {% for banner in goods_banners %} 34 |
  • 幻灯片
  • 35 | {% endfor %} 36 |
37 | 38 | 39 |
    40 |
    41 |
    42 | {% for banner in promotion_banners %} 43 | 44 | {% endfor %} 45 |
    46 |
    47 | {% for type in types %} 48 |
    49 |
    50 |

    {{ type.name }}

    51 |
    52 | | 53 | {% for banner in type.title_banners %} 54 | {{ banner.sku.name }} 55 | {% endfor %} 56 |
    57 | 查看更多 > 58 |
    59 | 60 |
    61 |
    62 |
      63 | {% for banner in type.image_banners%} 64 |
    • 65 |

      {{ banner.sku.name }}

      66 | 67 |
      {{ banner.sku.price }}
      68 |
    • 69 | {% endfor %} 70 |
    71 |
    72 |
    73 | {% endfor %} 74 | {% endblock body %} 75 | 76 | 77 | -------------------------------------------------------------------------------- /static/js/register.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | var error_name = false; 4 | var error_password = false; 5 | var error_check_password = false; 6 | var error_email = false; 7 | var error_check = false; 8 | 9 | 10 | $('#user_name').blur(function() { 11 | check_user_name(); 12 | }); 13 | 14 | $('#pwd').blur(function() { 15 | check_pwd(); 16 | }); 17 | 18 | $('#cpwd').blur(function() { 19 | check_cpwd(); 20 | }); 21 | 22 | $('#email').blur(function() { 23 | check_email(); 24 | }); 25 | 26 | $('#allow').click(function() { 27 | if($(this).is(':checked')) 28 | { 29 | error_check = false; 30 | $(this).siblings('span').hide(); 31 | } 32 | else 33 | { 34 | error_check = true; 35 | $(this).siblings('span').html('请勾选同意'); 36 | $(this).siblings('span').show(); 37 | } 38 | }); 39 | 40 | 41 | function check_user_name(){ 42 | var len = $('#user_name').val().length; 43 | if(len<5||len>20) 44 | { 45 | $('#user_name').next().html('请输入5-20个字符的用户名') 46 | $('#user_name').next().show(); 47 | error_name = true; 48 | } 49 | else 50 | { 51 | $('#user_name').next().hide(); 52 | error_name = false; 53 | } 54 | } 55 | 56 | function check_pwd(){ 57 | var len = $('#pwd').val().length; 58 | if(len<8||len>20) 59 | { 60 | $('#pwd').next().html('密码最少8位,最长20位') 61 | $('#pwd').next().show(); 62 | error_password = true; 63 | } 64 | else 65 | { 66 | $('#pwd').next().hide(); 67 | error_password = false; 68 | } 69 | } 70 | 71 | 72 | function check_cpwd(){ 73 | var pass = $('#pwd').val(); 74 | var cpass = $('#cpwd').val(); 75 | 76 | if(pass!=cpass) 77 | { 78 | $('#cpwd').next().html('两次输入的密码不一致') 79 | $('#cpwd').next().show(); 80 | error_check_password = true; 81 | } 82 | else 83 | { 84 | $('#cpwd').next().hide(); 85 | error_check_password = false; 86 | } 87 | 88 | } 89 | 90 | function check_email(){ 91 | var re = /^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$/; 92 | 93 | if(re.test($('#email').val())) 94 | { 95 | $('#email').next().hide(); 96 | error_email = false; 97 | } 98 | else 99 | { 100 | $('#email').next().html('你输入的邮箱格式不正确') 101 | $('#email').next().show(); 102 | error_check_password = true; 103 | } 104 | 105 | } 106 | 107 | 108 | $('#reg_form').submit(function() { 109 | check_user_name(); 110 | check_pwd(); 111 | check_cpwd(); 112 | check_email(); 113 | 114 | if(error_name == false && error_password == false && error_check_password == false && error_email == false && error_check == false) 115 | { 116 | return true; 117 | } 118 | else 119 | { 120 | return false; 121 | } 122 | 123 | }); 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | }) -------------------------------------------------------------------------------- /static/static/tinymce/plugins/legacyoutput/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},s=function(e,t){e.settings.font_formats=t},r=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},o=function(e,t){e.settings.inline_styles=t},a=function(a){var e;o(e=a,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||s(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),a.on("init",function(){return e=a,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(r(e)),n=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return l.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,n})};!function c(){e.add("legacyoutput",function(e){a(e)})}()}(); -------------------------------------------------------------------------------- /static/js/slide.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var $slides = $('.slide_pics li'); 3 | var len = $slides.length; 4 | var nowli = 0; 5 | var prevli = 0; 6 | var $prev = $('.prev'); 7 | var $next = $('.next'); 8 | var ismove = false; 9 | var timer = null; 10 | $slides.not(':first').css({left:760}); 11 | $slides.each(function(index, el) { 12 | var $li = $('
  • '); 13 | 14 | if(index==0) 15 | { 16 | $li.addClass('active'); 17 | } 18 | 19 | $li.appendTo($('.points')); 20 | }); 21 | $points = $('.points li'); 22 | timer = setInterval(autoplay,4000); 23 | 24 | $('.slide').mouseenter(function() { 25 | clearInterval(timer); 26 | }); 27 | 28 | $('.slide').mouseleave(function() { 29 | timer = setInterval(autoplay,4000); 30 | }); 31 | 32 | function autoplay(){ 33 | nowli++; 34 | move(); 35 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 36 | } 37 | 38 | $points.click(function(event) { 39 | if(ismove) 40 | { 41 | return; 42 | } 43 | nowli = $(this).index(); 44 | 45 | if(nowli==prevli) 46 | { 47 | return; 48 | } 49 | 50 | $(this).addClass('active').siblings().removeClass('active'); 51 | move(); 52 | 53 | }); 54 | 55 | $prev.click(function() { 56 | if(ismove) 57 | { 58 | return; 59 | } 60 | nowli--; 61 | move(); 62 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 63 | 64 | }); 65 | 66 | $next.click(function() { 67 | if(ismove) 68 | { 69 | return; 70 | } 71 | nowli++; 72 | move(); 73 | $points.eq(nowli).addClass('active').siblings().removeClass('active'); 74 | 75 | }); 76 | 77 | 78 | function move(){ 79 | 80 | ismove = true; 81 | 82 | if(nowli<0) 83 | { 84 | nowli=len-1; 85 | prevli = 0 86 | $slides.eq(nowli).css({left:-760}); 87 | $slides.eq(nowli).animate({left:0},800,'easeOutExpo'); 88 | $slides.eq(prevli).animate({left:760},800,'easeOutExpo',function(){ 89 | ismove = false; 90 | }); 91 | prevli=nowli; 92 | return; 93 | } 94 | 95 | if(nowli>len-1) 96 | { 97 | nowli = 0; 98 | prevli = len-1; 99 | $slides.eq(nowli).css({left:760}); 100 | $slides.eq(nowli).animate({left:0},800,'easeOutExpo'); 101 | $slides.eq(prevli).animate({left:-760},800,'easeOutExpo',function(){ 102 | ismove = false; 103 | }); 104 | prevli=nowli; 105 | return; 106 | } 107 | 108 | 109 | if(prevli 6 |
    7 |

    头像

    8 | {% if user.image != "1" %} 9 | 10 | {% endif %} 11 | 12 | 13 | 14 |
    15 | 16 |
    17 |

    18 | {% csrf_token %} 19 |
    20 |
    21 |

    基本信息

    22 | 32 |
    33 | 34 |

    最近浏览

    35 |
    36 |
      37 | {% for goods in goods_li %} 38 |
    • 39 | 40 |

      {{ goods.name }}

      41 |
      42 | {{ goods.price }} 43 | {{ goods.price }}/{{ good.unite }} 44 | 45 |
      46 |
    • 47 | {% empty %} 48 | 无历史游览记录 49 | {% endfor %} 50 |
    51 |
    52 | 53 | 54 | {% endblock %} 55 | {% block bottomfiles %} 56 | 57 | 77 | {% endblock %} -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% load static %} 4 | 5 | 6 | {# 网页标题内容块#} 7 | {% block title %}{% endblock title %} 8 | 9 | 10 | {# 网页顶部引入文件块#} 11 | {% block topfiles %}{% endblock topfiles %} 12 | 13 | 14 | {# 网页顶部欢迎信息块 #} 15 | {% block header_con %} 16 |
    17 |
    18 |
    欢迎来到天天生鲜!
    19 |
    20 | {% if user.is_authenticated %} 21 | {% if user.image != "1" %} 22 | 23 | {% endif %} 24 | 30 | {% else %} 31 | 36 | {% endif %} 37 | 45 |
    46 |
    47 |
    48 | {% endblock header_con %} 49 | {% block search_bar %} 50 | 63 | {% endblock search_bar %} 64 | {# 网页主题内容块#} 65 | 66 | {% block body %} 67 | {% endblock body %} 68 | 80 | {% block bottom %}{% endblock bottom %} 81 | {% block bottomfiles %}{% endblock bottomfiles %} 82 | 83 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/bbcode/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/(.*?)<\/font>/gi,"$1"),o(//gi,"[img]$1[/img]"),o(/(.*?)<\/span>/gi,"[code]$1[/code]"),o(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/(.*?)<\/span>/gi,"[u]$1[/u]"),o(//gi,"[u]"),o(/]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/
    /gi,"\n"),o(//gi,"\n"),o(/
    /gi,"\n"),o(/

    /gi,""),o(/<\/p>/gi,"\n"),o(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t},i=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/\n/gi,"
    "),o(/\[b\]/gi,""),o(/\[\/b\]/gi,""),o(/\[i\]/gi,""),o(/\[\/i\]/gi,""),o(/\[u\]/gi,""),o(/\[\/u\]/gi,""),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),o(/\[url\](.*?)\[\/url\]/gi,'$1'),o(/\[img\](.*?)\[\/img\]/gi,''),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),o(/\[code\](.*?)\[\/code\]/gi,'$1 '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),t};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}(); -------------------------------------------------------------------------------- /static/static/tinymce/plugins/insertdatetime/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},r=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},a=n,i=r,o=function(e){var t=r(e);return 0'+n+"")}else e.insertContent(f(e,t));var i,o,u,c,m},g=f,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,a(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return S(n())}}},v=function(n){var t=i(n),r=S(o(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t]*>((\xa0| |[ \t]|]*>)+?|)|
    $","i").test(e)},f=function(t){var e=parseInt(a.getItem(s(t)+"time"),10)||0;return!((new Date).getTime()-e>u(t.settings.autosave_retention,"20m"))||(l(t,!1),!1)},l=function(t,e){var r=s(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=s(t);!c(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},v=function(t){var e=s(t);f(t)&&(t.setContent(a.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},d=function(t,e){var r=u(t.settings.autosave_interval,"30s");e.get()||(n.setInterval(function(){t.removed||m(t)},r),e.set(!0))},g=function(t){t.undoManager.transact(function(){v(t),l(t)}),t.focus()};function y(n){for(var o=[],t=1;t","<"+i+' contenteditable="true">'+s.DOM.encode(c)+a),e=0;e";else for(n=d;n

  • ";if(l+=''+o.title+"",r!==o.level&&r)for(n=o.level;r
  • ";else l+="
  • ",r||(l+="");d=o.level}return l},g=function(t){var e=a(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})},o={hasHeaders:function(t){return 0'+n+"")):g(t)},updateToc:g},e=function(t){t.addCommand("mceInsertToc",function(){o.insertToc(t)}),t.addCommand("mceUpdateToc",function(){o.updateToc(t)})},n=function(t){var n=t.$,o=a(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},r=function(n){return function(t){var e=function(){return t.setDisabled(n.readonly||!o.hasHeaders(n))};return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}},h=function(t){var e;t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:r(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:r(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(e=t,function(t){return t&&e.dom.is(t,"."+a(e))&&e.getBody().contains(t)}),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){e(t),h(t),n(t)})}()}(); -------------------------------------------------------------------------------- /static/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /templates/user_center_site.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_user_center.html' %} 2 | {% block right_content %} 3 | {% load static %} 4 | {% csrf_token %} 5 |
    6 |

    收货地址

    7 | {{ errmsg }} 8 |
    9 |
    10 | {% if default_address %} 11 |
    当前地址:
    12 |
    地址:{{ default_address.addr }}收件人:{{ default_address.receiver }}手机号{{ default_address.phone }}
    13 | 14 |         15 | {% if address %} 16 |
    更换地址:
    17 | 22 | 23 | 24 | {% endif %} 25 | {% else %} 26 |
    无默认地址
    27 | {% endif %} 28 |
    29 |
    30 |

    编辑地址

    31 |
    32 |
    33 | {% csrf_token %} 34 |
    35 | 36 | 37 |
    38 |
    39 | 40 | 41 |
    42 |
    43 | 44 | 45 |
    46 |
    47 | 48 | 49 |
    50 | 51 | 52 |
    53 |
    54 |
    55 | {% endblock %} 56 | {% block bottomfiles %} 57 | 58 | 97 | {% endblock %} -------------------------------------------------------------------------------- /static/static/tinymce/plugins/advlist/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var n,t,e,r,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},o=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){O(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){O(e,"OL",t["list-style-type"])})},i=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},l=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},c=function(n){return function(){return n}},s=c(!1),f=c(!0),a=s,d=f,g=function(){return p},p=(r={fold:function(n,t){return n()},is:a,isSome:a,isNone:d,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:a,forall:d,filter:g,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),m=function(e){var n=function(){return e},t=function(){return u},r=function(n){return n(e)},u={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return m(n(e))},ap:function(n){return n.fold(g,function(n){return m(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?u:p},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(a,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return u},y=function(n){return null===n||n===undefined?p:m(n)},h=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},L=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(e=n,(t=r).$.contains(t.getBody(),e));var t,e}},N=function(n){var t=n.dom.getParent(n.selection.getNode(),"ol,ul"),e=n.dom.getStyle(t,"listStyleType");return y(e)},S=function(n,t,e){var r=function(n,t){for(var e=0;e确认收货地址 8 | 9 |
    10 |
    11 |
    寄送到:
    12 | {% for addr in addrs %} 13 |
    {{ addr.addr }} ({{ addr.receiver }} 收) {{ addr.phone }}
    14 | {% endfor %} 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 | {% for sku in skus %} 45 |
      46 |
    • {{ forloop.counter }}
    • 47 |
    • 48 |
    • {{ sku.name }}
    • 49 |
    • {{ sku.unite }}
    • 50 |
    • {{ sku.price }}元
    • 51 |
    • {{ sku.count }}
    • 52 |
    • {{ sku.amount }}元
    • 53 |
    54 | {% endfor %} 55 | 56 |
    57 | 58 |

    总金额结算

    59 | 60 |
    61 |
    62 |
    {{ total_count }}件商品,总金额{{ total_price }}元
    63 |
    运费:{{ transit_price }}元
    64 |
    实付款:{{ total_pay }}元
    65 |
    66 |
    67 | 68 |
    69 | {% csrf_token %} 70 | 提交订单 71 |
    72 | 73 | {% endblock %} 74 | {% block bottom %} 75 | 82 | {% endblock %} 83 | {% block bottomfiles %} 84 | 85 | 119 | {% endblock %} -------------------------------------------------------------------------------- /templates/changepassword.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | 6 | 修改密码 7 | 8 | 9 | 10 | 11 | {% csrf_token %} 12 | 15 | 16 | 17 |
    18 |
    19 |
    输入用户名
    20 | 21 | 22 |
    输入邮箱验证码
    23 | 24 |
    新密码
    25 | 26 |
    图片验证码
    27 | 28 | 29 | 30 | 31 | 32 |
    33 |
    34 | 35 | 47 | 48 | 84 | 85 | 130 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/directionality/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(c){"use strict";var n,t,e,r,o,i,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),f.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},l=function(n){n.addCommand("mceDirectionLTR",function(){d(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){d(n,"rtl")})},a=function(n){return function(){return n}},m=a(!1),N=a(!0),s=m,g=N,T=function(){return E},E=(r={fold:function(n,t){return n()},is:s,isSome:s,isNone:g,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:T,ap:T,each:function(){},bind:T,flatten:T,exists:s,forall:g,filter:T,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(r),r),O=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:g,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return O(n(e))},ap:function(n){return n.fold(T,function(n){return O(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:E},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(s,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},y=function(n){return null===n||n===undefined?E:O(n)},p=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:a(n)}},D={fromHtml:function(n,t){var e=(t||c.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1 12 | 全部分类 13 | > 14 | {{ type.name }} 15 | 16 | 17 |
    18 |
    19 |
    20 |

    新品推荐

    21 |
      22 | {% for sku in new_skus %} 23 |
    • 24 | 25 |

      {{ sku.name }}

      26 |
      {{ sku.price }}
      27 |
    • 28 | {% endfor %} 29 |
    30 |
    31 |
    32 | 33 |
    34 |
    35 | 默认 36 | 价格 37 | 人气 38 |
    39 | 40 |
      41 | {% for sku in skus_page %} 42 |
    • 43 | 44 |

      {{ sku.name }}

      45 |
      46 | ¥{{ sku.price }} 47 | {{ sku.unite }} 48 | 49 |
      50 |
    • 51 | {% endfor %} 52 |
    53 | 54 |
    55 | {% if skus_page.has_previous %} 56 | <上一页 57 | {% endif %} 58 | {% for pindex in pages %} 59 | {% if pindex == skus_page.number %} 60 | {{ pindex }} 61 | {% else %} 62 | {{ pindex }} 63 | {% endif %} 64 | {% endfor %} 65 | {% if skus_page.has_next %} 66 | 下一页> 67 | {% endif %} 68 |
    69 |
    70 |
    71 | {% endblock %} 72 | 73 | {% block bottomfiles %} 74 |
    75 | 76 | 117 | {% endblock %} 118 | 119 | 120 | -------------------------------------------------------------------------------- /apps/goods/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from db.base_model import BaseModel 3 | from tinymce.models import HTMLField 4 | from django.conf import settings 5 | # Create your models here. 6 | 7 | 8 | class GoodsType(BaseModel): 9 | '''商品类型模型类''' 10 | name = models.CharField(max_length=20, verbose_name='种类名称') 11 | logo = models.CharField(max_length=20, verbose_name='标识') 12 | image = models.ImageField(upload_to='type', verbose_name='商品类型图片') 13 | 14 | class Meta: 15 | db_table = 'df_goods_type' 16 | verbose_name = '商品种类' 17 | verbose_name_plural = verbose_name 18 | 19 | def __str__(self): 20 | return self.name 21 | 22 | 23 | class GoodsSKU(BaseModel): 24 | '''商品SKU模型类''' 25 | status_choices = ( 26 | (0, '下线'), 27 | (1, '上线'), 28 | ) 29 | type = models.ForeignKey('GoodsType', verbose_name='商品种类', on_delete=models.CASCADE) 30 | goods = models.ForeignKey('Goods', verbose_name='商品SPU', on_delete=models.CASCADE) 31 | name = models.CharField(max_length=20, verbose_name='商品名称') 32 | desc = models.CharField(max_length=256, verbose_name='商品简介') 33 | price = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='商品价格') 34 | unite = models.CharField(max_length=20, verbose_name='商品单位') 35 | image = models.ImageField(upload_to='goods', verbose_name='商品图片') 36 | stock = models.IntegerField(default=1, verbose_name='商品库存') 37 | sales = models.IntegerField(default=0, verbose_name='商品销量') 38 | status = models.SmallIntegerField(default=1, choices=status_choices, verbose_name='商品状态') 39 | 40 | # 应该加上这步,表示显示时返回的是自定义信息,而不是 object 形式 41 | def __str__(self): # __str__ on Python 3 42 | return self.name 43 | 44 | class Meta: 45 | db_table = 'df_goods_sku' 46 | verbose_name = '商品' 47 | verbose_name_plural = verbose_name 48 | 49 | 50 | class Goods(BaseModel): 51 | '''商品SPU模型类''' 52 | name = models.CharField(max_length=20, verbose_name='商品SPU名称') 53 | # 富文本类型:带有格式的文本 54 | detail = HTMLField(blank=True, verbose_name='商品详情') 55 | 56 | class Meta: 57 | db_table = 'df_goods' 58 | verbose_name = '商品SPU' 59 | verbose_name_plural = verbose_name 60 | def __str__(self): 61 | return "goods"+self.name 62 | 63 | 64 | class GoodsImage(BaseModel): 65 | '''商品图片模型类''' 66 | sku = models.ForeignKey('GoodsSKU', verbose_name='商品', on_delete=models.CASCADE) 67 | image = models.ImageField(upload_to='goods', verbose_name='图片路径') 68 | 69 | class Meta: 70 | db_table = 'df_goods_image' 71 | verbose_name = '商品图片' 72 | verbose_name_plural = verbose_name 73 | 74 | 75 | class IndexGoodsBanner(BaseModel): 76 | '''首页轮播商品展示模型类''' 77 | sku = models.ForeignKey('GoodsSKU', verbose_name='商品', on_delete=models.CASCADE) 78 | image = models.ImageField(upload_to='banner', verbose_name='图片') 79 | index = models.SmallIntegerField(default=0, verbose_name='展示顺序') 80 | 81 | class Meta: 82 | db_table = 'df_index_banner' 83 | verbose_name = '首页轮播商品' 84 | verbose_name_plural = verbose_name 85 | 86 | 87 | class IndexTypeGoodsBanner(BaseModel): 88 | '''首页分类商品展示模型类''' 89 | DISPLAY_TYPE_CHOICES = ( 90 | (0, "标题"), 91 | (1, "图片") 92 | ) 93 | 94 | type = models.ForeignKey('GoodsType', verbose_name='商品类型', on_delete=models.CASCADE) 95 | sku = models.ForeignKey('GoodsSKU', verbose_name='商品SKU', on_delete=models.CASCADE) 96 | display_type = models.SmallIntegerField(default=1, choices=DISPLAY_TYPE_CHOICES, verbose_name='展示类型') 97 | index = models.SmallIntegerField(default=0, verbose_name='展示顺序') 98 | 99 | def __str__(self): 100 | return self.sku.name 101 | class Meta: 102 | db_table = 'df_index_type_goods' 103 | verbose_name = "主页分类展示商品" 104 | verbose_name_plural = verbose_name 105 | 106 | 107 | class IndexPromotionBanner(BaseModel): 108 | '''首页促销活动模型类''' 109 | name = models.CharField(max_length=20, verbose_name='活动名称') 110 | url = models.CharField(max_length=256, verbose_name='活动链接') 111 | image = models.ImageField(upload_to='banner', verbose_name='活动图片') 112 | index = models.SmallIntegerField(default=0, verbose_name='展示顺序') 113 | 114 | class Meta: 115 | db_table = 'df_index_promotion' 116 | verbose_name = "主页促销活动" 117 | verbose_name_plural = verbose_name -------------------------------------------------------------------------------- /apps/user/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.5 on 2020-04-22 04:39 2 | 3 | from django.conf import settings 4 | import django.contrib.auth.models 5 | import django.contrib.auth.validators 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | import django.utils.timezone 9 | 10 | 11 | class Migration(migrations.Migration): 12 | 13 | initial = True 14 | 15 | dependencies = [ 16 | ('auth', '0011_update_proxy_permissions'), 17 | ] 18 | 19 | operations = [ 20 | migrations.CreateModel( 21 | name='User', 22 | fields=[ 23 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 24 | ('password', models.CharField(max_length=128, verbose_name='password')), 25 | ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), 26 | ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), 27 | ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), 28 | ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), 29 | ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), 30 | ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), 31 | ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), 32 | ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), 33 | ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), 34 | ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), 35 | ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), 36 | ('is_delete', models.BooleanField(default=False, verbose_name='删除基类')), 37 | ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), 38 | ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), 39 | ], 40 | options={ 41 | 'verbose_name': '用户', 42 | 'verbose_name_plural': '用户', 43 | 'db_table': 'df_user', 44 | }, 45 | managers=[ 46 | ('objects', django.contrib.auth.models.UserManager()), 47 | ], 48 | ), 49 | migrations.CreateModel( 50 | name='Address', 51 | fields=[ 52 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 53 | ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), 54 | ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), 55 | ('is_delete', models.BooleanField(default=False, verbose_name='删除基类')), 56 | ('receiver', models.CharField(max_length=20, verbose_name='收件人')), 57 | ('addr', models.CharField(max_length=256, verbose_name='收件地址')), 58 | ('zip_code', models.CharField(max_length=6, null=True, verbose_name='邮政编码')), 59 | ('phone', models.CharField(max_length=11, verbose_name='联系电话')), 60 | ('is_default', models.BooleanField(default=False, verbose_name='是否默认')), 61 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='所属账户')), 62 | ], 63 | options={ 64 | 'verbose_name': '地址', 65 | 'verbose_name_plural': '地址', 66 | 'db_table': 'df_address', 67 | }, 68 | ), 69 | ] 70 | -------------------------------------------------------------------------------- /Include/site/python3.7/greenlet/greenlet.h: -------------------------------------------------------------------------------- 1 | /* vim:set noet ts=8 sw=8 : */ 2 | 3 | /* Greenlet object interface */ 4 | 5 | #ifndef Py_GREENLETOBJECT_H 6 | #define Py_GREENLETOBJECT_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define GREENLET_VERSION "0.4.15" 15 | 16 | #if PY_VERSION_HEX >= 0x030700A3 17 | # define GREENLET_USE_EXC_INFO 18 | #endif 19 | 20 | typedef struct _greenlet { 21 | PyObject_HEAD 22 | char* stack_start; 23 | char* stack_stop; 24 | char* stack_copy; 25 | intptr_t stack_saved; 26 | struct _greenlet* stack_prev; 27 | struct _greenlet* parent; 28 | PyObject* run_info; 29 | struct _frame* top_frame; 30 | int recursion_depth; 31 | PyObject* weakreflist; 32 | #ifdef GREENLET_USE_EXC_INFO 33 | _PyErr_StackItem* exc_info; 34 | _PyErr_StackItem exc_state; 35 | #else 36 | PyObject* exc_type; 37 | PyObject* exc_value; 38 | PyObject* exc_traceback; 39 | #endif 40 | PyObject* dict; 41 | } PyGreenlet; 42 | 43 | #define PyGreenlet_Check(op) PyObject_TypeCheck(op, &PyGreenlet_Type) 44 | #define PyGreenlet_MAIN(op) (((PyGreenlet*)(op))->stack_stop == (char*) -1) 45 | #define PyGreenlet_STARTED(op) (((PyGreenlet*)(op))->stack_stop != NULL) 46 | #define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL) 47 | #define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent) 48 | 49 | #if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 1) || PY_MAJOR_VERSION > 3 50 | #define GREENLET_USE_PYCAPSULE 51 | #endif 52 | 53 | /* C API functions */ 54 | 55 | /* Total number of symbols that are exported */ 56 | #define PyGreenlet_API_pointers 8 57 | 58 | #define PyGreenlet_Type_NUM 0 59 | #define PyExc_GreenletError_NUM 1 60 | #define PyExc_GreenletExit_NUM 2 61 | 62 | #define PyGreenlet_New_NUM 3 63 | #define PyGreenlet_GetCurrent_NUM 4 64 | #define PyGreenlet_Throw_NUM 5 65 | #define PyGreenlet_Switch_NUM 6 66 | #define PyGreenlet_SetParent_NUM 7 67 | 68 | #ifndef GREENLET_MODULE 69 | /* This section is used by modules that uses the greenlet C API */ 70 | static void **_PyGreenlet_API = NULL; 71 | 72 | #define PyGreenlet_Type (*(PyTypeObject *) _PyGreenlet_API[PyGreenlet_Type_NUM]) 73 | 74 | #define PyExc_GreenletError \ 75 | ((PyObject *) _PyGreenlet_API[PyExc_GreenletError_NUM]) 76 | 77 | #define PyExc_GreenletExit \ 78 | ((PyObject *) _PyGreenlet_API[PyExc_GreenletExit_NUM]) 79 | 80 | /* 81 | * PyGreenlet_New(PyObject *args) 82 | * 83 | * greenlet.greenlet(run, parent=None) 84 | */ 85 | #define PyGreenlet_New \ 86 | (* (PyGreenlet * (*)(PyObject *run, PyGreenlet *parent)) \ 87 | _PyGreenlet_API[PyGreenlet_New_NUM]) 88 | 89 | /* 90 | * PyGreenlet_GetCurrent(void) 91 | * 92 | * greenlet.getcurrent() 93 | */ 94 | #define PyGreenlet_GetCurrent \ 95 | (* (PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM]) 96 | 97 | /* 98 | * PyGreenlet_Throw( 99 | * PyGreenlet *greenlet, 100 | * PyObject *typ, 101 | * PyObject *val, 102 | * PyObject *tb) 103 | * 104 | * g.throw(...) 105 | */ 106 | #define PyGreenlet_Throw \ 107 | (* (PyObject * (*) \ 108 | (PyGreenlet *self, PyObject *typ, PyObject *val, PyObject *tb)) \ 109 | _PyGreenlet_API[PyGreenlet_Throw_NUM]) 110 | 111 | /* 112 | * PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args) 113 | * 114 | * g.switch(*args, **kwargs) 115 | */ 116 | #define PyGreenlet_Switch \ 117 | (* (PyObject * (*)(PyGreenlet *greenlet, PyObject *args, PyObject *kwargs)) \ 118 | _PyGreenlet_API[PyGreenlet_Switch_NUM]) 119 | 120 | /* 121 | * PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent) 122 | * 123 | * g.parent = new_parent 124 | */ 125 | #define PyGreenlet_SetParent \ 126 | (* (int (*)(PyGreenlet *greenlet, PyGreenlet *nparent)) \ 127 | _PyGreenlet_API[PyGreenlet_SetParent_NUM]) 128 | 129 | /* Macro that imports greenlet and initializes C API */ 130 | #ifdef GREENLET_USE_PYCAPSULE 131 | #define PyGreenlet_Import() \ 132 | { \ 133 | _PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \ 134 | } 135 | #else 136 | #define PyGreenlet_Import() \ 137 | { \ 138 | PyObject *module = PyImport_ImportModule("greenlet"); \ 139 | if (module != NULL) { \ 140 | PyObject *c_api_object = PyObject_GetAttrString( \ 141 | module, "_C_API"); \ 142 | if (c_api_object != NULL && PyCObject_Check(c_api_object)) { \ 143 | _PyGreenlet_API = \ 144 | (void **) PyCObject_AsVoidPtr(c_api_object); \ 145 | Py_DECREF(c_api_object); \ 146 | } \ 147 | Py_DECREF(module); \ 148 | } \ 149 | } 150 | #endif 151 | 152 | #endif /* GREENLET_MODULE */ 153 | 154 | #ifdef __cplusplus 155 | } 156 | #endif 157 | #endif /* !Py_GREENLETOBJECT_H */ 158 | -------------------------------------------------------------------------------- /static/static/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.0.14 (2019-08-19) 8 | */ 9 | !function(){"use strict";var t,e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},i=function(t){return t.getParam("importcss_exclusive")},h=function(t){return t.getParam("importcss_selector_converter")},l=function(t){return t.getParam("importcss_selector_filter")},p=function(t){return t.getParam("importcss_groups")},_=function(t){return t.getParam("importcss_append")},x=function(t){return t.getParam("importcss_file_filter")},u=function(t){return function(){return t}},s=u(!1),a=u(!0),g=function(){return y},y=(r={fold:function(t,e){return t()},is:s,isSome:s,isNone:a,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:s,forall:a,filter:g,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(r),r),O=function(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}},T=O("array"),b=O("function"),k=Array.prototype.slice,S=Array.prototype.push,A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n 5 |

    全部订单

    6 | {% csrf_token %} 7 | {% for order in order_page %} 8 |
      9 |
    • {{ order.create_time }}
    • 10 |
    • 订单号:{{ order.order_id }}
    • 11 |
    • {{ order.status_name }}
    • 12 |
    • 删除订单
    • 13 | 14 |
    15 | 16 | 17 | 18 | 19 | 20 | 30 | 31 | 32 | 33 | 34 | 35 |
    21 | {% for order_sku in order.order_skus %} 22 |
      23 |
    • 24 |
    • {{ order_sku.sku.name }}{{ order_sku.price }}元/{{ order_sku.sku.unite }}g
    • 25 |
    • {{ order_sku.count }}
    • 26 |
    • {{ order_sku.amount }}元
    • 27 |
    28 | {% endfor %} 29 |
    {{ order.total_price|add:order.transit_price }}(含运费:{{ order.transit_price }})元{{ order.status_name }}去付款
    36 | {% endfor %} 37 | 38 |
    39 | {% if order_page.has_previous %} 40 | 上一页 41 | {% endif %} 42 | 43 | {% for pindex in pages %} 44 | {% if pindex == order_page.number %} 45 | {{ pindex }} 46 | {% else %} 47 | {{ pindex }} 48 | {% endif %} 49 | {% endfor %} 50 | {% if order_page.has_next %} 51 | 下一页 52 | {% endif %} 53 |
    54 | 55 | {% endblock %} 56 | {% block bottomfiles %} 57 | 58 | 130 | 135 | {% endblock %} -------------------------------------------------------------------------------- /apps/cart/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.views.generic import View 3 | from goods.models import GoodsSKU 4 | from django.http import JsonResponse 5 | from django_redis import get_redis_connection 6 | from utils.mixin import LoginRequireMixin 7 | class CartAddView(View): 8 | '''购物车添加''' 9 | def post(self, request): 10 | if not request.user.is_authenticated: 11 | return JsonResponse({'res': 0, "errmsg":'先登录'}) 12 | count = request.POST.get('count') 13 | sku_id = request.POST.get('sku_id') 14 | # 数据效验 15 | if not all([sku_id, count]): 16 | return JsonResponse({'res': 1, 'errmsg': "数据不完整"}) 17 | try: 18 | count = int(count) 19 | except Exception as e: 20 | return JsonResponse({'res': 2, 'errmsg': '商品数目出错'}) 21 | try: 22 | sku=GoodsSKU.objects.get(id=sku_id) 23 | except GoodsSKU.DoesNotExist: 24 | return JsonResponse({'res': 3, 'errmsg': '商品不存在'}) 25 | # 添加购物车记录 26 | conn = get_redis_connection('default') 27 | # 先尝试获取sku_id的值 看看购物车是否已经在购物车当中 28 | cart_key = 'cart_%d' % request.user.id 29 | # 如果hget拿不到 就会返回一个None 30 | cart_count = conn.hget(cart_key, sku_id) 31 | if cart_count: 32 | # 累加购物车商品的数据 33 | count += int(cart_count) 34 | if count>sku.stock: 35 | return JsonResponse({'res': 4, "errmsg": '库存不够'}) 36 | conn.hset(cart_key, sku_id, count) 37 | total_count = conn.hlen(cart_key) 38 | return JsonResponse({'res': 5, 'message': 'success', 'total_count': total_count}) 39 | 40 | 41 | class CartInfoView(LoginRequireMixin , View): 42 | '''购物车页面显示''' 43 | def get(self, request): 44 | # 获取用户 45 | user = request.user 46 | # 获取用户购物车信息 47 | conn = get_redis_connection('default') 48 | cart_key = 'cart_%d' % user.id 49 | cart_dict = conn.hgetall(cart_key) 50 | 51 | skus = [] 52 | total_count = 0 53 | total_price = 0 54 | # 遍历获取商品信息 55 | for sku_id, count in cart_dict.items(): 56 | # 根据商品id获取信息 57 | sku = GoodsSKU.objects.get(id=sku_id) 58 | # 计算商品订单数目 59 | amount = sku.price*(int(count)) 60 | # 动态增加属性 61 | sku.amount = amount 62 | sku.count = count.decode() 63 | skus.append(sku) 64 | # 累加计算总数目和总价格 65 | total_count+=int(count) 66 | total_price+=amount 67 | context = { 68 | 'total_count': total_count, 69 | 'total_price': total_price, 70 | 'skus': skus, 71 | } 72 | return render(request, 'cart.html', context) 73 | 74 | 75 | # 更新购物车的记录 76 | # 前端采用ajax post请求 77 | # 前端需要传递参数商品id 更新的商品数目 78 | class CartUpdateView( View): 79 | '''购物车记录''' 80 | def post(self, request): 81 | '''购物车记录更新''' 82 | 83 | if not request.user.is_authenticated: 84 | return JsonResponse({'res': 0, "errmsg": '先登录'}) 85 | count = request.POST.get('count') 86 | sku_id = request.POST.get('sku_id') 87 | user = request.user 88 | # 数据效验 89 | if not all([sku_id, count]): 90 | return JsonResponse({'res': 1, 'errmsg': "数据不完整"}) 91 | try: 92 | count = int(count) 93 | except Exception as e: 94 | return JsonResponse({'res': 2, 'errmsg': '商品数目出错'}) 95 | try: 96 | sku=GoodsSKU.objects.get(id=sku_id) 97 | except GoodsSKU.DoesNotExist: 98 | return JsonResponse({'res': 3, 'errmsg': '商品不存在'}) 99 | # 数据效验 100 | conn = get_redis_connection('default') 101 | cart_key = 'cart_%d' % user.id 102 | if count>sku.stock: 103 | return JsonResponse({'res':4,'errmsg':"库存不够"}) 104 | # 业务应答 105 | conn.hset(cart_key, sku_id, count) 106 | # 用户购物车商品的总件数 107 | total_count = 0 108 | vals = conn.hvals(cart_key) 109 | for val in vals: 110 | total_count+=int(val) 111 | # 返回响应 112 | return JsonResponse({'res':5, "message":'更新成功','total_count':total_count}) 113 | 114 | 115 | # 删除购物车记录 116 | # 采用ajax post请求 117 | # 前端需要传递的参数 sku.id 118 | class CartDeleteView( View): 119 | def post(self, request): 120 | '''购物车删除''' 121 | if not request.user.is_authenticated: 122 | return JsonResponse({'res': 0, "errmsg": '先登录'}) 123 | sku_id = request.POST.get('sku_id') 124 | # 数据效验 125 | if not sku_id: 126 | return JsonResponse({'res':1,'errmsg':'无效数据'}) 127 | conn = get_redis_connection('default') 128 | cart_key = "cart_%d" % request.user.id 129 | exists = conn.hexists(cart_key, sku_id) 130 | if not exists: 131 | return JsonResponse({'res':2,'errmsg':'不存在数据'}) 132 | 133 | conn.hdel(cart_key, sku_id) 134 | # 用户购物车商品的总件数 135 | total_count = 0 136 | vals = conn.hvals(cart_key) 137 | for val in vals: 138 | total_count+=int(val) 139 | # 返回数据 140 | return JsonResponse({'res':3, 'total_count':total_count,'message':'删除成功'}) 141 | -------------------------------------------------------------------------------- /share/man/man1/mid3v2.1: -------------------------------------------------------------------------------- 1 | .\" Man page generated from reStructuredText. 2 | . 3 | .TH MID3V2 1 "" "" "" 4 | .SH NAME 5 | mid3v2 \- audio tag editor similar to 'id3v2' 6 | . 7 | .nr rst2man-indent-level 0 8 | . 9 | .de1 rstReportMargin 10 | \\$1 \\n[an-margin] 11 | level \\n[rst2man-indent-level] 12 | level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] 13 | - 14 | \\n[rst2man-indent0] 15 | \\n[rst2man-indent1] 16 | \\n[rst2man-indent2] 17 | .. 18 | .de1 INDENT 19 | .\" .rstReportMargin pre: 20 | . RS \\$1 21 | . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] 22 | . nr rst2man-indent-level +1 23 | .\" .rstReportMargin post: 24 | .. 25 | .de UNINDENT 26 | . RE 27 | .\" indent \\n[an-margin] 28 | .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] 29 | .nr rst2man-indent-level -1 30 | .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] 31 | .in \\n[rst2man-indent\\n[rst2man-indent-level]]u 32 | .. 33 | .SH SYNOPSIS 34 | .sp 35 | \fBmid3v2\fP [\fIoptions\fP] \fIfilename\fP ... 36 | .SH DESCRIPTION 37 | .sp 38 | \fBmid3v2\fP is a Mutagen\-based replacement for id3lib\(aqs id3v2. It supports 39 | ID3v2.4 and more frames; it also does not have the numerous bugs that plague 40 | id3v2. 41 | .sp 42 | This program exists mostly for compatibility with programs that want to tag 43 | files using id3v2. For a more usable interface, we recommend Ex Falso. 44 | .SH OPTIONS 45 | .INDENT 0.0 46 | .TP 47 | .B \-q\fP,\fB \-\-quiet 48 | Be quiet: do not mention file operations that perform the user\(aqs 49 | request. Warnings will still be printed. 50 | .TP 51 | .B \-v\fP,\fB \-\-verbose 52 | Be verbose: state all operations performed. This is the opposite of 53 | \-\-quiet. This is the default. 54 | .TP 55 | .B \-e\fP,\fB \-\-escape 56 | Enable interpretation of backslash escapes for tag values. 57 | Makes it possible to escape the colon\-separator in TXXX, WXXX, COMM 58 | values like \(aq\e:\(aq and insert escape sequences like \(aq\en\(aq, \(aq\et\(aq etc. 59 | .TP 60 | .B \-f\fP,\fB \-\-list\-frames 61 | Display all supported ID3v2.3/2.4 frames and their meanings. 62 | .TP 63 | .B \-L\fP,\fB \-\-list\-genres 64 | List all ID3v1 numeric genres. These can be used to set TCON frames, 65 | but it is not recommended. 66 | .TP 67 | .B \-l\fP,\fB \-\-list 68 | List all tags in the files. The output format is \fInot\fP the same as 69 | id3v2\(aqs; instead, it is easily parsable and readable. Some tags may not 70 | have human\-readable representations. 71 | .TP 72 | .B \-\-list\-raw 73 | List all tags in the files, in raw format. Although this format is 74 | nominally human\-readable, it may be very long if the tag contains 75 | embedded binary data. 76 | .TP 77 | .B \-d\fP,\fB \-\-delete\-v2 78 | Delete ID3v2 tags. 79 | .TP 80 | .B \-s\fP,\fB \-\-delete\-v1 81 | Delete ID3v1 tags. 82 | .TP 83 | .B \-D\fP,\fB \-\-delete\-all 84 | Delete all ID3 tags. 85 | .TP 86 | .BI \-\-delete\-frames\fB= FRAMES 87 | Delete specific ID3v2 frames (or groups of frames) from the files. 88 | \fBFRAMES\fP is a "," separated list of frame names e.g. \fB"TPE1,TALB"\fP 89 | .TP 90 | .B \-C\fP,\fB \-\-convert 91 | Convert ID3v1 tags to ID3v2 tags. This will also happen automatically 92 | during any editing. 93 | .TP 94 | .BI \-a\fP,\fB \-\-artist\fB= ARTIST 95 | Set the artist information (TPE1). 96 | .TP 97 | .BI \-A\fP,\fB \-\-album\fB= ALBUM 98 | Set the album information (TALB). 99 | .TP 100 | .BI \-t\fP,\fB \-\-song\fB= TITLE 101 | Set the title information (TIT2). 102 | .TP 103 | .BI \-c\fP,\fB \-\-comment\fB= 104 | Set a comment (COMM). The language and description may be omitted, in 105 | which case the language defaults to English, and the description to an 106 | empty string. 107 | .TP 108 | .BI \-p\fP,\fB \-\-picture\fB= 109 | Set the attached picture (APIC). Everything except the filename can be 110 | omitted in which case default values will be used. 111 | .TP 112 | .BI \-g\fP,\fB \-\-genre\fB= GENRE 113 | Set the genre information (TCON). 114 | .TP 115 | .BI \-y\fP,\fB \-\-year\fB= \fP,\fB \ \-\-date\fB= 116 | Set the year/date information (TDRC). 117 | .TP 118 | .BI \-T\fP,\fB \-\-track\fB= 119 | Set the track number (TRCK). 120 | .UNINDENT 121 | .sp 122 | Any text or URL frame (those beginning with T or W) can be modified or 123 | added by prefixing the name of the frame with "\-\-". For example, \fB\-\-TIT3 124 | "Monkey!"\fP will set the TIT3 (subtitle) frame to \fBMonkey!\fP\&. 125 | .sp 126 | The TXXX frame has the format ; many TXXX frames may be 127 | set in the file as long as they have different keys. To set this key, just 128 | separate the text with a colon, e.g. \fB\-\-TXXX "ALBUMARTISTSORT:Examples, 129 | The"\fP\&. The description can be omitted in which case it defaults to an empty 130 | string. 131 | .sp 132 | The WXXX frame has the same format as TXXX but since URLs usually contain a 133 | ":" you have provide a description or enable escaping (\-e): 134 | \fB\-\-WXXX "desc:http://foo.bar"\fP or \fB\-e \-\-WXXX "http\e\e://foo.bar"\fP 135 | .sp 136 | The USLT frame has the format . The language and 137 | description may be omitted, in which case the language defaults to English, 138 | and the description to an empty string. 139 | .sp 140 | The special POPM frame can be set in a similar way: \fB\-\-POPM 141 | "bob@example.com:128:2"\fP to set Bob\(aqs rating to 128/255 with 2 plays. 142 | .SH BUGS 143 | .sp 144 | No sanity checking is done on the editing operations you perform, so mid3v2 145 | will happily accept \-\-TSIZ when editing an ID3v2.4 frame. However, it will 146 | also automatically throw it out during the next edit operation. 147 | .SH AUTHOR 148 | .sp 149 | Joe Wreschnig is the author of mid3v2, but he doesn\(aqt like to admit it. 150 | .\" Generated by docutils manpage writer. 151 | . 152 | -------------------------------------------------------------------------------- /dailyfresh/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for dailyfresh project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.5. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | import sys 15 | 16 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 17 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 18 | sys.path.insert(0, os.path.join(BASE_DIR, 'apps')) 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'lax%ik^96&+8*##um=7#)!!c44kkuanfcan%7bic8@h23@x@tf' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = [] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'simpleui', 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | 'cart', 43 | 'order', 44 | 'user', 45 | 'goods', 46 | 'tinymce', 47 | 'haystack',# 全文检索框架 48 | ] 49 | 50 | MIDDLEWARE = [ 51 | 'django.middleware.security.SecurityMiddleware', 52 | 'django.contrib.sessions.middleware.SessionMiddleware', 53 | 'django.middleware.common.CommonMiddleware', 54 | 'django.middleware.csrf.CsrfViewMiddleware', 55 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 56 | 'django.contrib.messages.middleware.MessageMiddleware', 57 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 58 | ] 59 | 60 | ROOT_URLCONF = 'dailyfresh.urls' 61 | 62 | TEMPLATES = [ 63 | { 64 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 65 | 'DIRS': [os.path.join(BASE_DIR, 'templates')] 66 | , 67 | 'APP_DIRS': True, 68 | 'OPTIONS': { 69 | 'context_processors': [ 70 | 'django.template.context_processors.debug', 71 | 'django.template.context_processors.request', 72 | 'django.contrib.auth.context_processors.auth', 73 | 'django.contrib.messages.context_processors.messages', 74 | ], 75 | }, 76 | }, 77 | ] 78 | 79 | WSGI_APPLICATION = 'dailyfresh.wsgi.application' 80 | 81 | 82 | # Database 83 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 84 | 85 | DATABASES = { 86 | 'default': { 87 | 'ENGINE': 'django.db.backends.mysql', 88 | 'NAME': 'dailyfresh', 89 | 'USER': "root", 90 | 'PASSWORD': "123456", 91 | "HOST": "192.168.80.132", 92 | "PORT": 3306, 93 | "charset": 'utf8', 94 | } 95 | } 96 | 97 | 98 | # Password validation 99 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 100 | 101 | AUTH_PASSWORD_VALIDATORS = [ 102 | { 103 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 104 | }, 105 | { 106 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 107 | }, 108 | { 109 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 110 | }, 111 | { 112 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 113 | }, 114 | ] 115 | 116 | 117 | # Internationalization 118 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 119 | 120 | LANGUAGE_CODE = 'zh-hans' 121 | 122 | TIME_ZONE = 'Asia/Shanghai' 123 | 124 | USE_I18N = True 125 | 126 | USE_L10N = True 127 | 128 | USE_TZ = True 129 | 130 | 131 | # Static files (CSS, JavaScript, Images) 132 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 133 | 134 | STATIC_URL = '/static/' 135 | STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] 136 | DEFAULT_CONFIG = { 137 | 'theme': 'advanced', 138 | 'width': 600, 139 | 'height': 400, 140 | } 141 | # django 认证系统使用的模型类 142 | AUTH_USER_MODEL = 'user.User' 143 | 144 | # 发送邮件配置 145 | EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 146 | # smtp服务器地址 147 | EMAIL_HOST = 'smtp.163.com' 148 | EMAIL_PORT = '25' 149 | # 发送邮件的邮箱 150 | EMAIL_HOST_USER = "githubcy700@163.com" 151 | # 授权密码 152 | EMAIL_HOST_PASSWORD = 'BXKZXRWFRYSSTYGN' 153 | # 收件人看到的发件人 154 | EMAIL_FROM = 'DailyFresh' 155 | 156 | 157 | # redis缓存设置 158 | CACHES = { 159 | "default": { 160 | "BACKEND": "django_redis.cache.RedisCache", 161 | "LOCATION": "redis://192.168.80.132/1", 162 | "OPTIONS": { 163 | "CLIENT_CLASS": "django_redis.client.DefaultClient", 164 | } 165 | } 166 | } 167 | # 配置session存储方式 168 | SESSION_ENGINE = "django.contrib.sessions.backends.cache" 169 | SESSION_CACHE_ALIAS = "default" 170 | # 未登录跳转到指定的地址 171 | LOGIN_URL = '/user/login/' 172 | # 设置文件存储类 173 | DEFAULT_FILE_STORAGE = 'utils.fdfs.storage.FDFSStorage' 174 | 175 | # 设置FDFS使用的client.conf的文件路径 176 | FDFS_CLIENT_CONF = './utils/fdfs/client.conf' 177 | 178 | # 设置FDFS储存服务器上nginx的IP和端口号 179 | FDFS_URL = "http://192.168.80.132:8888/" 180 | # 群文检索框架的配置 181 | HAYSTACK_CONNECTIONS = { 182 | 'default': { 183 | #使用whoosh引擎 engine是一个路径 184 | 'ENGINE': 'haystack.backends.whoosh_cn_backend.WhooshEngine', 185 | #索引文件路径 186 | 'PATH': os.path.join(BASE_DIR, 'whoosh_index'), 187 | } 188 | } 189 | 190 | #当添加、修改、删除数据时,自动生成索引 191 | HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' 192 | 193 | 194 | # simpleuo的设计 195 | SIMPLEUI_ICON = { 196 | '订单商品': 'fab fa-500px', 197 | } 198 | --------------------------------------------------------------------------------