当前位置:网站首页>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 08:37:00 【Progressive vegetable pig】
List of articles
Author's brief introduction : Hello everyone , I'm an up and comer pig . Inner Mongolia University of science and technology , Sophomore Planning Department . Technology is good, but don't give up , Try to do the whole stack . Love development , Development software , Develop web site , Develop all kinds of things .️
️ Personal home page : The blog of self-motivated vegetable pig
Series column : This article is written in Website development special column ️ If there is something wrong with the knowledge of the article , Please correct me. ! Study with you and make progress together
If you think the blogger's article is good , Three companies, please + Pay attention to and support bloggers
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
The above code explains :
introduce dbm modular .
with dbm.open('config', 'c') as db:
print('keys():', db.keys())
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']
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])
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')
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
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')
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')}"
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)
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://yzsam.com/2022/04/202204230804350129.html
边栏推荐
- DOM learning - add + - button
- 一个必看的微信小程序开发指南1-基础知识了解
- 如何保护开源项目免遭供应链攻击-安全设计(1)
- Notes on 30 steps of introduction to Internet of things of yangtao electronics STM32 III. Explanation of new cubeide project and setting
- stm32以及freertos 堆栈解析
- synchronized 实现原理
- Data deletion and modification (MySQL)
- What is RPC
- 程序,进程,线程;内存结构图;线程的创建和启动;Thread的常用方法
- okcc呼叫中心外呼系统智能系统需要用多大的盘存录音?
猜你喜欢

Flink SQL实现流批一体

经典题目刷一刷

PgSQL wants to implement all kinds of column sub query operations of MySQL

LeetCode-199-二叉树的右视图

Notes on 30 steps of introduction to the Internet of things of yangtao electronics STM32 III. cubemx graphical programming and setting the IO port on the development board

AQS & ReentrantLock 实现原理

STM32 uses Hal library. The overall structure and function principle are introduced

pgsql想实现mysql一样样的列子查询操作

让地球少些“碳”息 度能在路上

Using qlst excel file
随机推荐
分布式消息中间件框架选型-数字化架构设计(7)
作文以记之 ~ 二叉树的前序遍历
RPC procedure
获取TrustedInstaller权限
Data deletion and modification (MySQL)
洋桃电子STM32物联网入门30步笔记三、CubeMX图形化编程、设置开发板上的IO口
AQS & ReentrantLock 实现原理
ansible自動化運維詳解(一)ansible的安裝部署、參數使用、清單管理、配置文件參數及用戶級ansible操作環境構建
lgb,xgb,cat k折交叉验证
Excle plus watermark
CGM optimizes blood glucose monitoring and management -- Yiyu technology appears in Sichuan International Medical Exchange Promotion Association
Knowledge points and problem solutions related to information collection
input元素添加监听事件
stm32以及freertos 堆栈解析
队列(c语言/链表)
信息收集相关知识点及题解
什么是RPC
Asan minimalism
Kubernetes如何使用harbor拉去私有镜像
LINQ Learning Series ----- 1.4 anonymous objects