├── GetUrlParse ├── PKG-INFO ├── README.md ├── geturlparse.egg-info │ ├── PKG-INFO │ ├── SOURCES.txt │ ├── dependency_links.txt │ └── top_level.txt ├── my_package │ ├── dbs │ │ ├── dbs.py │ │ └── storer.py │ ├── gets │ │ ├── crawler.py │ │ ├── gets.py │ │ └── test.py │ ├── geturlparse.py │ ├── run.py │ ├── scheduler.py │ ├── settings.py │ └── tests │ │ ├── __init__.py │ │ ├── tests.py │ │ └── updater.py ├── setup.cfg └── setup.py ├── README.md ├── SCRIPT ├── auto_add_energy.py └── auto_choice_market.py ├── delicious_hometown ├── admin.py ├── apps.py ├── auto_add_energy.py ├── auto_choice_market.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20181007_0100.py │ ├── 0003_auto_20181007_1435.py │ ├── 0004_auto_20181007_1436.py │ ├── 0005_auto_20181007_1529.py │ ├── 0006_auto_20181007_1530.py │ ├── 0007_ambry.py │ ├── 0008_auto_20181007_1550.py │ ├── 0009_auto_20181007_1752.py │ ├── 0010_auto_20181008_0018.py │ ├── 0011_auto_20181008_1058.py │ ├── 0012_auto_20181008_1652.py │ ├── 0013_backpack.py │ ├── 0014_auto_20181008_1927.py │ ├── 0015_recipeclass_recipelevel_restaurant_restaurantrecipe.py │ ├── 0016_auto_20181010_1113.py │ ├── 0017_auto_20181010_1144.py │ ├── 0018_auto_20181010_1147.py │ ├── 0019_recipematerial.py │ ├── 0020_recipestudy.py │ ├── 0021_auto_20181012_1127.py │ ├── 0022_auto_20181012_1135.py │ ├── 0023_choice_market.py │ ├── 0024_auto_20181012_1627.py │ ├── 0025_choicemarket_test.py │ ├── 0026_foodmateriallevelprice.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-36.pyc │ │ ├── 0002_auto_20181007_0100.cpython-36.pyc │ │ ├── 0003_auto_20181007_1435.cpython-36.pyc │ │ ├── 0004_auto_20181007_1436.cpython-36.pyc │ │ ├── 0005_auto_20181007_1529.cpython-36.pyc │ │ ├── 0006_auto_20181007_1530.cpython-36.pyc │ │ ├── 0007_ambry.cpython-36.pyc │ │ ├── 0008_auto_20181007_1550.cpython-36.pyc │ │ ├── 0009_auto_20181007_1752.cpython-36.pyc │ │ ├── 0010_auto_20181008_0018.cpython-36.pyc │ │ ├── 0011_auto_20181008_1058.cpython-36.pyc │ │ ├── 0012_auto_20181008_1652.cpython-36.pyc │ │ ├── 0013_backpack.cpython-36.pyc │ │ ├── 0014_auto_20181008_1927.cpython-36.pyc │ │ ├── 0015_recipeclass_recipelevel_restaurant_restaurantrecipe.cpython-36.pyc │ │ ├── 0016_auto_20181010_1113.cpython-36.pyc │ │ ├── 0017_auto_20181010_1144.cpython-36.pyc │ │ ├── 0018_auto_20181010_1147.cpython-36.pyc │ │ ├── 0019_recipematerial.cpython-36.pyc │ │ ├── 0020_recipestudy.cpython-36.pyc │ │ ├── 0021_auto_20181012_1127.cpython-36.pyc │ │ ├── 0022_auto_20181012_1135.cpython-36.pyc │ │ ├── 0023_choice_market.cpython-36.pyc │ │ ├── 0024_auto_20181012_1627.cpython-36.pyc │ │ ├── 0025_choicemarket_test.cpython-36.pyc │ │ ├── 0026_foodmateriallevelprice.cpython-36.pyc │ │ └── __init__.cpython-36.pyc ├── models.py ├── static │ ├── logo_1.gif │ ├── logo_2.png │ └── test1.jpg ├── tests.py └── views.py ├── delicious_town_mysql.sql ├── manage.py ├── recipe_all.xls ├── static ├── bootstrap │ ├── css │ │ └── bootstrap.min.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ └── bootstrap.min.js ├── css │ ├── base.css │ ├── bootstrap.css │ └── normalize.css ├── fontawesome │ ├── css │ │ └── fontawesome.min.css │ └── webfonts │ │ ├── fa-brands-400.eot │ │ ├── fa-brands-400.svg │ │ ├── fa-brands-400.ttf │ │ ├── fa-brands-400.woff │ │ ├── fa-brands-400.woff2 │ │ ├── fa-regular-400.eot │ │ ├── fa-regular-400.svg │ │ ├── fa-regular-400.ttf │ │ ├── fa-regular-400.woff │ │ ├── fa-regular-400.woff2 │ │ ├── fa-solid-900.eot │ │ ├── fa-solid-900.svg │ │ ├── fa-solid-900.ttf │ │ ├── fa-solid-900.woff │ │ └── fa-solid-900.woff2 ├── image │ ├── logo_1.gif │ ├── logo_2.png │ └── test1.jpg ├── js │ ├── bootstrap.js │ ├── jquery.js │ └── popper.js └── readme.md ├── templates ├── ambry.html ├── backpack.html ├── buy_money.html ├── foodmaterial.html ├── friend.html ├── gift.html ├── home_address.html ├── index.html ├── login.html ├── market.html ├── my_recipe.html ├── recipe.html ├── recipe_study.html ├── recipe_view.html ├── register.html ├── shop.html ├── test_1.html ├── test_2.html ├── test_3.html └── treasure.html ├── test └── test_demo ├── __init__.py ├── __pycache__ ├── __init__.cpython-36.pyc ├── check_middleware.cpython-36.pyc ├── settings.cpython-36.pyc ├── urls.cpython-36.pyc └── wsgi.cpython-36.pyc ├── check_middleware.py ├── settings.py ├── urls.py └── wsgi.py /GetUrlParse/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: geturlparse 3 | Version: 1.0.0 4 | Summary: UNKNOWN 5 | Home-page: UNKNOWN 6 | Author: changwoo 7 | Author-email: changwoo360@gmail.com 8 | License: UNKNOWN 9 | Description: UNKNOWN 10 | Platform: any 11 | -------------------------------------------------------------------------------- /GetUrlParse/README.md: -------------------------------------------------------------------------------- 1 | # Model-GetUrlParse 2 | Extend model: requests. 3 | Installation 4 | ------------ 5 | 6 | 7 | pip install setup 8 | 9 | from geturlparse import GetUrlParse 10 | 11 | ~~~ 12 | class ResponseParse(GetUrlParse): 13 | def __init__(self): 14 | super(ResponseParse, self).__init__() 15 | 16 | def test(self): 17 | response = self.get('https://www.baidu.com/') 18 | print(response) 19 | 20 | 21 | 22 | ResponseParse().test() 23 | ~~~ 24 | ## 配置相关: 25 | - 代理池默认关闭 26 | - 使用时要先继承,可以修改配置参数 27 | - 暂时没有写urllib 和 urllib2 28 | - get方法可以传入一个列表或一个字符串 29 | - 可以设置ip,cookies,headers.. 30 | - 对错误进行了捕获 31 | ~~~ 32 | try: 33 | try: 34 | import urllib2 # python2 35 | USED_PARSER = 'urllib2' 36 | # urllib.request = urllib2 37 | except ImportError: 38 | import requests 39 | USED_PARSER = 'requests(urllib3)' 40 | except ImportError: 41 | import urllib.request # python3 urllib2 = urllib.request 42 | USED_PARSER = 'urllib' 43 | urllib2 = urllib.request 44 | ~~~ 45 | -------------------------------------------------------------------------------- /GetUrlParse/geturlparse.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: geturlparse 3 | Version: 1.0.0 4 | Summary: UNKNOWN 5 | Home-page: UNKNOWN 6 | Author: changwoo 7 | Author-email: changwoo360@gmail.com 8 | License: UNKNOWN 9 | Description: UNKNOWN 10 | Platform: any 11 | -------------------------------------------------------------------------------- /GetUrlParse/geturlparse.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | setup.py 2 | geturlparse.egg-info/PKG-INFO 3 | geturlparse.egg-info/SOURCES.txt 4 | geturlparse.egg-info/dependency_links.txt 5 | geturlparse.egg-info/top_level.txt 6 | my_package/__init__.py 7 | my_package/geturlparse.py 8 | my_package/run.py 9 | my_package/scheduler.py 10 | my_package/settings.py 11 | my_package/dbs/__init__.py 12 | my_package/dbs/dbs.py 13 | my_package/dbs/storer.py 14 | my_package/examples/__init__.py 15 | my_package/gets/__init__.py 16 | my_package/gets/crawler.py 17 | my_package/gets/gets.py 18 | my_package/gets/test.py 19 | my_package/tests/__init__.py 20 | my_package/tests/tests.py 21 | my_package/tests/updater.py -------------------------------------------------------------------------------- /GetUrlParse/geturlparse.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GetUrlParse/geturlparse.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | my_package 2 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/dbs/dbs.py: -------------------------------------------------------------------------------- 1 | import pymysql 2 | from dbs.storer import Storer 3 | 4 | class Dbs(object): 5 | def run(self, HOST, USER, PASSWORD, DATABASE): 6 | try: 7 | db = pymysql.connect(HOST, USER, PASSWORD, DATABASE) 8 | 9 | except: 10 | print('error') 11 | 12 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/dbs/storer.py: -------------------------------------------------------------------------------- 1 | from settings import * 2 | import pymysql 3 | class Storer(object): 4 | def save_data(self, data, HOST=HOST, USER=USER, PASSWORD=PASSWORD, DATABASE=DATABASE): 5 | conn = pymysql.connect(HOST, USER, PASSWORD, DATABASE) 6 | cursor = conn.cursor() 7 | sql = "insert proxypool(ip) values(%s)" 8 | cursor.executemany(sql, data) 9 | print('数据保存成功') 10 | conn.commit() 11 | cursor.close() 12 | conn.close() 13 | 14 | def main(self): 15 | pass -------------------------------------------------------------------------------- /GetUrlParse/my_package/gets/crawler.py: -------------------------------------------------------------------------------- 1 | from pyquery import PyQuery as pq 2 | import io 3 | import sys 4 | import pymysql 5 | import requests 6 | import time 7 | import re 8 | import random 9 | import requests 10 | import os 11 | from requests.exceptions import ConnectionError 12 | import sys 13 | dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 14 | sys.path.insert(0, dir) 15 | from tests.updater import Updater 16 | 17 | 18 | 19 | sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8') 20 | 21 | 22 | class Crawler(): 23 | 24 | def get_response(self, url): 25 | USER_AGENTS = [ 26 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", 27 | "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)", 28 | "Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", 29 | "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)", 30 | "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)", 31 | "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)", 32 | "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)", 33 | "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)", 34 | "Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6", 35 | "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070215 K-Ninja/2.1.1", 36 | "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/20080705 Firefox/3.0 Kapiko/3.0", 37 | "Mozilla/5.0 (X11; Linux i686; U;) Gecko/20070322 Kazehakase/0.4.5", 38 | "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6", 39 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11", 40 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20", 41 | "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52", 42 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11", 43 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER", 44 | "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER)", 45 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)", 46 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 LBBROWSER", 47 | "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)", 48 | "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400)", 49 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)", 50 | "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)", 51 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)", 52 | "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)", 53 | "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1", 54 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1", 55 | "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", 56 | "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b13pre) Gecko/20110307 Firefox/4.0b13pre", 57 | "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0", 58 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11", 59 | "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10" 60 | ] 61 | headers = { 62 | 'User-Agent': random.choice(USER_AGENTS), 63 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 64 | 'Accept-Language': 'en-US,en;q=0.5', 65 | 'Connection': 'keep-alive', 66 | 'Accept-Encoding': 'gzip, deflate', 67 | } 68 | try: 69 | response = requests.get(url, headers=headers) 70 | if response.status_code is 200: 71 | return response.text 72 | except Exception as result: 73 | print("The program got an exception:\"{}\"".format(result)) 74 | return 75 | 76 | def get_data_66ip(self, start_page=1, stop_page=10): 77 | base_url = "http://www.66ip.cn/{}.html" 78 | url_list = [base_url.format(i) for i in range(start_page, stop_page+1)] 79 | for url in url_list: 80 | content = self.get_response(url) 81 | if content: 82 | pattern = re.compile("([0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4})([0-9]{4})([0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4})([0-9]{4})(.*?)') 105 | host = re.findall(pattern,content) 106 | pattern = re.compile('(.*?)') 107 | port = re.findall(pattern, content) 108 | for host,port in zip(host,port): 109 | new_proxy = host + ":" + port 110 | yield new_proxy 111 | 112 | def get_data_daxiang(self): 113 | pass 114 | 115 | def main(self): 116 | base_ip_list = [] 117 | base_ip_list.append(self.get_data_66ip()) 118 | base_ip_list.append(self.get_data_xici()) 119 | base_ip_list.append(self.get_data_kuai()) 120 | # base_ip_list.append(self.get_data_daxiang()) 121 | 122 | print('数据抓取成功') 123 | return Updater().new_update(base_ip_list) 124 | 125 | ''' 126 | for old_proxy in Updater().new_update(base_ip_list): 127 | print(old_proxy) 128 | yield old_proxy 129 | ''' 130 | 131 | 132 | 133 | def save_data(self, data): 134 | conn = pymysql.connect(host='127.0.0.1', user='root', password='ren666666', database='proxypool') 135 | cursor = conn.cursor() 136 | sql = "insert proxypool(ip) values(%s)" 137 | cursor.executemany(sql, data) 138 | conn.commit() 139 | result = cursor.fetchone() 140 | cursor.close() 141 | conn.close() 142 | print(result) 143 | def get_data(self): 144 | conn = pymysql.connect(host='127.0.0.1', user='root', password='ren666666', database='proxypool') 145 | print('----1----') 146 | cursor = conn.cursor() 147 | sql = "select ip from proxypool" 148 | cursor.execute(sql) 149 | result = cursor.fetchall() 150 | cursor.close() 151 | conn.close() 152 | return result 153 | 154 | 155 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/gets/gets.py: -------------------------------------------------------------------------------- 1 | from gets.crawler import Crawler 2 | from dbs.storer import Storer 3 | 4 | class GetProxy(object): 5 | def __init__(self): 6 | pass 7 | ''' 8 | self.proxy_list = Crawler().main() 9 | ''' 10 | def proxypool_num(self): 11 | a = 20 12 | if a < 100: 13 | return True 14 | else: 15 | return False 16 | 17 | def run(self): 18 | if self.proxypool_num(): 19 | ip_list = Crawler().main() 20 | print('数据筛选成功') 21 | Storer().save_data(ip_list) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/gets/test.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | import requests 4 | import re 5 | start_url = 'http://www.xicidaili.com/nn/{}'.format(i) 6 | headers = { 7 | 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 8 | 'Cookie':'_free_proxy_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWRjYzc5MmM1MTBiMDMzYTUzNTZjNzA4NjBhNWRjZjliBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUp6S2tXT3g5a0FCT01ndzlmWWZqRVJNek1WanRuUDBCbTJUN21GMTBKd3M9BjsARg%3D%3D--2a69429cb2115c6a0cc9a86e0ebe2800c0d471b3', 9 | 'Host':'www.xicidaili.com', 10 | 'Referer':'http://www.xicidaili.com/nn/3', 11 | 'Upgrade-Insecure-Requests':'1', 12 | } 13 | html = get_page(start_url, options=headers) 14 | if html: 15 | find_trs = re.compile('(.*?)', re.S) 16 | trs = find_trs.findall(html) 17 | for tr in trs: 18 | find_ip = re.compile('(\d+\.\d+\.\d+\.\d+)') 19 | re_ip_address = find_ip.findall(tr) 20 | find_port = re.compile('(\d+)') 21 | re_port = find_port.findall(tr) 22 | for address,port in zip(re_ip_address, re_port): 23 | address_port = address+':'+port 24 | yield address_port.replace(' ','') 25 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/geturlparse.py: -------------------------------------------------------------------------------- 1 |  2 | # import nature models 3 | import random 4 | import time 5 | 6 | 7 | # import extend models 8 | 9 | # import personal models 10 | from settings import * 11 | 12 | 13 | try: 14 | try: 15 | import urllib2 # python2 16 | USED_PARSER = 'urllib2' 17 | # urllib.request = urllib2 18 | except ImportError: 19 | import requests 20 | USED_PARSER = 'requests(urllib3)' 21 | except ImportError: 22 | import urllib.request # python3 urllib2 = urllib.request 23 | USED_PARSER = 'urllib' 24 | urllib2 = urllib.request 25 | 26 | class GetUrlParse(object): 27 | 28 | """docstring for GetParseUrl""" 29 | def __init__(self): 30 | self.sleep_time = SLEEP_TIME 31 | self.check_ip_url = CHECK_IP_URL 32 | self.request_url = [] 33 | self.cookies = [] 34 | self.ua_list = UA_LIST 35 | 36 | 37 | def user_agent(self): 38 | user_agent_choice = {'user-agent': random.choice(self.ua_list)} 39 | return user_agent_choice 40 | 41 | 42 | def request_frequency(self): 43 | time_sleep_choice = random.sample(self.sleep_time, 1)[0] 44 | request_frequency_choice = random.randint(time_sleep_choice[0], time_sleep_choice[1]) 45 | 46 | print('The program is sleeping:need {}s'.format(request_frequency_choice)) 47 | time.sleep(request_frequency_choice) 48 | 49 | def url_parse(self, url): 50 | 51 | try: 52 | response = requests.get(url, headers=self.user_agent()) 53 | if response.status_code is 200: 54 | print('Parse url:({}) successful!'.format(url)) 55 | return response.text 56 | self.request_frequency() 57 | else: 58 | print("The url's status_code isn't 200! Please check!") 59 | return None 60 | except (ConnectionError): 61 | print('Error occurred') 62 | return None 63 | except Exception as result: 64 | print('捕获到其他异常:{}'.format(result)) 65 | return None 66 | 67 | 68 | def get(self, urls): 69 | 70 | if isinstance(urls, list): 71 | return [self.url_parse(i) for i in urls] 72 | 73 | elif isinstance(urls, str): 74 | return self.url_parse(urls) 75 | 76 | else: 77 | print('Please input a valid value in function "get", for excaple: ["www.abc.com", "www.abc.com", "www.abc.com"] or "www.abc.com".') 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/run.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import io 3 | from scheduler import Scheduler 4 | 5 | 6 | def main(): 7 | # 入口文件,运行调度器 8 | try: 9 | # 改变标准输出的默认编码 10 | sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8') 11 | Scheduler().run() 12 | except Exception as result: 13 | print("The
program got an exception:\"{}\"".format(result)) 14 | 15 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/scheduler.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from multiprocessing import Process 4 | 5 | from settings import * 6 | from gets.gets import GetProxy 7 | from tests.tests import TestProxy 8 | from dbs.dbs import Dbs 9 | 10 | 11 | class Scheduler(object): 12 | def get_proxy(self, get_proxy_time=GET_PROXY_TIME, get_proxy_num=GET_PROXY_NUM): 13 | n = 1 14 | while n < get_proxy_num: 15 | print("第{}次获取代理循环已启动".format(n)) 16 | GetProxy().run() 17 | # time.sleep(get_proxy_time) 18 | n += 1 19 | def test_proxy(self, test_proxy_time=TEST_PROXY_TIME, post_proxy_num=POST_PROXY_NUM): 20 | n = 1 21 | while n < post_proxy_num: 22 | print("第{}次获取代理循环已启动".format(n)) 23 | TestProxy().run() 24 | # time.sleep(get_proxy_time) 25 | n += 1 26 | 27 | def dbs_proxy(self): 28 | Dbs().run(HOST, USER, PASSWORD, DATABASE) 29 | 30 | def run(self): 31 | if GETS_: 32 | Process(target=self.get_proxy).start() 33 | if TESTS_: 34 | Process(target=self.test_proxy).start() 35 | if DBS_: 36 | Process(target=self.db_proxy).start() 37 | 38 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/settings.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | _version = '0.0.1' 5 | 6 | 7 | # 爬取频率 8 | # TIME_SLEEP = [[0, 10], [0, 10], [0, 10], [0, 10], [0, 10], [20, 30]] 9 | SLEEP_TIME = [[0, 3], ] 10 | 11 | 12 | # ip代理池开关 13 | OPEN_IP_POOL = False 14 | 15 | # 检测ip可用性 16 | CHECK_IP_URL = [[], ] 17 | 18 | # ip代理 19 | IP_PROXY = [[], ] 20 | 21 | # user-agent 22 | UA_LIST = [ 23 | 'Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 24 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', 25 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 26 | 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', 27 | 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0', 28 | 'Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11', 29 | # others.. 30 | ] 31 | 32 | 33 | # 使用的解析器 34 | USED_PARSER = '' 35 | 36 | 37 | # cookies 38 | COOKIES = [[], ] 39 | 40 | 41 | # ip代理池设置 42 | GETS_ = True 43 | TESTS_ = False 44 | DBS_ = False 45 | 46 | GET_PROXY_NUM = 2 47 | GET_PROXY_TIME = 300 48 | 49 | POST_PROXY_NUM = 2 50 | TEST_PROXY_TIME = 300 51 | 52 | START_PAGE = 1 53 | STOP_PAGE = 3 54 | 55 | USER = 'root' 56 | PASSWORD = 'ren666666' 57 | HOST = '127.0.0.1' 58 | DATABASE = 'proxypool' 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GetUrlParse/my_package/tests/tests.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | class TestProxy(): 6 | def __init__(self): 7 | self.old_proxy = ['1','2'] 8 | def proxypool_num(self): 9 | a = 20 10 | if a > 100: 11 | return True 12 | else: 13 | return False 14 | 15 | def run(self): 16 | if self.proxypool_num(): 17 | for proxy in self.old_proxy: 18 | print(proxy) -------------------------------------------------------------------------------- /GetUrlParse/my_package/tests/updater.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from collections import Iterable 3 | 4 | class Updater(object): 5 | def __init__(self): 6 | self.old_proxy = [] 7 | def new_update(self, base_ip_list): 8 | for proxy_list in base_ip_list: 9 | for base_ip in proxy_list: 10 | proxies = {"http": "http://{0}".format(base_ip)} 11 | try: 12 | r = requests.get('http://httpbin.org/ip', proxies=proxies, timeout=10, verify=False) 13 | if r.status_code == 200: 14 | yield base_ip 15 | except Exception as e: 16 | pass 17 | ''' 18 | try: 19 | session = requests.session() 20 | session.proxies = {base_ip} 21 | headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0'} 22 | test_url = 'https://www.baidu.com/' 23 | resp = session.get(test_url, timeout=5, headers=headers) 24 | print(resp.status_code) 25 | print('successful--->{}'.format(base_ip)) 26 | old_list = tuple(list(i.split(' '))) 27 | print(old_list) 28 | yield old_list 29 | except: 30 | pass 31 | #print('error-->{}'.format(base_ip)) 32 | ''' 33 | 34 | 35 | def old_update(self): 36 | pass 37 | 38 | def main(self): 39 | pass 40 | -------------------------------------------------------------------------------- /GetUrlParse/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | 5 | -------------------------------------------------------------------------------- /GetUrlParse/setup.py: -------------------------------------------------------------------------------- 1 | 2 | from setuptools import setup, find_packages 3 | 4 | setup( 5 | name='geturlparse', 6 | version='1.0.0', 7 | author='changwoo', 8 | author_email = 'changwoo360@gmail.com', 9 | packages = find_packages(), 10 | include_package_data = True, 11 | platforms = 'any', 12 | install_requires = [], 13 | ) 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### 美味小镇源码+数据库数据 2 | 3 | @[Python|Django|Bootstrap] 4 | 5 | >小时候很喜欢玩的一款wap游戏,2015年,qq家园团队宣布因公司业务调整而停止运营,不得不说是一个遗憾。所幸接触到了编程,自己也有能力写一款这样的游戏,虽然已经没有多少玩家了,但也算圆了小时的梦想吧。 6 | 7 | 所用技术点: 8 | - **Python**:主要使用的编程语言 9 | - **Django**:Python的web开发框架 10 | - **Bootstrap**:前端工具包 11 | - **MySQL**:数据库 12 | 13 | 已经实现的功能有: 14 | - 商店 15 | - 仓库 16 | - 橱柜 17 | - 食谱 18 | - 菜谱 19 | - 菜场 20 | - 充值 21 | - 圣地 22 | - 注册登录 23 | - 菜谱升级 24 | - 自动回复体力脚本 25 | - 自动刷新菜场脚本 26 | - 其他 27 | -------------------------------------------------------------------------------- /SCRIPT/auto_add_energy.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | import os 5 | 6 | if __name__ == '__main__': 7 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_demo.settings") # 这里需要注意:1.MODULE; 2.django-project.settings 8 | import django 9 | django.setup() 10 | from delicious_hometown import models 11 | 12 | while 1: 13 | import time 14 | # time.sleep(216) 15 | time.sleep(60) 16 | user_obj = models.User.objects.filter(pk=1).first() 17 | energy = user_obj.energy 18 | energy = energy + 1 19 | models.User.objects.filter(pk=user_obj.pk).update(energy=energy) 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SCRIPT/auto_choice_market.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | # 每天0点运行一次该脚本 3 | 4 | 5 | # Create your tests here. 6 | import os 7 | import random 8 | if __name__ == '__main__': 9 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_demo.settings") # 这里需要注意:1.MODULE; 2.django-project.settings 10 | import django 11 | django.setup() 12 | from delicious_hometown import models 13 | 14 | models.ChoiceMarket.objects.filter(test=1).all().delete() 15 | 16 | choice_list = random.sample([i.pk for i in models.FoodMaterial.objects.all()], 3) 17 | for choice in choice_list: 18 | models.ChoiceMarket(test=1, market_material_id=choice).save() 19 | 20 | -------------------------------------------------------------------------------- /delicious_hometown/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /delicious_hometown/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DeliciousHometownConfig(AppConfig): 5 | name = 'delicious_hometown' 6 | -------------------------------------------------------------------------------- /delicious_hometown/auto_add_energy.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | import os 5 | 6 | if __name__ == '__main__': 7 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_demo.settings") # 这里需要注意:1.MODULE; 2.django-project.settings 8 | import django 9 | django.setup() 10 | from delicious_hometown import models 11 | 12 | while 1: 13 | import time 14 | # time.sleep(216) 15 | time.sleep(60) 16 | user_obj = models.User.objects.filter(pk=1).first() 17 | energy = user_obj.energy 18 | energy = energy + 1 19 | models.User.objects.filter(pk=user_obj.pk).update(energy=energy) 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /delicious_hometown/auto_choice_market.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | # 每天0点运行一次该脚本 3 | 4 | 5 | # Create your tests here. 6 | import os 7 | import random 8 | if __name__ == '__main__': 9 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_demo.settings") # 这里需要注意:1.MODULE; 2.django-project.settings 10 | import django 11 | django.setup() 12 | from delicious_hometown import models 13 | 14 | models.ChoiceMarket.objects.filter(test=1).all().delete() 15 | 16 | choice_list = random.sample([i.pk for i in models.FoodMaterial.objects.all()], 3) 17 | for choice in choice_list: 18 | models.ChoiceMarket(test=1, market_material_id=choice).save() 19 | 20 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-06 16:57 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | initial = True 12 | 13 | dependencies = [ 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='FoodMaterial', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('food_material', models.CharField(max_length=12)), 22 | ], 23 | options={ 24 | 'db_table': 'FoodMaterial', 25 | }, 26 | ), 27 | migrations.CreateModel( 28 | name='FoodMaterialLevel', 29 | fields=[ 30 | ('id', models.AutoField(primary_key=True, serialize=False)), 31 | ('name', models.CharField(max_length=12)), 32 | ], 33 | options={ 34 | 'db_table': 'FoodMaterialLevel', 35 | }, 36 | ), 37 | migrations.AddField( 38 | model_name='foodmaterial', 39 | name='food_material_level', 40 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.FoodMaterialLevel'), 41 | ), 42 | ] 43 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0002_auto_20181007_0100.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-06 17:00 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='foodmaterial', 18 | name='food_material_level', 19 | field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.FoodMaterialLevel'), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0003_auto_20181007_1435.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 06:35 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0002_auto_20181007_0100'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Account', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('username', models.CharField(max_length=12, verbose_name='账户')), 21 | ('password', models.CharField(max_length=12, verbose_name='密码')), 22 | ('email', models.EmailField(max_length=254, null=True, verbose_name='邮箱')), 23 | ('phone', models.CharField(max_length=11, verbose_name='手机号')), 24 | ], 25 | ), 26 | migrations.CreateModel( 27 | name='User', 28 | fields=[ 29 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 30 | ('name', models.CharField(max_length=12, verbose_name='用户名')), 31 | ('energy', models.IntegerField(verbose_name='体力')), 32 | ('level', models.IntegerField(verbose_name='等级')), 33 | ('coin', models.IntegerField(verbose_name='金币')), 34 | ('wing', models.IntegerField(default=0, verbose_name='元宝')), 35 | ('street', models.IntegerField(choices=[(1, '湖南街'), (2, '广东街'), (3, '四川街'), (4, '福建街'), (5, '山东街'), (6, '浙江街'), (7, '江苏街'), (8, '综合一街'), (9, '综合二街')], null=True, verbose_name='街道')), 36 | ], 37 | ), 38 | migrations.AlterField( 39 | model_name='foodmateriallevel', 40 | name='name', 41 | field=models.CharField(max_length=12, verbose_name='食材等级'), 42 | ), 43 | migrations.AddField( 44 | model_name='account', 45 | name='user_id', 46 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.User'), 47 | ), 48 | ] 49 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0004_auto_20181007_1436.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 06:36 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0003_auto_20181007_1435'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelTable( 16 | name='account', 17 | table='Account', 18 | ), 19 | migrations.AlterModelTable( 20 | name='user', 21 | table='User', 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0005_auto_20181007_1529.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 07:29 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0004_auto_20181007_1436'), 13 | ] 14 | 15 | operations = [ 16 | migrations.RemoveField( 17 | model_name='account', 18 | name='user_id', 19 | ), 20 | migrations.AddField( 21 | model_name='user', 22 | name='account_id', 23 | field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.Account'), 24 | preserve_default=False, 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0006_auto_20181007_1530.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 07:30 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0005_auto_20181007_1529'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='account', 17 | name='phone', 18 | field=models.CharField(max_length=11, null=True, verbose_name='手机号'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0007_ambry.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 07:49 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0006_auto_20181007_1530'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Ambry', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('food_material_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.FoodMaterial')), 21 | ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.User')), 22 | ], 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0008_auto_20181007_1550.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 07:50 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0007_ambry'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelTable( 16 | name='ambry', 17 | table='Ambry', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0009_auto_20181007_1752.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 09:52 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0008_auto_20181007_1550'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='ambry', 17 | old_name='food_material_id', 18 | new_name='food_material', 19 | ), 20 | migrations.RenameField( 21 | model_name='ambry', 22 | old_name='user_id', 23 | new_name='user', 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0010_auto_20181008_0018.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-07 16:18 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0009_auto_20181007_1752'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='user', 17 | old_name='account_id', 18 | new_name='account', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0011_auto_20181008_1058.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-08 02:58 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0010_auto_20181008_0018'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Prop', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('name', models.CharField(max_length=16, verbose_name='道具名称')), 21 | ('introdutions', models.CharField(max_length=128, verbose_name='道具介绍')), 22 | ], 23 | options={ 24 | 'db_table': 'Prop', 25 | }, 26 | ), 27 | migrations.CreateModel( 28 | name='PropLevel', 29 | fields=[ 30 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 31 | ('name', models.CharField(max_length=16, verbose_name='道具类别')), 32 | ], 33 | options={ 34 | 'db_table': 'PropLevel', 35 | }, 36 | ), 37 | migrations.AddField( 38 | model_name='prop', 39 | name='prop_level', 40 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.PropLevel'), 41 | ), 42 | ] 43 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0012_auto_20181008_1652.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-08 08:52 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0011_auto_20181008_1058'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='prop', 17 | name='price', 18 | field=models.IntegerField(default=2, verbose_name='价格'), 19 | preserve_default=False, 20 | ), 21 | migrations.AddField( 22 | model_name='prop', 23 | name='price_class', 24 | field=models.IntegerField(choices=[(1, '金币'), (2, '元宝')], default=2, verbose_name='需要的货币'), 25 | preserve_default=False, 26 | ), 27 | migrations.AlterField( 28 | model_name='user', 29 | name='coin', 30 | field=models.IntegerField(default=0, verbose_name='金币'), 31 | ), 32 | ] 33 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0013_backpack.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-08 11:26 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0012_auto_20181008_1652'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Backpack', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('backpack_prop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.Prop')), 21 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.User')), 22 | ], 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0014_auto_20181008_1927.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-08 11:27 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0013_backpack'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelTable( 16 | name='backpack', 17 | table='Backpack', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0015_recipeclass_recipelevel_restaurant_restaurantrecipe.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-10 03:12 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0014_auto_20181008_1927'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='RecipeClass', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('name', models.CharField(max_length=16)), 21 | ], 22 | options={ 23 | 'db_table': 'RecipeClass', 24 | }, 25 | ), 26 | migrations.CreateModel( 27 | name='RecipeLevel', 28 | fields=[ 29 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 30 | ('level', models.IntegerField(choices=[(1, '普通'), (2, '上品'), (3, '极品'), (4, '银牌'), (5, '金牌')], verbose_name='菜谱等级')), 31 | ('price', models.IntegerField(verbose_name='售价')), 32 | ('oil_used', models.IntegerField(verbose_name='耗油量')), 33 | ('experience', models.IntegerField(verbose_name='获得经验')), 34 | ('recipe_class', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.RecipeClass', verbose_name='菜系')), 35 | ], 36 | options={ 37 | 'db_table': 'RecipeLevel', 38 | }, 39 | ), 40 | migrations.CreateModel( 41 | name='Restaurant', 42 | fields=[ 43 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 44 | ('name', models.CharField(max_length=16, verbose_name='菜谱名称')), 45 | ('introduce', models.CharField(max_length=1024, verbose_name='详细做法')), 46 | ], 47 | options={ 48 | 'db_table': 'Reataurant', 49 | }, 50 | ), 51 | migrations.CreateModel( 52 | name='RestaurantRecipe', 53 | fields=[ 54 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 55 | ('recipe_level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.RecipeLevel')), 56 | ('restaurant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.Restaurant')), 57 | ], 58 | ), 59 | ] 60 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0016_auto_20181010_1113.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-10 03:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0015_recipeclass_recipelevel_restaurant_restaurantrecipe'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='restaurant', 17 | name='introduce', 18 | field=models.CharField(max_length=1024, null=True, verbose_name='详细做法'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0017_auto_20181010_1144.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-10 03:44 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0016_auto_20181010_1113'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='RecipeName', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('name', models.CharField(max_length=16, verbose_name='菜谱名称')), 21 | ('introduce', models.CharField(max_length=1024, null=True, verbose_name='详细做法')), 22 | ], 23 | options={ 24 | 'db_table': 'RecipeName', 25 | }, 26 | ), 27 | migrations.RemoveField( 28 | model_name='recipelevel', 29 | name='recipe_class', 30 | ), 31 | migrations.RemoveField( 32 | model_name='restaurantrecipe', 33 | name='restaurant', 34 | ), 35 | migrations.AddField( 36 | model_name='restaurantrecipe', 37 | name='User', 38 | field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.User'), 39 | preserve_default=False, 40 | ), 41 | migrations.AlterField( 42 | model_name='recipeclass', 43 | name='name', 44 | field=models.CharField(max_length=16, verbose_name='菜系名称'), 45 | ), 46 | migrations.DeleteModel( 47 | name='Restaurant', 48 | ), 49 | migrations.AddField( 50 | model_name='recipename', 51 | name='recipe_class', 52 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.RecipeClass', verbose_name='菜系'), 53 | ), 54 | migrations.AddField( 55 | model_name='recipelevel', 56 | name='recipe_name', 57 | field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.RecipeName'), 58 | preserve_default=False, 59 | ), 60 | ] 61 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0018_auto_20181010_1147.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-10 03:47 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0017_auto_20181010_1144'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameModel( 16 | old_name='RestaurantRecipe', 17 | new_name='UserRecipe', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0019_recipematerial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-10 05:37 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0018_auto_20181010_1147'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='RecipeMaterial', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('level', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.RecipeLevel')), 21 | ('material', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.FoodMaterial')), 22 | ], 23 | options={ 24 | 'db_table': 'RecipeMaterial', 25 | }, 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0020_recipestudy.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-11 02:53 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0019_recipematerial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='RecipeStudy', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.RecipeLevel')), 21 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.User')), 22 | ], 23 | options={ 24 | 'db_table': 'RecipeStudy', 25 | }, 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0021_auto_20181012_1127.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-12 03:27 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0020_recipestudy'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='userrecipe', 17 | old_name='User', 18 | new_name='user', 19 | ), 20 | migrations.AlterModelTable( 21 | name='userrecipe', 22 | table='UserRecipe', 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0022_auto_20181012_1135.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-12 03:35 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0021_auto_20181012_1127'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='recipestudy', 17 | name='study', 18 | ), 19 | migrations.RemoveField( 20 | model_name='recipestudy', 21 | name='user', 22 | ), 23 | migrations.DeleteModel( 24 | name='RecipeStudy', 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0023_choice_market.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-12 08:26 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0022_auto_20181012_1135'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='choice_market', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('market_material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.FoodMaterial')), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0024_auto_20181012_1627.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-12 08:27 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0023_choice_market'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameModel( 16 | old_name='choice_market', 17 | new_name='ChoiceMarket', 18 | ), 19 | migrations.AlterModelTable( 20 | name='choicemarket', 21 | table='ChoiceMarket', 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0025_choicemarket_test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-12 08:28 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('delicious_hometown', '0024_auto_20181012_1627'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='choicemarket', 17 | name='test', 18 | field=models.IntegerField(default=1), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/0026_foodmateriallevelprice.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.11 on 2018-10-12 08:55 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('delicious_hometown', '0025_choicemarket_test'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='FoodMaterialLevelPrice', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('price', models.IntegerField()), 21 | ('food_material_level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='delicious_hometown.FoodMaterialLevel')), 22 | ], 23 | options={ 24 | 'db_table': 'FoodMaterialLevelPrice', 25 | }, 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0002_auto_20181007_0100.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0002_auto_20181007_0100.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0003_auto_20181007_1435.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0003_auto_20181007_1435.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0004_auto_20181007_1436.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0004_auto_20181007_1436.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0005_auto_20181007_1529.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0005_auto_20181007_1529.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0006_auto_20181007_1530.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0006_auto_20181007_1530.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0007_ambry.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0007_ambry.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0008_auto_20181007_1550.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0008_auto_20181007_1550.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0009_auto_20181007_1752.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0009_auto_20181007_1752.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0010_auto_20181008_0018.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0010_auto_20181008_0018.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0011_auto_20181008_1058.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0011_auto_20181008_1058.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0012_auto_20181008_1652.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0012_auto_20181008_1652.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0013_backpack.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0013_backpack.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0014_auto_20181008_1927.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0014_auto_20181008_1927.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0015_recipeclass_recipelevel_restaurant_restaurantrecipe.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0015_recipeclass_recipelevel_restaurant_restaurantrecipe.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0016_auto_20181010_1113.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0016_auto_20181010_1113.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0017_auto_20181010_1144.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0017_auto_20181010_1144.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0018_auto_20181010_1147.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0018_auto_20181010_1147.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0019_recipematerial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0019_recipematerial.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0020_recipestudy.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0020_recipestudy.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0021_auto_20181012_1127.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0021_auto_20181012_1127.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0022_auto_20181012_1135.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0022_auto_20181012_1135.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0023_choice_market.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0023_choice_market.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0024_auto_20181012_1627.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0024_auto_20181012_1627.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0025_choicemarket_test.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0025_choicemarket_test.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/0026_foodmateriallevelprice.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/0026_foodmateriallevelprice.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /delicious_hometown/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | 5 | # 食材等级表 6 | class FoodMaterialLevel(models.Model): 7 | id = models.AutoField(primary_key=True) 8 | name = models.CharField(verbose_name='食材等级', max_length=12) 9 | class Meta: 10 | db_table = 'FoodMaterialLevel' 11 | 12 | # 食材表 13 | class FoodMaterial(models.Model): 14 | food_material = models.CharField(max_length=12) 15 | food_material_level = models.ForeignKey(FoodMaterialLevel, null=True) 16 | class Meta: 17 | db_table = 'FoodMaterial' 18 | 19 | # 账户表 20 | class Account(models.Model): 21 | username = models.CharField(verbose_name='账户', max_length=12) 22 | password = models.CharField(verbose_name='密码', max_length=12) 23 | email = models.EmailField(verbose_name='邮箱', null=True) 24 | phone = models.CharField(verbose_name='手机号', max_length=11, null=True) 25 | 26 | class Meta: 27 | db_table = 'Account' 28 | 29 | # 玩家表 30 | class User(models.Model): 31 | name = models.CharField(verbose_name='用户名', max_length=12) 32 | energy = models.IntegerField(verbose_name='体力', ) 33 | level = models.IntegerField(verbose_name='等级', ) 34 | coin = models.IntegerField(verbose_name='金币', default=0) 35 | wing = models.IntegerField(verbose_name='元宝', default=0) 36 | street_choices = ( 37 | (1, '湖南街'), 38 | (2, '广东街'), 39 | (3, '四川街'), 40 | (4, '福建街'), 41 | (5, '山东街'), 42 | (6, '浙江街'), 43 | (7, '江苏街'), 44 | (8, '安徽街'), 45 | (9, '情侣街'), 46 | ) 47 | street = models.IntegerField(verbose_name='街道', choices=street_choices, null=True) 48 | account = models.ForeignKey(to='Account') 49 | class Meta: 50 | db_table = 'User' 51 | 52 | # 个人橱柜表 53 | class Ambry(models.Model): 54 | user = models.ForeignKey(to='User') 55 | food_material = models.ForeignKey(to='FoodMaterial') 56 | 57 | class Meta: 58 | db_table = 'Ambry' 59 | 60 | # 物品表 61 | class Prop(models.Model): 62 | name = models.CharField(verbose_name='道具名称', max_length=16) 63 | introdutions = models.CharField(verbose_name='道具介绍', max_length=128) 64 | price = models.IntegerField(verbose_name='价格') 65 | price_choices = ( 66 | (1, '金币'), 67 | (2, '元宝'), 68 | ) 69 | price_class = models.IntegerField(verbose_name='需要的货币', choices=price_choices) 70 | 71 | prop_level = models.ForeignKey(to='PropLevel') 72 | def __str__(self): 73 | return self.name 74 | class Meta: 75 | db_table = 'Prop' 76 | 77 | # 物品等级表 78 | class PropLevel(models.Model): 79 | name = models.CharField(verbose_name='道具类别', max_length=16) 80 | class Meta: 81 | db_table = 'PropLevel' 82 | 83 | # 个人仓库表 84 | class Backpack(models.Model): 85 | user = models.ForeignKey(to='User') 86 | backpack_prop = models.ForeignKey(to='Prop') 87 | class Meta: 88 | db_table = 'Backpack' 89 | 90 | # 个人菜谱表(多对多) 91 | class UserRecipe(models.Model): 92 | user = models.ForeignKey(to='User') 93 | recipe_level = models.ForeignKey(to='RecipeLevel') 94 | class Meta: 95 | db_table = 'UserRecipe' 96 | 97 | # 98 | class RecipeMaterial(models.Model): 99 | level = models.ForeignKey(to='RecipeLevel', null=True) 100 | material = models.ForeignKey(to='FoodMaterial', null=True) 101 | class Meta: 102 | db_table = 'RecipeMaterial' 103 | 104 | # 菜谱等级表 105 | class RecipeLevel(models.Model): 106 | level_choices = ( 107 | (1, '普通'), 108 | (2, '上品'), 109 | (3, '极品'), 110 | (4, '银牌'), 111 | (5, '金牌'), 112 | ) 113 | level = models.IntegerField(verbose_name='菜谱等级', choices=level_choices) 114 | price = models.IntegerField(verbose_name='售价') 115 | oil_used = models.IntegerField(verbose_name='耗油量') 116 | experience = models.IntegerField(verbose_name='获得经验') 117 | recipe_name = models.ForeignKey(to='RecipeName') 118 | 119 | class Meta: 120 | db_table = 'RecipeLevel' 121 | 122 | # 菜谱名称(一对多) 123 | class RecipeName(models.Model): 124 | name = models.CharField(verbose_name='菜谱名称', max_length=16) 125 | introduce = models.CharField(verbose_name='详细做法', max_length=1024, null=True) 126 | recipe_class = models.ForeignKey(verbose_name='菜系', to='RecipeClass') 127 | class Meta: 128 | db_table = 'RecipeName' 129 | 130 | # 菜系表(一对多) 131 | class RecipeClass(models.Model): 132 | name = models.CharField(verbose_name='菜系名称', max_length=16) 133 | class Meta: 134 | db_table = 'RecipeClass' 135 | 136 | ''' 137 | class RecipeStudy(models.Model): 138 | user = models.ForeignKey(to='User') 139 | study = models.ForeignKey(to='RecipeLevel') 140 | 141 | class Meta: 142 | db_table = 'RecipeStudy' 143 | ''' 144 | 145 | class ChoiceMarket(models.Model): 146 | test = models.IntegerField(default=1) 147 | market_material = models.ForeignKey(to='FoodMaterial') 148 | class Meta: 149 | db_table = 'ChoiceMarket' 150 | 151 | class FoodMaterialLevelPrice(models.Model): 152 | price = models.IntegerField() 153 | food_material_level = models.ForeignKey(to='FoodMaterialLevel') 154 | 155 | class Meta: 156 | db_table = 'FoodMaterialLevelPrice' 157 | -------------------------------------------------------------------------------- /delicious_hometown/static/logo_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/static/logo_1.gif -------------------------------------------------------------------------------- /delicious_hometown/static/logo_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/static/logo_2.png -------------------------------------------------------------------------------- /delicious_hometown/static/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/delicious_hometown/static/test1.jpg -------------------------------------------------------------------------------- /delicious_hometown/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | import os 5 | import random 6 | if __name__ == '__main__': 7 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_demo.settings") # 这里需要注意:1.MODULE; 2.django-project.settings 8 | import django 9 | django.setup() 10 | from delicious_hometown import models 11 | 12 | a = 'adfs' 13 | 14 | if int(a): 15 | print('123') 16 | else: 17 | print('243') 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_demo.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError: 10 | # The above import may fail for some other reason. Ensure that the 11 | # issue is really that Django is missing to avoid masking other 12 | # exceptions on Python 2. 13 | try: 14 | import django 15 | except ImportError: 16 | raise ImportError( 17 | "Couldn't import Django. Are you sure it's installed and " 18 | "available on your PYTHONPATH environment variable? Did you " 19 | "forget to activate a virtual environment?" 20 | ) 21 | raise 22 | execute_from_command_line(sys.argv) 23 | -------------------------------------------------------------------------------- /recipe_all.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/recipe_all.xls -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /static/css/base.css: -------------------------------------------------------------------------------- 1 | 2 | /* 页面基础css样式 */ 3 | /* */ 4 | /* */ 5 | /* */ 6 | /* */ 7 | 8 | /* 全局 */ 9 | * { 10 | font-size: 18px; 11 | } 12 | 13 | a { 14 | text-decoration: none; 15 | color: #0051A4; 16 | } 17 | 18 | .row { 19 | line-height: 30px; 20 | } 21 | 22 | /* 导航条 */ 23 | .bar { 24 | width: 100%; 25 | height: 35px; 26 | position: relative; 27 | z-index: 0; 28 | } 29 | 30 | .bar img { 31 | position: absolute; 32 | top: 0; 33 | left: 0; 34 | width: 100%; 35 | height: 35px; 36 | z-index: 1; 37 | 38 | } 39 | 40 | .bar div { 41 | position: absolute; 42 | top: 4px; 43 | left: 5px; 44 | width: 100%; 45 | height: 35px; 46 | z-index: 2; 47 | 48 | } 49 | 50 | .bar div a { 51 | color: black; 52 | } 53 | 54 | 55 | /* 按钮下的文字 */ 56 | .span_bottom { 57 | position: relative; 58 | top:-6px; 59 | } 60 | .span_bottom a { 61 | font-size: 14px; 62 | } -------------------------------------------------------------------------------- /static/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in iOS. 9 | */ 10 | 11 | html { 12 | line-height: 1.15; /* 1 */ 13 | -webkit-text-size-adjust: 100%; /* 2 */ 14 | } 15 | 16 | /* Sections 17 | ========================================================================== */ 18 | 19 | /** 20 | * Remove the margin in all browsers. 21 | */ 22 | 23 | body { 24 | margin: 0; 25 | } 26 | 27 | /** 28 | * Correct the font size and margin on `h1` elements within `section` and 29 | * `article` contexts in Chrome, Firefox, and Safari. 30 | */ 31 | 32 | h1 { 33 | font-size: 2em; 34 | margin: 0.67em 0; 35 | } 36 | 37 | /* Grouping content 38 | ========================================================================== */ 39 | 40 | /** 41 | * 1. Add the correct box sizing in Firefox. 42 | * 2. Show the overflow in Edge and IE. 43 | */ 44 | 45 | hr { 46 | box-sizing: content-box; /* 1 */ 47 | height: 0; /* 1 */ 48 | overflow: visible; /* 2 */ 49 | } 50 | 51 | /** 52 | * 1. Correct the inheritance and scaling of font size in all browsers. 53 | * 2. Correct the odd `em` font sizing in all browsers. 54 | */ 55 | 56 | pre { 57 | font-family: monospace, monospace; /* 1 */ 58 | font-size: 1em; /* 2 */ 59 | } 60 | 61 | /* Text-level semantics 62 | ========================================================================== */ 63 | 64 | /** 65 | * Remove the gray background on active links in IE 10. 66 | */ 67 | 68 | a { 69 | background-color: transparent; 70 | } 71 | 72 | /** 73 | * 1. Remove the bottom border in Chrome 57- 74 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 75 | */ 76 | 77 | abbr[title] { 78 | border-bottom: none; /* 1 */ 79 | text-decoration: underline; /* 2 */ 80 | text-decoration: underline dotted; /* 2 */ 81 | } 82 | 83 | /** 84 | * Add the correct font weight in Chrome, Edge, and Safari. 85 | */ 86 | 87 | b, 88 | strong { 89 | font-weight: bolder; 90 | } 91 | 92 | /** 93 | * 1. Correct the inheritance and scaling of font size in all browsers. 94 | * 2. Correct the odd `em` font sizing in all browsers. 95 | */ 96 | 97 | code, 98 | kbd, 99 | samp { 100 | font-family: monospace, monospace; /* 1 */ 101 | font-size: 1em; /* 2 */ 102 | } 103 | 104 | /** 105 | * Add the correct font size in all browsers. 106 | */ 107 | 108 | small { 109 | font-size: 80%; 110 | } 111 | 112 | /** 113 | * Prevent `sub` and `sup` elements from affecting the line height in 114 | * all browsers. 115 | */ 116 | 117 | sub, 118 | sup { 119 | font-size: 75%; 120 | line-height: 0; 121 | position: relative; 122 | vertical-align: baseline; 123 | } 124 | 125 | sub { 126 | bottom: -0.25em; 127 | } 128 | 129 | sup { 130 | top: -0.5em; 131 | } 132 | 133 | /* Embedded content 134 | ========================================================================== */ 135 | 136 | /** 137 | * Remove the border on images inside links in IE 10. 138 | */ 139 | 140 | img { 141 | border-style: none; 142 | } 143 | 144 | /* Forms 145 | ========================================================================== */ 146 | 147 | /** 148 | * 1. Change the font styles in all browsers. 149 | * 2. Remove the margin in Firefox and Safari. 150 | */ 151 | 152 | button, 153 | input, 154 | optgroup, 155 | select, 156 | textarea { 157 | font-family: inherit; /* 1 */ 158 | font-size: 100%; /* 1 */ 159 | line-height: 1.15; /* 1 */ 160 | margin: 0; /* 2 */ 161 | } 162 | 163 | /** 164 | * Show the overflow in IE. 165 | * 1. Show the overflow in Edge. 166 | */ 167 | 168 | button, 169 | input { /* 1 */ 170 | overflow: visible; 171 | } 172 | 173 | /** 174 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 175 | * 1. Remove the inheritance of text transform in Firefox. 176 | */ 177 | 178 | button, 179 | select { /* 1 */ 180 | text-transform: none; 181 | } 182 | 183 | /** 184 | * Correct the inability to style clickable types in iOS and Safari. 185 | */ 186 | 187 | button, 188 | [type="button"], 189 | [type="reset"], 190 | [type="submit"] { 191 | -webkit-appearance: button; 192 | } 193 | 194 | /** 195 | * Remove the inner border and padding in Firefox. 196 | */ 197 | 198 | button::-moz-focus-inner, 199 | [type="button"]::-moz-focus-inner, 200 | [type="reset"]::-moz-focus-inner, 201 | [type="submit"]::-moz-focus-inner { 202 | border-style: none; 203 | padding: 0; 204 | } 205 | 206 | /** 207 | * Restore the focus styles unset by the previous rule. 208 | */ 209 | 210 | button:-moz-focusring, 211 | [type="button"]:-moz-focusring, 212 | [type="reset"]:-moz-focusring, 213 | [type="submit"]:-moz-focusring { 214 | outline: 1px dotted ButtonText; 215 | } 216 | 217 | /** 218 | * Correct the padding in Firefox. 219 | */ 220 | 221 | fieldset { 222 | padding: 0.35em 0.75em 0.625em; 223 | } 224 | 225 | /** 226 | * 1. Correct the text wrapping in Edge and IE. 227 | * 2. Correct the color inheritance from `fieldset` elements in IE. 228 | * 3. Remove the padding so developers are not caught out when they zero out 229 | * `fieldset` elements in all browsers. 230 | */ 231 | 232 | legend { 233 | box-sizing: border-box; /* 1 */ 234 | color: inherit; /* 2 */ 235 | display: table; /* 1 */ 236 | max-width: 100%; /* 1 */ 237 | padding: 0; /* 3 */ 238 | white-space: normal; /* 1 */ 239 | } 240 | 241 | /** 242 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 243 | */ 244 | 245 | progress { 246 | vertical-align: baseline; 247 | } 248 | 249 | /** 250 | * Remove the default vertical scrollbar in IE 10+. 251 | */ 252 | 253 | textarea { 254 | overflow: auto; 255 | } 256 | 257 | /** 258 | * 1. Add the correct box sizing in IE 10. 259 | * 2. Remove the padding in IE 10. 260 | */ 261 | 262 | [type="checkbox"], 263 | [type="radio"] { 264 | box-sizing: border-box; /* 1 */ 265 | padding: 0; /* 2 */ 266 | } 267 | 268 | /** 269 | * Correct the cursor style of increment and decrement buttons in Chrome. 270 | */ 271 | 272 | [type="number"]::-webkit-inner-spin-button, 273 | [type="number"]::-webkit-outer-spin-button { 274 | height: auto; 275 | } 276 | 277 | /** 278 | * 1. Correct the odd appearance in Chrome and Safari. 279 | * 2. Correct the outline style in Safari. 280 | */ 281 | 282 | [type="search"] { 283 | -webkit-appearance: textfield; /* 1 */ 284 | outline-offset: -2px; /* 2 */ 285 | } 286 | 287 | /** 288 | * Remove the inner padding in Chrome and Safari on macOS. 289 | */ 290 | 291 | [type="search"]::-webkit-search-decoration { 292 | -webkit-appearance: none; 293 | } 294 | 295 | /** 296 | * 1. Correct the inability to style clickable types in iOS and Safari. 297 | * 2. Change font properties to `inherit` in Safari. 298 | */ 299 | 300 | ::-webkit-file-upload-button { 301 | -webkit-appearance: button; /* 1 */ 302 | font: inherit; /* 2 */ 303 | } 304 | 305 | /* Interactive 306 | ========================================================================== */ 307 | 308 | /* 309 | * Add the correct display in Edge, IE 10+, and Firefox. 310 | */ 311 | 312 | details { 313 | display: block; 314 | } 315 | 316 | /* 317 | * Add the correct display in all browsers. 318 | */ 319 | 320 | summary { 321 | display: list-item; 322 | } 323 | 324 | /* Misc 325 | ========================================================================== */ 326 | 327 | /** 328 | * Add the correct display in IE 10+. 329 | */ 330 | 331 | template { 332 | display: none; 333 | } 334 | 335 | /** 336 | * Add the correct display in IE 10. 337 | */ 338 | 339 | [hidden] { 340 | display: none; 341 | } -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-brands-400.eot -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-brands-400.woff -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-regular-400.eot -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-regular-400.woff -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-solid-900.eot -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /static/fontawesome/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/fontawesome/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /static/image/logo_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/image/logo_1.gif -------------------------------------------------------------------------------- /static/image/logo_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/image/logo_2.png -------------------------------------------------------------------------------- /static/image/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/static/image/test1.jpg -------------------------------------------------------------------------------- /static/js/popper.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) Federico Zivolo 2017 3 | Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4 | */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:window.document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var l=a.commonAncestorContainer;if(e!==l&&t!==l||i.contains(n))return p(l)?l:r(l);var f=s(e);return f.host?d(f.host,t):d(e,s(t).host)}function a(e){var t=1=o.clientWidth&&i>=o.clientHeight}),l=0i[e]&&!t.escapeWithReference&&(n=V(p[o],i[e]-('right'===e?p.width:p.height))),se({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=de({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=_,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var n=e.placement.split('-')[0],r=e.offsets,p=r.popper,s=r.reference,d=-1!==['left','right'].indexOf(n),a=d?'height':'width',l=d?'Top':'Left',f=l.toLowerCase(),m=d?'left':'top',c=d?'bottom':'right',g=O(i)[a];s[c]-gp[c]&&(e.offsets.popper[f]+=s[f]+g-p[c]);var u=s[f]+s[a]/2-g/2,b=t(e.instance.popper,'margin'+l).replace('px',''),y=u-h(e.offsets.popper)[f]-b;return y=X(V(p[a]-g,y),0),e.arrowElement=i,e.offsets.arrow={},e.offsets.arrow[f]=Math.round(y),e.offsets.arrow[m]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=L(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case fe.FLIP:p=[i,n];break;case fe.CLOCKWISE:p=K(i);break;case fe.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=L(i);var a=e.offsets.popper,l=e.offsets.reference,f=_,m='left'===i&&f(a.right)>f(l.left)||'right'===i&&f(a.left)f(l.top)||'bottom'===i&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===i&&c||'right'===i&&h||'top'===i&&g||'bottom'===i&&u,y=-1!==['top','bottom'].indexOf(i),w=!!t.flipVariations&&(y&&'start'===r&&c||y&&'end'===r&&h||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),w&&(r=j(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=de({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=N(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[o]-(s?n[p?'width':'height']:0),e.placement=L(t),e.offsets.popper=h(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right 2 | 3 | 4 | 5 | 小镇橱柜 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 |
24 | 容量:{{ foodmaterial_count }}/200.扩容
25 | 保险锁:20/20.增加 26 |
27 | 28 | 29 | 35 | 36 | 37 | {% if level == '2' %} 38 |
39 | {% for k, v in food_material_level_2.items %} 40 |
41 | 42 |
43 | 加锁 44 | 合成 45 |
46 |
47 | {% endfor %} 48 |
49 | {% elif level == '3' %} 50 |
51 | {% for k, v in food_material_level_3.items %} 52 |
53 | 54 |
55 | 加锁 56 | 合成 57 |
58 |
59 | {% endfor %} 60 |
61 | {% elif level == '4' %} 62 |
63 | {% for k, v in food_material_level_4.items %} 64 |
65 | 66 |
67 | 加锁 68 | 合成 69 |
70 |
71 | {% endfor %} 72 |
73 | {% elif level == '5' %} 74 |
75 | {% for k, v in food_material_level_5.items %} 76 |
77 | 78 |
79 | 加锁 80 | 合成 81 |
82 |
83 | {% endfor %} 84 |
85 | 86 | {% else %} 87 |
88 | {% for k, v in food_material_level_1.items %} 89 |
90 | 91 |
92 | 加锁 93 | 合成 94 |
95 |
96 | {% endfor %} 97 |
98 | 99 | {% endif %} 100 | 101 | 102 |
103 | 橱柜仓库菜谱| 104 | 餐厅菜场商城
105 | 106 | 消息神殿酒吧| 107 | 街坊排行充值
108 | 109 | 食材菜谱圣地| 110 | 首页礼包注销
111 |
112 | 113 |
114 | 130 | 131 | -------------------------------------------------------------------------------- /templates/backpack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇仓库 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 | 28 | 29 | 30 | {% if level == '2' %} 31 |
32 | {% for k, v in prop_dic_2.items %} 33 |
34 | 35 |
36 | 使用 37 | 查看 38 | 出售 39 |
40 |
41 | {% endfor %} 42 |
43 | {% elif level == '3' %} 44 |
45 | {% for k, v in prop_dic_3.items %} 46 |
47 | 48 |
49 | 使用 50 | 查看 51 | 出售 52 |
53 |
54 | {% endfor %} 55 |
56 | {% elif level == '4' %} 57 |
58 | {% for k, v in prop_dic_4.items %} 59 |
60 | 61 |
62 | 使用 63 | 查看 64 | 出售 65 |
66 |
67 | {% endfor %} 68 |
69 | {% elif level == '5' %} 70 |
71 | {% for k, v in prop_dic_5.items %} 72 |
73 | 74 |
75 | 使用 76 | 查看 77 | 出售 78 |
79 |
80 | {% endfor %} 81 |
82 | 83 | {% elif level == '6' %} 84 |
85 | {% for k, v in prop_dic_6.items %} 86 |
87 | 88 |
89 | 使用 90 | 查看 91 | 出售 92 |
93 |
94 | {% endfor %} 95 |
96 | 97 | {% elif level == '7' %} 98 |
99 | {% for k, v in prop_dic_7.items %} 100 |
101 | 102 |
103 | 使用 104 | 查看 105 | 出售 106 |
107 |
108 | {% endfor %} 109 |
110 | 111 | {% elif level == '8' %} 112 |
113 | {% for k, v in prop_dic_8.items %} 114 |
115 | 116 |
117 | 使用 118 | 查看 119 | 出售 120 |
121 |
122 | {% endfor %} 123 |
124 | 125 | {% else %} 126 |
127 | {% for k, v in prop_dic_1.items %} 128 |
129 | 130 |
131 | 使用 132 | 查看 133 | 出售 134 |
135 |
136 | {% endfor %} 137 |
138 | 139 | {% endif %} 140 | 141 | 142 |
143 | 橱柜仓库菜谱| 144 | 餐厅菜场商城
145 | 146 | 消息神殿酒吧| 147 | 街坊排行充值
148 | 149 | 食材菜谱圣地| 150 | 首页礼包注销
151 |
152 | 153 |
154 | 155 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /templates/buy_money.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇充值中心 6 | 7 | 8 | 9 | 10 | 58 | 59 | 60 |
61 | 62 | 63 |
64 | 65 | 66 |
67 | 68 | 69 |
70 | 用户:{{ user_obj.name }}
71 | 金币:{{ user_obj.coin }}     72 | 元宝:{{ user_obj.wing }} 73 |
74 | 75 | 76 |
77 |
78 | 元宝 ×600
79 | 购买可获得600元宝
80 | RMB ¥ 6 81 |
82 |
83 | 元宝 ×2500
84 | 购买可获得2500元宝
85 | RMB ¥ 25 86 |
87 |
88 | 元宝 ×5000
89 | 购买可获得5000元宝
90 | RMB ¥ 50 91 |
92 |
93 | 元宝 ×9800
94 | 购买可获得9800元宝
95 | RMB ¥ 98 96 |
97 |
98 |
99 |
100 | 元宝 ×12800
101 | 购买可获得12800元宝
102 | RMB ¥ 128 103 |
104 |
105 | 元宝 ×19800
106 | 购买可获得19800元宝
107 | RMB ¥ 198 108 |
109 |
110 | 元宝 ×32800
111 | 购买可获得32800元宝
112 | RMB ¥ 328 113 |
114 |
115 | 元宝 ×64800
116 | 购买可获得64800元宝
117 | RMB ¥ 648 118 |
119 |
120 | 121 | 122 |
123 |
124 | 金币 ×6w
125 | 购买可获得6万金币
126 | RMB ¥ 6 127 |
128 |
129 | 金币 ×25w
130 | 购买可获得25万金币
131 | RMB ¥ 25 132 |
133 |
134 | 金币 ×50w
135 | 购买可获得50万金币
136 | RMB ¥ 50 137 |
138 |
139 | 金币 ×98w
140 | 购买可获得98万金币
141 | RMB ¥ 98 142 |
143 |
144 |
145 |
146 | 金币 ×128w
147 | 购买可获得128万金币
148 | RMB ¥ 128 149 |
150 |
151 | 金币 ×198w
152 | 购买可获得198万金币
153 | RMB ¥ 198 154 |
155 |
156 | 金币 ×328w
157 | 购买可获得328万金币
158 | RMB ¥ 328 159 |
160 |
161 | 金币 ×648w
162 | 购买可获得648万金币
163 | RMB ¥ 648 164 |
165 |
166 | 167 |

168 |
169 | 橱柜仓库菜谱| 170 | 餐厅菜场商城
171 | 172 | 消息神殿酒吧| 173 | 街坊排行充值
174 | 175 | 食材菜谱圣地| 176 | 首页礼包注销
177 |
178 | 179 |
180 | 181 | 182 | -------------------------------------------------------------------------------- /templates/foodmaterial.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇食材 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 |

25 | 26 | 27 |
28 | 29 |
30 | 31 |
32 |
33 | 34 | 35 |
36 | 37 | 一级食材:
38 |
39 | {% for obj in food_material %} 40 | {% if obj.food_material_level.id == 1 %} 41 |
42 | 43 |
44 | {% endif %} 45 | {% endfor %} 46 |
47 |
48 | 49 | 二级食材:
50 |
51 | {% for obj in food_material %} 52 | {% if obj.food_material_level.id == 2 %} 53 |
54 | 55 |
56 | {% endif %} 57 | {% endfor %} 58 |
59 |
60 | 61 | 三级食材:
62 |
63 | {% for obj in food_material %} 64 | {% if obj.food_material_level.id == 3 %} 65 |
66 | 67 |
68 | {% endif %} 69 | {% endfor %} 70 |
71 |
72 | 73 | 四级食材:
74 |
75 | {% for obj in food_material %} 76 | {% if obj.food_material_level.id == 4 %} 77 |
78 | 79 |
80 | {% endif %} 81 | {% endfor %} 82 |
83 |
84 | 85 | 五级食材:
86 |
87 | {% for obj in food_material %} 88 | {% if obj.food_material_level.id == 5 %} 89 |
90 | 91 |
92 | {% endif %} 93 | {% endfor %} 94 |
95 | 96 |
97 | 98 |
99 |
100 | 橱柜仓库菜谱| 101 | 餐厅菜场商城
102 | 103 | 消息神殿酒吧| 104 | 街坊排行充值
105 | 106 | 食材菜谱圣地| 107 | 首页礼包注销
108 |
109 | 110 |
111 | 112 | 113 | -------------------------------------------------------------------------------- /templates/friend.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇排行榜/街坊 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | {% for user in user_obj %} 33 | 34 | 35 | 36 | 37 | {% endfor %} 38 | 39 |
id玩家等级
{{ user.id }}{{ user.name }}{{ user.level }}
40 | 41 | 42 |
43 | 橱柜仓库菜谱| 44 | 餐厅菜场商城
45 | 46 | 消息神殿酒吧| 47 | 街坊排行充值
48 | 49 | 食材菜谱圣地| 50 | 首页礼包注销
51 |
52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /templates/gift.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇礼包 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |

20 | 21 | 22 |
23 |

请在下方输入礼包码:

24 |
25 | {% csrf_token %} 26 |
27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 |
37 |
38 | 【温馨提示】
39 | 1.每个兑换码只能使用一次.
40 | 2.每天输入礼包码错误次数达到5次,则当天无法再兑换礼包,需等到次日0点以后才能再次使用该功能.
41 |
42 | 43 | 44 |
45 | 橱柜仓库菜谱| 46 | 餐厅菜场商城
47 | 48 | 消息神殿酒吧| 49 | 街坊排行充值
50 | 51 | 食材菜谱圣地| 52 | 首页礼包注销
53 |
54 | 55 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /templates/home_address.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 收益加成 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |

20 | 21 |
22 | 搬家需要使用一张搬家卡,并且餐厅等级达到1级后就可以搬家了,你想搬到哪一条街上呢?
23 | 新手街
24 | 四川街
25 | 安徽街
26 | 山东街
27 | 福建街
28 | 江苏街
29 | 湖南街
30 | 广东街
31 | 浙江街
32 | 情侣街
33 | 
34 | 返回前页
35 | 
36 | 37 |
38 | 橱柜仓库菜谱| 39 | 餐厅菜场商城
40 | 41 | 消息神殿酒吧| 42 | 街坊排行充值
43 | 44 | 食材菜谱圣地| 45 | 首页礼包注销
46 |
47 |
48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 美味小镇 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 |
22 |
23 | 昵称:{{ user.name }}(ID:{{ user.pk }}).签到
24 | 餐厅信息好友餐厅
25 | 餐厅等级:{{ user.level }}(11109/12437)
26 | 今日活跃点:5.领取
27 | 体力:{{ user.energy }}/100.恢复
28 | 最新收益+40金币 +40经验
29 | 油壶:1084/1100.添加.扩容
30 | 清洁度:300/300.打扫
31 | 金币:{{ user.coin }}
32 | 元宝:{{ user.wing }}.充值
33 | 街道:{% if user.street %}{{ user.get_street_display }}{% else %}新手街{% endif %}.搬家
34 | 金牌菜:未开启
35 | 收益加成.专属设施.荣誉勋章
36 | 设施位:餐厅1星后开启该功能
37 |
38 |
39 | 橱柜仓库菜谱| 40 | 餐厅菜场商城
41 | 42 | 消息神殿酒吧| 43 | 街坊排行充值
44 | 45 | 食材菜谱圣地| 46 | 首页礼包注销
47 |
48 | 49 | 50 |
51 | 52 | -------------------------------------------------------------------------------- /templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇登陆 6 | 7 | 8 | 9 | 10 | 11 | 47 | 48 | 49 | 50 |
51 |
52 |
登陆游戏
53 |
54 |
55 | {% csrf_token %} 56 | 57 | 58 | 59 |
60 | 61 |
62 | 63 |
64 |
65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /templates/market.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇菜场 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |

20 | 21 | 22 |
23 | 今日食材:(每天0点刷新)
24 | {% for choice in choice_list %} 25 | {{ choice.market_material.food_material }} 26 | ({{ choice.market_material.food_material_level.name }}) 27 | 购买
28 | {% endfor %} 29 | 30 | 31 |
32 | 33 |
34 |



35 | 菜场规则:
36 | 1.菜品从一级到五级随机刷新;
37 | 2.菜品的价格为菜品等级平方乘以5000(金币)
38 |
39 | 价格表:
40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
1级食材:5000金币2级食材:20000金币3级食材:45000金币4级食材:80000金币5级食材:125000金币
49 | 50 |
51 | 52 | 53 |
54 | 橱柜仓库菜谱| 55 | 餐厅菜场商城
56 | 57 | 消息神殿酒吧| 58 | 街坊排行充值
59 | 60 | 食材菜谱圣地| 61 | 首页礼包注销
62 |
63 | 64 |
65 | 66 | -------------------------------------------------------------------------------- /templates/my_recipe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 |

21 | 22 | 23 | 29 | 30 | 31 | {% if level == '2' %} 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | {% for study_obj in recipe_class_2 %} 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | {% endfor %} 55 | 56 |
菜名当前品质价格耗油量经验值
47 | {{ study_obj.recipe_name.name }} 48 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
57 | 58 |
59 | {% elif level == '3' %} 60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | {% for study_obj in recipe_class_3 %} 73 | 76 | 77 | 78 | 79 | 80 | 81 | {% endfor %} 82 | 83 |
菜名当前品质价格耗油量经验值
74 | {{ study_obj.recipe_name.name }} 75 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
84 |
85 | {% elif level == '4' %} 86 |
87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | {% for study_obj in recipe_class_4 %} 99 | 100 | 103 | 104 | 105 | 106 | 107 | 108 | {% endfor %} 109 | 110 |
菜名当前品质价格耗油量经验值
101 | {{ study_obj.recipe_name.name }} 102 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
111 |
112 | {% elif level == '5' %} 113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | {% for study_obj in recipe_class_5 %} 126 | 127 | 130 | 131 | 132 | 133 | 134 | 135 | {% endfor %} 136 | 137 |
菜名当前品质价格耗油量经验值
128 | {{ study_obj.recipe_name.name }} 129 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
138 |
139 | {% elif level == '6' %} 140 |
141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | {% for study_obj in recipe_class_6 %} 153 | 154 | 157 | 158 | 159 | 160 | 161 | 162 | {% endfor %} 163 | 164 |
菜名当前品质价格耗油量经验值
155 | {{ study_obj.recipe_name.name }} 156 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
165 |
166 | 167 | {% elif level == '7' %} 168 |
169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | {% for study_obj in recipe_class_7 %} 181 | 182 | 185 | 186 | 187 | 188 | 189 | 190 | {% endfor %} 191 | 192 |
菜名当前品质价格耗油量经验值
183 | {{ study_obj.recipe_name.name }} 184 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
193 |
194 | 195 | {% elif level == '8' %} 196 |
197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | {% for study_obj in recipe_class_8 %} 209 | 210 | 213 | 214 | 215 | 216 | 217 | 218 | {% endfor %} 219 | 220 |
菜名当前品质价格耗油量经验值
211 | {{ study_obj.recipe_name.name }} 212 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
221 |
222 | 223 | {% elif level == '9' %} 224 |
225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | {% for study_obj in recipe_class_9 %} 237 | 238 | 241 | 242 | 243 | 244 | 245 | 246 | {% endfor %} 247 | 248 |
菜名当前品质价格耗油量经验值
239 | {{ study_obj.recipe_name.name }} 240 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
249 |
250 | 251 | {% elif level == '10' %} 252 |
253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | {% for study_obj in recipe_class_10 %} 265 | 266 | 269 | 270 | 271 | 272 | 273 | 274 | {% endfor %} 275 | 276 |
菜名当前品质价格耗油量经验值
267 | {{ study_obj.recipe_name.name }} 268 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
277 |
278 | 279 | {% else %} 280 |
281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | {% for study_obj in recipe_class_1 %} 293 | 294 | 297 | 298 | 299 | 300 | 301 | 302 | {% endfor %} 303 | 304 |
菜名当前品质价格耗油量经验值
295 | {{ study_obj.recipe_name.name }} 296 | {{ study_obj.get_level_display }}{{ study_obj.price }}金币{{ study_obj.oil_used }}ml{{ study_obj.experience }}Exp
305 |
306 | 307 | {% endif %} 308 | 309 | 310 |
311 | 橱柜仓库菜谱| 312 | 餐厅菜场商城
313 | 314 | 消息神殿酒吧| 315 | 街坊排行充值
316 | 317 | 食材菜谱圣地| 318 | 首页礼包注销
319 |
320 |
321 | 322 | 348 | 349 | 350 | 351 | 352 | -------------------------------------------------------------------------------- /templates/recipe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 小镇菜谱 6 | 7 | 8 | 9 | 10 | 11 | 20 | 21 | 22 | 23 |
24 | 25 | 26 |
27 | 28 | 29 |

30 | 31 | 32 | 38 | 39 | 40 | {% if level == '2' %} 41 |
42 | {% for recipe_class in recipe_class_2 %} 43 |
44 | 45 |
46 |
47 | 查看详细页 48 |
49 |
50 |
51 | {% endfor %} 52 |
53 | {% elif level == '3' %} 54 |
55 | {% for recipe_class in recipe_class_3 %} 56 |
57 | 58 |
59 |
60 | 查看详细页 61 | 学习 62 |
63 |
64 |
65 | {% endfor %} 66 |
67 | {% elif level == '4' %} 68 |
69 | {% for recipe_class in recipe_class_4 %} 70 |
71 | 72 |
73 |
74 | 查看详细页 75 |
76 |
77 |
78 | {% endfor %} 79 |
80 | {% elif level == '5' %} 81 |
82 | {% for recipe_class in recipe_class_5 %} 83 |
84 | 85 |
86 |
87 | 查看详细页 88 |
89 |
90 |
91 | {% endfor %} 92 |
93 | {% elif level == '6' %} 94 |
95 | {% for recipe_class in recipe_class_6 %} 96 |
97 | 98 |
99 |
100 | 查看详细页 101 |
102 |
103 |
104 | {% endfor %} 105 |
106 | 107 | {% elif level == '7' %} 108 |
109 | {% for recipe_class in recipe_class_7 %} 110 |
111 | 112 |
113 |
114 | 查看详细页 115 |
116 |
117 |
118 | {% endfor %} 119 |
120 | 121 | {% elif level == '8' %} 122 |
123 | {% for recipe_class in recipe_class_8 %} 124 |
125 | 126 |
127 |
128 | 查看详细页 129 |
130 |
131 |
132 | {% endfor %} 133 |
134 | 135 | {% elif level == '9' %} 136 |
137 | {% for recipe_class in recipe_class_9 %} 138 |
139 | 140 |
141 |
142 | 查看详细页 143 |
144 |
145 |
146 | {% endfor %} 147 |
148 | 149 | {% elif level == '10' %} 150 |
151 | {% for recipe_class in recipe_class_10 %} 152 |
153 | 154 |
155 |
156 | 查看详细页 157 |
158 |
159 |
160 | {% endfor %} 161 |
162 | 163 | {% else %} 164 |
165 | {% for recipe_class in recipe_class_1 %} 166 |
167 | 168 |
169 |
170 | 查看详细页 171 |
172 |
173 |
174 | {% endfor %} 175 |
176 | 177 | {% endif %} 178 | 179 | 180 |
181 |
182 | 橱柜仓库菜谱| 183 | 餐厅菜场商城
184 | 185 | 消息神殿酒吧| 186 | 街坊排行充值
187 | 188 | 食材菜谱圣地| 189 | 首页礼包注销
190 |
191 | 192 |
193 | 194 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /templates/recipe_study.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 升级需要的材料为: 14 | {% if level_id == '1' %} 15 | {% for k, v in material_dic.items %} 16 |
{% for obj in v %} 17 | {% endfor %}
18 | {% endfor %} 19 | 学习 20 | {% elif level_id == '2' %} 21 | {% for k, v in material_dic.items %} 22 |
{% for obj in v %} 23 | {% endfor %}
24 | {% endfor %} 25 | 学习 26 | {% elif level_id == '3' %} 27 | {% for k, v in material_dic.items %} 28 |
{% for obj in v %} 29 | {% endfor %}
30 | {% endfor %} 31 | 学习 32 | {% elif level_id == '4' %} 33 | {% for k, v in material_dic.items %} 34 |
{% for obj in v %} 35 | {% endfor %}
36 | {% endfor %} 37 | 学习 38 | {% elif level_id == '5' %} 39 | {% for k, v in material_dic.items %} 40 |
{% for obj in v %} 41 | {% endfor %}
42 | {% endfor %} 43 | 学习 44 | {% endif %} 45 | 46 | 81 | 82 | -------------------------------------------------------------------------------- /templates/recipe_view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 |
23 | 【{{ recipe_object.name }}】
24 | 菜系:{{ recipe_object.recipe_class.name }}
25 | 当前品质:未学
26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | {% for view_obj in recipe_view_obj %} 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | {% endfor %} 51 |
52 | {% for food_list in recipe_level %} 53 |
55 | {% endfor %} 56 | 57 | 58 | 59 | 60 | 61 |
品质所需材料价格耗油量经验操作
{{ view_obj.get_level_display }}{{ view_obj.price }}金币{{ view_obj.oil_used }}ml{{ view_obj.experience }}Exp学习
62 | 63 | 64 |
65 | 橱柜仓库菜谱| 66 | 餐厅菜场商城
67 | 68 | 消息神殿酒吧| 69 | 街坊排行充值
70 | 71 | 食材菜谱圣地| 72 | 首页礼包注销
73 |
74 | 75 |
76 | 77 | 93 | 94 | -------------------------------------------------------------------------------- /templates/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 | {% csrf_token %} 17 | {% for field in form %} 18 |
19 | 20 | {{ field }} 21 | 28 |
29 | {% endfor %} 30 | 31 | 32 |
33 |
34 |
35 | 36 |
37 | 38 | -------------------------------------------------------------------------------- /templates/shop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 | 29 | 30 | 31 | {% if level == '2' %} 32 |
33 | {% for prop_level in prop_level_2 %} 34 |
35 | 36 | 37 | 41 |
42 | {% endfor %} 43 |
44 | {% elif level == '3' %} 45 |
46 | {% for prop_level in prop_level_3 %} 47 |
48 | 49 | 50 | 54 |
55 | {% endfor %} 56 |
57 | {% elif level == '4' %} 58 |
59 | {% for prop_level in prop_level_4 %} 60 |
61 | 62 | 63 | 67 |
68 | {% endfor %} 69 |
70 | {% elif level == '5' %} 71 |
72 | {% for prop_level in prop_level_5 %} 73 |
74 | 75 | 79 |
80 | {% endfor %} 81 |
82 | 83 | {% else %} 84 |
85 | {% for prop_level in prop_level_1 %} 86 |
87 | 89 | 93 |
94 | {% endfor %} 95 |
96 | 97 | {% endif %} 98 | 99 | 100 |
101 | 橱柜仓库菜谱| 102 | 餐厅菜场商城
103 | 104 | 消息神殿酒吧| 105 | 街坊排行充值
106 | 107 | 食材菜谱圣地| 108 | 首页礼包注销
109 |
110 | 111 |
112 | 113 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /templates/test_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 收益加成 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |

20 | 21 |
22 | 【经验加成】总和:0.0%
23 | 服务员:0.0%
24 | 设施:0.0%
25 | 经理:0.0%
26 | 专属:0.0%
27 | 其他:0.0%
28 | 【金币加成】总和:0.0%
29 | 服务员:0.0%
30 | 设施:0.0%
31 | 经理:0.0%
32 | 专属:0.0%
33 | 其他:0.0%
34 | 返回前页
35 | 
36 | 37 |
38 | 橱柜仓库菜谱| 39 | 餐厅菜场商城
40 | 41 | 消息神殿酒吧| 42 | 街坊排行充值
43 | 44 | 食材菜谱圣地| 45 | 首页礼包注销
46 |
47 |
48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /templates/test_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 专属设施 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |

20 | 21 |
22 | 我的设施:
23 | 暂无
24 | 
25 | 返回前页
26 | 
27 | 28 |
29 | 橱柜仓库菜谱| 30 | 餐厅菜场商城
31 | 32 | 消息神殿酒吧| 33 | 街坊排行充值
34 | 35 | 食材菜谱圣地| 36 | 首页礼包注销
37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /templates/test_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 荣誉勋章 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 |

20 | 21 |
 22 | 目标:川菜大厨 (未完成)
 23 | 条件:学习四川街所有菜式(6/46)
 24 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、川菜大厨勋章*1
 25 | 
 26 | 
 27 | 目标:徽菜大厨 (未完成)
 28 | 条件:学习安徽街所有菜式(0/48)
 29 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、徽菜大厨勋章*1
 30 | 
 31 | 
 32 | 目标:鲁菜大厨 (未完成)
 33 | 条件:学习山东街所有菜式(0/54)
 34 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、鲁菜大厨勋章*1
 35 | 
 36 | 
 37 | 目标:闽菜大厨 (未完成)
 38 | 条件:学习福建街所有菜式(0/48)
 39 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、闽菜大厨勋章*1
 40 | 
 41 | 
 42 | 目标:苏菜大厨 (未完成)
 43 | 条件:学习江苏街所有菜式(0/49)
 44 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、苏菜大厨勋章*1
 45 | 
 46 | 
 47 | 目标:湘菜大厨 (未完成)
 48 | 条件:学习湖南街所有菜式(0/45)
 49 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、湘菜大厨勋章*1
 50 | 
 51 | 
 52 | 目标:粤菜大厨 (未完成)
 53 | 条件:学习广东街所有菜式(0/45)
 54 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、粤菜大厨勋章*1
 55 | 
 56 | 
 57 | 目标:浙菜大厨 (未完成)
 58 | 条件:学习浙江街所有菜式(0/48)
 59 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、浙菜大厨勋章*1
 60 | 
 61 | 
 62 | 目标:美食新人 (未完成)
 63 | 条件:餐厅升至1星(0/1)
 64 | 奖励:元宝*100、短效老鼠夹、2级升星凭证
 65 | 
 66 | 
 67 | 目标:美食达人 (未完成)
 68 | 条件:餐厅升至2星(0/2)
 69 | 奖励:元宝*200、短效偶像海报、3级升星凭证
 70 | 
 71 | 
 72 | 目标:美食专家 (未完成)
 73 | 条件:餐厅升至3星(0/3)
 74 | 奖励:元宝*400、一级万能食材*2、二级万能食材*2
 75 | 
 76 | 
 77 | 目标:美食大师 (未完成)
 78 | 条件:餐厅升至4星(0/4)
 79 | 奖励:元宝*800、三级万能食材*2、饭团外卖铜像*1
 80 | 
 81 | 
 82 | 目标:美味王者 (未完成)
 83 | 条件:餐厅升至5星(0/5)
 84 | 奖励:元宝*1600、四级万能食材*2、美味收款机*1
 85 | 
 86 | 
 87 | 目标:著名大厨 (未完成)
 88 | 条件:学习394道菜式(17/394)
 89 | 奖励:金币*10000、4级升星凭证、1-3级随机食材箱*5、
 90 | 
 91 | 
 92 | 目标:传奇大厨 (未完成)
 93 | 条件:学习450道菜式(17/450)
 94 | 奖励:金币*10000、5级升星凭证、1-3级随机食材箱*20、
 95 | 
 96 | 
 97 | 目标:情菜大厨 (未完成)
 98 | 条件:学习情侣街所有菜式(0/9)
 99 | 奖励:金币*10000、神秘礼券*10、1-3级随机食材箱*5、情菜大厨勋章*1
100 | 
101 | 
102 | 
103 | 104 |
105 | 橱柜仓库菜谱| 106 | 餐厅菜场商城
107 | 108 | 消息神殿酒吧| 109 | 街坊排行充值
110 | 111 | 食材菜谱圣地| 112 | 首页礼包注销
113 |
114 |
115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /templates/treasure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 |
22 | 圣地类型:神魔陵园
23 | 在圣地挖掘,可随机获得各种食材、道具、材料等,每次挖掘消耗3点体力。
24 | 体力:{{ user_obj.energy }}/100
25 |
26 | 27 | 28 |
29 | {% if dig_num %} 30 | [随机挖掘]
31 | 恭喜你,成功挖掘{{ dig_num }}次,得到:
32 | {% for dig_choice in dig_choices %} 33 | {{ forloop.counter }}.{{ dig_choice.food_material }}( 34 | {{ dig_choice.food_material_level.name }})×1
35 | {% endfor %} 36 | 体力-{{ dig_energy }}
37 | 挖掘5次.挖掘1次
38 | {% elif not dig_num %} 39 | [随机挖掘]
40 | 挖掘5次.挖掘1次
41 | {% endif %} 42 |
43 | 44 |
45 |
46 | 橱柜仓库菜谱| 47 | 餐厅菜场商城
48 | 49 | 消息神殿酒吧| 50 | 街坊排行充值
51 | 52 | 食材菜谱圣地| 53 | 首页礼包注销
54 |
55 | 56 |
57 | 58 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test_demo/__init__.py: -------------------------------------------------------------------------------- 1 | import pymysql 2 | pymysql.install_as_MySQLdb() -------------------------------------------------------------------------------- /test_demo/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/test_demo/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /test_demo/__pycache__/check_middleware.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/test_demo/__pycache__/check_middleware.cpython-36.pyc -------------------------------------------------------------------------------- /test_demo/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/test_demo/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /test_demo/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/test_demo/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /test_demo/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/changwoo360/MyProjects/92f3174d2fd03a86dfd3614872d7dddf90d34d35/test_demo/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /test_demo/check_middleware.py: -------------------------------------------------------------------------------- 1 | from django.utils.deprecation import MiddlewareMixin 2 | 3 | from django.shortcuts import render, redirect 4 | import re 5 | class CheckMiddleware(MiddlewareMixin): 6 | def process_request(self, request): 7 | current_path = request.path_info 8 | # 检查是否在白名单 9 | valid_url_list = ['/login/', '/admin/.*', '/register/'] 10 | for valid_url in valid_url_list: 11 | ret = re.match(valid_url, current_path) 12 | if ret: 13 | return None 14 | 15 | # 校验是否登陆 16 | user_id = request.session.get('user_id') 17 | if not user_id: 18 | return redirect('/login/') -------------------------------------------------------------------------------- /test_demo/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for test_demo project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.11.11. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.11/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '--z0#_v+dzq7jwlujk+&27kj1g7amcdq*maxxj8tim=w(=#h=#' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'delicious_hometown.apps.DeliciousHometownConfig', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | 'test_demo.check_middleware.CheckMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'test_demo.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [os.path.join(BASE_DIR, 'templates')] 60 | , 61 | 'APP_DIRS': True, 62 | 'OPTIONS': { 63 | 'context_processors': [ 64 | 'django.template.context_processors.debug', 65 | 'django.template.context_processors.request', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'test_demo.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.mysql', 82 | 'HOST': '127.0.0.1', 83 | 'PORT': '3306', 84 | 'NAME': 'test_demo', 85 | 'USER': 'root', 86 | 'PASSWORD': 'ren666666', 87 | } 88 | } 89 | 90 | 91 | # Password validation 92 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators 93 | 94 | AUTH_PASSWORD_VALIDATORS = [ 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 100 | }, 101 | { 102 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 103 | }, 104 | { 105 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 106 | }, 107 | ] 108 | 109 | 110 | # Internationalization 111 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ 112 | 113 | LANGUAGE_CODE = 'en-us' 114 | 115 | TIME_ZONE = 'UTC' 116 | 117 | USE_I18N = True 118 | 119 | USE_L10N = True 120 | 121 | USE_TZ = True 122 | 123 | 124 | # Static files (CSS, JavaScript, Images) 125 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ 126 | 127 | STATIC_URL = '/static/' 128 | STATICFILES_DIRS = [ 129 | os.path.join(BASE_DIR, 'static') 130 | ] 131 | -------------------------------------------------------------------------------- /test_demo/urls.py: -------------------------------------------------------------------------------- 1 | """test_demo URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.11/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: url(r'^$', 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: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.conf.urls import url, include 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 15 | """ 16 | from django.conf.urls import url 17 | from django.contrib import admin 18 | from delicious_hometown import views 19 | urlpatterns = [ 20 | 21 | url(r'^admin/', admin.site.urls), 22 | 23 | url(r'^login/', views.login), 24 | url(r'^logout/', views.logout), 25 | 26 | url(r'^index/', views.index), 27 | url(r'^foodmaterial', views.foodmaterial), 28 | url(r'^ambry/', views.ambry), 29 | url(r'^treasure/', views.treasure), 30 | url(r'^shop/(\d+)/$', views.shop_buy), 31 | url(r'^shop/', views.shop), 32 | url(r'^backpack/option/(.*?)/$', views.backpack_option), 33 | url(r'^backpack/', views.backpack), 34 | url(r'^buy_money/(.\d+)/$', views.buy_money_buy), 35 | url(r'^buy_money/$', views.buy_money), 36 | #url(r'^recipe/(\d+)/study/$', views.recipe_study), 37 | url(r'^recipe/(\d+)/$', views.recipe_view), 38 | url(r'^recipe/', views.recipe), 39 | url(r'^my_recipe/', views.my_recipe), 40 | url(r'^study_confirm/(\d+)/$', views.recipe_study_confirm), 41 | url(r'^recipe_study/', views.recipe_study), 42 | 43 | url(r'^market/',views.market), 44 | 45 | 46 | url(r'^gift/', views.Gift.as_view()), 47 | url(r'^friend/', views.friend), 48 | 49 | 50 | 51 | # 临时填充页面 52 | url('^test_1/', views.test_1), 53 | url('^test_2/', views.test_2), 54 | url('^test_3/', views.test_3), 55 | url('^home_address/', views.home_address), 56 | 57 | ] 58 | -------------------------------------------------------------------------------- /test_demo/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for test_demo 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/1.11/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", "test_demo.settings") 15 | 16 | application = get_wsgi_application() 17 | --------------------------------------------------------------------------------