Flask学习-Flask app接受第一个HTTP请求
作者:@skyflask
转载本文请注明出处:https://www.cnblogs.com/skyflask/p/9194224.html
目录
一、__call__()
二、wsgi_app()
2.1 环境变量入栈
2.2 preprocess_request
2.3 dispatch_request
2.4 make_response
2.5 process_response
2.6 response(environ, start_response)
三、总结
一、__call__()
在Flask app启动后,一旦uwsgi收到来自web server的请求,就会调用后端app,其实此时就是调用app的__call__(environ,start_response).
flask.py:
1 2 | def __call__(self, environ, start_response): return self.wsgi_app(environ, start_response) |
二、wsgi_app()
当http请求从server发送过来的时候,他会启动__call__功能,这时候就启动了最关键的wsgi_app(environ,start_response)函数。
fask.py:
1 2 3 4 5 6 7 8 9 | def wsgi_app(self, environ, start_response): with self.request_context(environ): #2.1,把环境变量入栈 rv = self.preprocess_request() #2.2,请求前的处理操作,主要执行一些函数,主要是准备工作。 if rv is None: #请求前如果没有需要做的事情,就会进入到请求分发 rv = self.dispatch_request() #2.3 进行请求分发 response = self.make_response(rv) #2.4 返回一个response_class的实例对象,也就是可以接受environ和start_reponse两个参数的对象 response = self.process_response(response) #2.5 进行请求后的处理操作,只要是执行一些函数,和preprocesses_request()类似,主要是清理工作。 return response(environ, start_response) #2.6 对web server(uwsgi)进行正式回应 |
2.1 环境变量入栈
通过with上下文管理,生成request请求对象和请求上下文环境,并入栈。
执行如下代码块:
1 2 3 | def request_context(self, environ): return _RequestContext(self, environ) #调用_RequestContext()类 |
2.1.1 调用_RequestContext()类
首先 会执行__enter__()函数,执行_request_ctx_stack的push方法,把环境变量进行入栈操作。
注意:_request_ctx_stack = LocalStack()
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 | #请求上下文初始化 class _RequestContext(object): def __init__(self, app, environ): self.app = app self.url_adapter = app.url_map.bind_to_environ(environ) self.request = app.request_class(environ) self.session = app.open_session(self.request) self.g = _RequestGlobals() self.flashes = None ''' 调用with的时候就会执行 ''' def __enter__(self): _request_ctx_stack.push(self) '''with进行上下文管理的例子: with离开后就会执行自定义上下文管理 class Diycontextor: def __init__(self,name,mode): self.name = name self.mode = mode def __enter__(self): print "Hi enter here!!" self.filehander = open(self.name,self.mode) return self.filehander def __exit__(self,*para): print "Hi exit here" self.filehander.close() with Diycontextor('py_ana.py','r') as f: for i in f: print i ''' def __exit__(self, exc_type, exc_value, tb): if tb is None or not self.app.debug: _request_ctx_stack.pop() |
这一步最主要的是LocalStack类。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | class LocalStack(object): """This class works similar to a :class:`Local` but keeps a stack of objects instead. This is best explained with an example::< br >LocalStack类似于Local类,但是它保持了一个栈功能。它能够将对象入栈、出栈,如下: >>> ls = LocalStack() >>> ls.push(42) >>> ls.top 42 >>> ls.push(23) >>> ls.top 23 >>> ls.pop() 23 >>> ls.top 42 They can be force released by using a :class:`LocalManager` or with the :func:`release_local` function but the correct way is to pop the item from the stack after using. When the stack is empty it will no longer be bound to the current context (and as such released).< br >入栈的对象可以通过LocalManage类进行强制释放,或者通过函数release_local函数。但是,正确的姿势是通过pop函数把他们出栈。< br >当栈为空时,它不再弹出上下文对象,这样就完全释放了。 By calling the stack without arguments it returns a proxy that resolves to the topmost item on the stack.< br >通过调用调用无参数的stack,返回一个proxy。 |
从LocalStack的说明可以得知这几个事情:
1、LocalStack是一个类似Local的类,但是它具备栈的功能,能够让对象入栈、出栈以及销毁对象。
2、可以通过LocalManager类进行强制释放对象。
由引申出两个类:Local类和Localmanager类
Local类用于添加、存储、或删除上下文变量。
LocalManager类:由于Local对象不能管理自己,所以通过LocalManager类用来管理Local对象。
我们再回到wsgi_app函数中的2.2步骤:
2.2 preprocess_request
preprocess_request()方法,主要是进行flask的hook钩子, before_request功能的实现,也就是在真正发生请求之前,有些准备工作需要提前做。比如,连接数据库。
代码如下:
1 2 3 4 5 6 | def preprocess_request(self): for func in self.before_request_funcs: rv = func() if rv is not None: return rv |
它会执行preprocess_request列表里面的每个函数。执行完成后,他会进入到dispatch_request方法。
2.3 dispatch_request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ''' 分发请求 1、获取endpoint和values,即请求url和参数 2、调用视图函数view_functions[endpoint](**values) 3、处理异常错误 ''' def dispatch_request(self): try: endpoint, values = self.match_request() return self.view_functions[endpoint](**values) except HTTPException, e: handler = self.error_handlers.get(e.code) if handler is None: return e return handler(e) except Exception, e: handler = self.error_handlers.get(500) if self.debug or handler is None: raise return handler(e) |
进入dispatch_request()后,先执行match_request(),match_request()定义如下:
1 2 3 4 | def match_request(self): rv = _request_ctx_stack.top.url_adapter.match() request.endpoint, request.view_args = rv return rv |
注意:函数里面的url_adapter。
self.url_adapter = app.url_map.bind_to_environ(environ),其实他使一个Map()对象,Map()对象位于werkzeug.routing模块,用于处理routeing。
从函数可以看出,它会返回一个元组(endpoint,view_args)
endpoint:是一个url
view_args:是url的参数
例如:
1 2 3 4 5 6 7 8 9 10 | >>> m = Map([ ... Rule('/', endpoint='index'), ... Rule('/downloads/', endpoint='downloads/index'), ... Rule('/downloads/< int:id >', endpoint='downloads/show') ... ]) >>> urls = m.bind("example.com", "/") >>> urls.match("/", "GET") ('index', {}) >>> urls.match("/downloads/42") ('downloads/show', {'id': 42}) |
match_request()执行完成后,此时已经获取到了url和url里面包含的参数的信息。接着进入视图函数的执行:view_functions()
在Flask app启动一节我们知道,view_functions()是一个字典,类似view_functions = {'hello_world':hello_world},当我们执行
1 | self.view_functions[endpoint](**values) |
就相当于执行了hello_wold(**values),即自行了视图函数。也就是我们最开始app里面的hello_world视图函数:
1 2 3 | @app.route('/hello') def hello_world(): return 'Hello World!' |
这时就会返回'Hello World!‘如果有异常,则返回异常内容。
至此,就完成了dispatch_request(),请求分发工作。这时,我们再次回到wsgi_app中的2.4步:response = self.make_response(rv)
2.4 make_response
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 | def make_response(self, rv): """Converts the return value from a view function to a real response object that is an instance of :attr:`response_class`. The following types are allowd for `rv`: ======================= =========================================== :attr:`response_class` the object is returned unchanged :class:`str` a response object is created with the string as body :class:`unicode` a response object is created with the string encoded to utf-8 as body :class:`tuple` the response object is created with the contents of the tuple as arguments a WSGI function the function is called as WSGI application and buffered as response object ======================= =========================================== :param rv: the return value from the view function """ if isinstance(rv, self.response_class): return rv if isinstance(rv, basestring): return self.response_class(rv) if isinstance(rv, tuple): return self.response_class(*rv) return self.response_class.force_type(rv, request.environ) |
通过make_response函数,将刚才取得的 rv 生成响应,重新赋值response
2.5 process_response
再通过process_response功能主要是处理一个after_request的功能,比如你在请求后,要把数据库连接关闭等动作,和上面提到的before_request对应和类似。
1 2 3 | def after_request(self, f): self.after_request_funcs.append(f) return f |
之后再进行request_finished.send的处理,也是和socket处理有关,暂时不详细深入。之后返回新的response对象。
这里特别需要注意的是,make_response函数是一个非常重要的函数,他的作用是返回一个response_class的实例对象,也就是可以接受environ和start_reponse两个参数的对象
当所有清理工作完成后,就会进入response(environ, start_response)函数,进行正式回应。
2.6 response(environ, start_response)
最后进入response()函数,说response函数之前,我们先来看看response函数的由来:
1 2 | response = self.make_response(rv) response = self.process_response(response) |
2.6.1 response=make_response()
而make_response的返回值为:return self.response_class.force_type(rv, request.environ)
其中的response_class = Response,而Response最终来自werkzeug.
werkzeug import Response as ResponseBase
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | @classmethod def force_type(cls, response, environ=None): """Enforce that the WSGI response is a response object of the current type. Werkzeug will use the :class:`BaseResponse` internally in many situations like the exceptions. If you call :meth:`get_response` on an exception you will get back a regular :class:`BaseResponse` object, even if you are using a custom subclass. This method can enforce a given response type, and it will also convert arbitrary WSGI callables into response objects if an environ is provided:: # convert a Werkzeug response object into an instance of the # MyResponseClass subclass. response = MyResponseClass.force_type(response) # convert any WSGI application into a response object response = MyResponseClass.force_type(response, environ) This is especially useful if you want to post-process responses in the main dispatcher and use functionality provided by your subclass. Keep in mind that this will modify response objects in place if possible! |
从上面可以知道,force_type()是一个类方法,强制使当前对象成为一个WSGI的reponse对象。
2.6.2 response = self.process_response(response)
1 2 3 4 5 6 7 8 | def process_response(self, response): session = _request_ctx_stack.top.session if session is not None: self.save_session(session, response) for handler in self.after_request_funcs: response = handler(response) return response |
process_response()执行了2个操作:
1、保存会话
2、执行请求后的函数列表中每一个函数,并返回response对象
最后response函数会加上environ, start_response的参数并返回给uwsgi(web服务器),再由uwsgi返回给nginx,nignx返回给浏览器,最终我们看到的内容显示出来。
至此,一个HTTP从请求到响应的流程就完毕了.
三、总结
总的来说,一个流程的关键步骤可以简单归结如下:
最后附上flask 0.1版本的注释源码:
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | # -*- coding: utf-8 -*- from __future__ import with_statement import os import sys from threading import local from jinja2 import Environment, PackageLoader, FileSystemLoader from werkzeug import Request as RequestBase, Response as ResponseBase, \ LocalStack, LocalProxy, create_environ, cached_property, \ SharedDataMiddleware from werkzeug.routing import Map , Rule from werkzeug.exceptions import HTTPException, InternalServerError from werkzeug.contrib.securecookie import SecureCookie from werkzeug import abort, redirect from jinja2 import Markup, escape try : import pkg_resources pkg_resources.resource_stream except (ImportError, AttributeError): pkg_resources = None #Request继承werkzeug的Request类 class Request(RequestBase): def __init__( self , environ): RequestBase.__init__( self , environ) self .endpoint = None self .view_args = None #Response继承werkzeug的Response类 class Response(ResponseBase): default_mimetype = 'text/html' #请求的全局变量类 class _RequestGlobals( object ): pass #请求上下文初始化 class _RequestContext( object ): def __init__( self , app, environ): self .app = app self .url_adapter = app.url_map.bind_to_environ(environ) self .request = app.request_class(environ) self .session = app.open_session( self .request) self .g = _RequestGlobals() self .flashes = None ''' 调用with的时候就会执行 ''' def __enter__( self ): _request_ctx_stack.push( self ) ''' with离开后就会执行 自定义上下文管理 class Diycontextor: def __init__(self,name,mode): self.name = name self.mode = mode def __enter__(self): print "Hi enter here!!" self.filehander = open(self.name,self.mode) return self.filehander def __exit__(self,*para): print "Hi exit here" self.filehander.close() with Diycontextor('py_ana.py','r') as f: for i in f: print i ''' def __exit__( self , exc_type, exc_value, tb): if tb is None or not self .app.debug: _request_ctx_stack.pop() ''' self.url_adapter = app.url_map.bind_to_environ(environ) >>> m = Map([ ... Rule('/', endpoint='index'), ... Rule('/downloads/', endpoint='downloads/index'), ... Rule('/downloads/<int:id>', endpoint='downloads/show') ... ]) >>> urls = m.bind("example.com", "/") >>> urls.build("index", {}) '/' >>> urls.build("downloads/show", {'id': 42}) '/downloads/42' >>> urls.build("downloads/show", {'id': 42}, force_external=True) 'http://example.com/downloads/42' ''' def url_for(endpoint, * * values): return _request_ctx_stack.top.url_adapter.build(endpoint, values) ''' flash实现,通过get_flashed_messages获取消息 ''' def flash(message): session[ '_flashes' ] = (session.get( '_flashes' , [])) + [message] def get_flashed_messages(): flashes = _request_ctx_stack.top.flashes if flashes is None : _request_ctx_stack.top.flashes = flashes = \ session.pop( '_flashes' , []) return flashes ''' 实现render_template功能,模板名和{content} ''' def render_template(template_name, * * context): current_app.update_template_context(context) return current_app.jinja_env.get_template(template_name).render(context) ''' 实现render_template_string功能,模板名和{content} ''' def render_template_string(source, * * context): current_app.update_template_context(context) return current_app.jinja_env.from_string(source).render(context) def _default_template_ctx_processor(): reqctx = _request_ctx_stack.top return dict ( request = reqctx.request, session = reqctx.session, g = reqctx.g ) def _get_package_path(name): try : return os.path.abspath(os.path.dirname(sys.modules[name].__file__)) except (KeyError, AttributeError): return os.getcwd() ''' Flask类 ''' class Flask( object ): ''' 全局变量 ''' request_class = Request response_class = Response static_path = '/static' secret_key = None session_cookie_name = 'session' jinja_options = dict ( autoescape = True , extensions = [ 'jinja2.ext.autoescape' , 'jinja2.ext.with_' ] ) ''' 当前模块名 app=Flask(__name__) ''' def __init__( self , package_name): self .debug = False self .package_name = package_name self .root_path = _get_package_path( self .package_name) self .view_functions = {} self .error_handlers = {} self .before_request_funcs = [] self .after_request_funcs = [] self .template_context_processors = [_default_template_ctx_processor] self .url_map = Map () """ A WSGI middleware that provides static content for development environments or simple server setups. Usage is quite simple:: import os from werkzeug.wsgi import SharedDataMiddleware app = SharedDataMiddleware(app, { '/shared': os.path.join(os.path.dirname(__file__), 'shared') }) """ if self .static_path is not None : self .url_map.add(Rule( self .static_path + '/<filename>' , build_only = True , endpoint = 'static' )) if pkg_resources is not None : target = ( self .package_name, 'static' ) else : target = os.path.join( self .root_path, 'static' ) self .wsgi_app = SharedDataMiddleware( self .wsgi_app, { self .static_path: target }) self .jinja_env = Environment(loader = self .create_jinja_loader(), * * self .jinja_options) self .jinja_env. globals .update( url_for = url_for, get_flashed_messages = get_flashed_messages ) ''' FileSystemLoader(BaseLoader) Loads templates from the file system. This loader can find templates in folders on the file system and is the preferred way to load them. The loader takes the path to the templates as string, or if multiple locations are wanted a list of them which is then looked up in the given order:: >>> loader = FileSystemLoader('/path/to/templates') >>> loader = FileSystemLoader(['/path/to/templates', '/other/path']) A very basic example for a loader that looks up templates on the file system could look like this:: from jinja2 import BaseLoader, TemplateNotFound from os.path import join, exists, getmtime class MyLoader(BaseLoader): def __init__(self, path): self.path = path def get_source(self, environment, template): path = join(self.path, template) if not exists(path): raise TemplateNotFound(template) mtime = getmtime(path) with file(path) as f: source = f.read().decode('utf-8') return source, path, lambda: mtime == getmtime(path) PackageLoader(BaseLoader) If the package path is not given, ``'templates'`` is assumed. 默认值为templates ''' def create_jinja_loader( self ): if pkg_resources is None : return FileSystemLoader(os.path.join( self .root_path, 'templates' )) return PackageLoader( self .package_name) ''' template_context_processors=[dict( request=reqctx.request, session=reqctx.session, g=reqctx.g] ''' def update_template_context( self , context): reqctx = _request_ctx_stack.top for func in self .template_context_processors: context.update(func()) ''' 整体APP启动入口,启动后进行如下几个步骤: 1、判断是否有设置DEBUG 2、运行rum_simple() app = Flask(__name__) if __name__ == '__main__(): app.run() app.run() run_simple(host, port, self, **options) Start a WSGI application. Optional features include a reloader, multithreading and fork support. ''' def run( self , host = 'localhost' , port = 5000 , * * options): from werkzeug import run_simple if 'debug' in options: self .debug = options.pop( 'debug' ) options.setdefault( 'use_reloader' , self .debug) options.setdefault( 'use_debugger' , self .debug) return run_simple(host, port, self , * * options) def test_client( self ): from werkzeug import Client return Client( self , self .response_class, use_cookies = True ) def open_resource( self , resource): if pkg_resources is None : return open (os.path.join( self .root_path, resource), 'rb' ) return pkg_resources.resource_stream( self .package_name, resource) def open_session( self , request): key = self .secret_key if key is not None : return SecureCookie.load_cookie(request, self .session_cookie_name, secret_key = key) def save_session( self , session, response): if session is not None : session.save_cookie(response, self .session_cookie_name) def add_url_rule( self , rule, endpoint, * * options): options[ 'endpoint' ] = endpoint options.setdefault( 'methods' , ( 'GET' ,)) self .url_map.add(Rule(rule, * * options)) ''' @app.route('/test') def test(): pass route是一个装饰器,它干了2个事情: 1、添加url到map里 2、添加函数名到视图函数{'test':test} ''' def route( self , rule, * * options): def decorator(f): self .add_url_rule(rule, f.__name__, * * options) self .view_functions[f.__name__] = f return f return decorator ''' A decorator that is used to register a function give a given error code. Example:: @app.errorhandler(404) def page_not_found(): return 'This page does not exist', 404 You can also register a function as error handler without using the :meth:`errorhandler` decorator. The following example is equivalent to the one above:: def page_not_found(): return 'This page does not exist', 404 app.error_handlers[404] = page_not_found error_handlers = {page_not_found:404} ''' def errorhandler( self , code): def decorator(f): self .error_handlers[code] = f return f return decorator ''' 请求开始前做准备工作,比如数据库连接,用户验证 @app.before_request def before_request(): #可在此处检查jwt等auth_key是否合法, #abort(401) #然后根据endpoint,检查此api是否有权限,需要自行处理 #print(["endpoint",connexion.request.url_rule.endpoint]) #abort(401) #也可做ip检查,以阻挡受限制的ip等 ''' def before_request( self , f): self .before_request_funcs.append(f) return f def after_request( self , f): self .after_request_funcs.append(f) return f def context_processor( self , f): self .template_context_processors.append(f) return f ''' Here is a small example for matching: >>> m = Map([ ... Rule('/', endpoint='index'), ... Rule('/downloads/', endpoint='downloads/index'), ... Rule('/downloads/<int:id>', endpoint='downloads/show') ... ]) >>> urls = m.bind("example.com", "/") >>> urls.match("/", "GET") ('index', {}) >>> urls.match("/downloads/42") ('downloads/show', {'id': 42}) ''' def match_request( self ): rv = _request_ctx_stack.top.url_adapter.match() request.endpoint, request.view_args = rv return rv ''' 分发请求 1、获取endpoint和values,即请求url和参数 2、调用视图函数view_functions[endpoint](**values) 3、处理异常错误 ''' def dispatch_request( self ): try : endpoint, values = self .match_request() return self .view_functions[endpoint]( * * values) except HTTPException, e: handler = self .error_handlers.get(e.code) if handler is None : return e return handler(e) except Exception, e: handler = self .error_handlers.get( 500 ) if self .debug or handler is None : raise return handler(e) ''' from werkzeug.wrappers import BaseResponse as Response def index(): return Response('Index page') def application(environ, start_response): path = environ.get('PATH_INFO') or '/' if path == '/': response = index() else: response = Response('Not Found', status=404) return response(environ, start_response) ''' def make_response( self , rv): if isinstance (rv, self .response_class): return rv if isinstance (rv, basestring ): return self .response_class(rv) if isinstance (rv, tuple ): return self .response_class( * rv) return self .response_class.force_type(rv, request.environ) def preprocess_request( self ): for func in self .before_request_funcs: rv = func() if rv is not None : return rv def process_response( self , response): session = _request_ctx_stack.top.session if session is not None : self .save_session(session, response) for handler in self .after_request_funcs: response = handler(response) return response def wsgi_app( self , environ, start_response): with self .request_context(environ): rv = self .preprocess_request() if rv is None : rv = self .dispatch_request() response = self .make_response(rv) response = self .process_response(response) return response(environ, start_response) def request_context( self , environ): return _RequestContext( self , environ) def test_request_context( self , * args, * * kwargs): return self .request_context(create_environ( * args, * * kwargs)) ''' app=Flask(__name__) call(self, environ, start_response) wsgi_app(self, environ, start_response) wsgi_app是flask核心: ''' def __call__( self , environ, start_response): return self .wsgi_app(environ, start_response) # context locals _request_ctx_stack = LocalStack() current_app = LocalProxy( lambda : _request_ctx_stack.top.app) request = LocalProxy( lambda : _request_ctx_stack.top.request) session = LocalProxy( lambda : _request_ctx_stack.top.session) g = LocalProxy( lambda : _request_ctx_stack.top.g) |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」