当前位置:网站首页>Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
2022-04-23 17:20:00 【Progressive vegetable pig】
Form writing habits together ! This is my participation 「 Nuggets day new plan · 4 Yuegengwen challenge 」 Of the 21 God , Click to see the event details .
One , Preface
Today can be said to be a day of rowing , Not a lot of things to do , Today's main attack , Baotou project that hasn't ended before , Recently, I want to finish this project as soon as possible , But there are two big problems in a row , Time is spent changing bug Yes .
Two ,dbm Database problems
This is an old problem . The ultimate reason is Linux System architecture and window The reason why the system does not fit , For a long time , Because of the large amount of code , There are many things you can't understand , It's been a long time dbm A rookie knows , Just managed to change this bug.
Problem finding :
Property configuration failure , People are stupid, at that time . This is a very important function , I finished the conversion dbm The database found that this function cannot be used , and , I still can't use this function when I restore the original version on the server , I suspect there is a problem with this function before .
Problem solving :
After my understanding of dbm Understanding and learning 【 It's still a rookie's understanding level 】 Because I can't use python Complete traversal , There are few online tutorials . There is no reference to see !
import dbm
Copy code
The above code explains : introduce dbm modular .
with dbm.open('config', 'c') as db:
print('keys():', db.keys())
Copy code
Open our named config Of dbm database , This database is very strange , It's strange that I've never seen such a database . We have opened him in a way that we can all write . Let's output the data in the database first key value
keys(): [b'btn_2', b'past_matchs', b'pw_nums', b'btn_3', b'btn_1', b'upload', b'btn_4', b'time', b'match', b'time_3_posts', b'btn_5', b'time_2_posts', b'match_name']
Copy code
As shown above , We got all the data in this database key value , We observe these laws , Guess the meaning and function of their code 【 It's too difficult to take over other people's projects 】
for k in db.keys():
print(k, db[k])
Copy code
I try to clean them by mathematical modeling .
ha-ha , mentally . I continue to study them , It was found that there was a format problem , I tried to convert them , After trying some methods .
str(db[k],'utf-8')
Copy code
That's ok , Ha ha, it's very simple .
b'past_matchs' ,2021| Baotou second cultural tourism creative works competition
b'pw_nums' 3
b'upload' false
b'time' 2
b'match' 2021
b'time_3_posts'
b'time_2_posts' 200
Process finished with exit code 0
Copy code
Look at these words :2021| Baotou second cultural tourism creative works competition . Competition results , Upload work , Looking back , Judge entrance , Baotou second cultural tourism creative works competition . It's time for me to draw again , I basically know the meaning , however , This traversal is incomplete , Not completely traversed out , In the final analysis, I am right dbm The format of the database is unclear . Incomplete , I'm going to continue this problem tomorrow , Learn more about , Now traverse these things , Enough for me to find the previous property configuration failure bug.
db_config=dbm.open('config','c')
Copy code
I try to use my own dbm To replace him . Let's try the function . To the routing layer , Find out the add operation .
db_config["past_matchs"] = db_config["past_matchs"].decode(
)+f",{value}|{request.form.get('match_name')}"
Copy code
test , Basically completed , however bug It's a little bit big , Traversal is not complete now , Continue to study tomorrow , Keep doing it .
3、 ... and , Project cross domain interception processing
This bug, How do you say , It's tricky , I watched it for two days , Finally solved this bug. But it exposed me to json Cross domain interception and cross domain problems , Preliminary contact , Although most studies are not in the right direction , But I basically learned . That's the thing :
Now I need to add a work , And then reported the wrong . Cross-domain problem , Storing pictures was rejected . Then I just falsk Framework to study . I think so js Cross domain problem solving
from flask_cors import CORS
app = Flask(__name__)
CORS(app, supports_credentials=True)
Copy code
The method has been used all over , What's the use .
Problem solving :
Because the previous server was mined , A new server ,ip Changed 、 Cross domain access cors The setting still only allows the previous ip visit oss. I added a new rule , Problem solved .
... For two days because ip The question of rules .
However, we have initially touched on cross domain issues .
版权声明
本文为[Progressive vegetable pig]所创,转载请带上原文链接,感谢
https:https://yzsam.com/html/AeLIKp.html
边栏推荐
- Solution of Navicat connecting Oracle library is not loaded
- oracle 中快速获取表的列名列表
- VLAN advanced technology, VLAN aggregation, super VLAN, sub VLAN
- MySQL modify master database
- 1-2 JSX syntax rules
- Further optimize Baidu map data visualization
- Generation of barcode and QR code
- Summary of common websites
- SPC introduction
- [batch change MySQL table and corresponding codes of fields in the table]
猜你喜欢
Further study of data visualization
[WPF binding 3] listview basic binding and data template binding
线性代数感悟之1
基于51单片机红外无线通讯仿真
Scope and scope chain in JS
Go language, array, string, slice
Grpc gateway based on Ocelot
【生活中的逻辑谬误】稻草人谬误和无力反驳不算证明
Get the column name list of the table quickly in Oracle
[PROJECT] small hat takeout (8)
随机推荐
websocket
Redis docker installation
JS failed to change all variables and changed to the return method. Finally, the problem was solved
Using quartz under. Net core - calendar of [6] jobs and triggers
Change Oracle to MySQL
Your brain expands and shrinks over time — these charts show how
_ Mold_ Board_
C dapper basically uses addition, deletion, modification and query transactions, etc
[logical fallacy in life] Scarecrow fallacy and inability to refute are not proof
[difference between Oracle and MySQL]
Net standard
1-3 components and modules
groutine
ClickHouse-表引擎
Interface document yaml
For the space occupation of the software, please refer to the installation directory
Production environment——
How to use the input table one-way service to send (occupy less) picture files (body transmission)? FileReader built-in object involved
Shell-入门、变量、以及基本的语法
Handwritten event publish subscribe framework