Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÓÃPythonʵÏÖÍøÕ¾²âÊÔ

²âÊÔÍøÕ¾£ºBaiduÖ÷Ò³ÒÔ¼°Ïà¹ØµÄÒ³Ãæ
Ö÷Ì⣺ºÚºÐ²âÊÔ£¬¹¦ÄܲâÊÔ£¬ÐÔÄÜ/ѹÁ¦²âÊÔ£¬°²È«²âÊÔ£¬ Êý¾Ý×Öµä¹ÜÀí
1. ²âÊÔÒ³ÃæÊÇ·ñ¿É·ÃÎʵģ»
1.1 HTTP request status = 200, Ò³ÃæÏÂÔØÕýÈ·
from urllib import urlopen
# set up
url = None
# test
url = urlopen('http://www.baidu.com')
assert url.getcode() == 200
# clean up
del url
1.2 ÏÂÃæ¿¼ÂǸü¶àµÄ²âÊԵ㣬±ÈÈç¸÷ÖÖURL£¬¶Ë¿Ú£¬´úÀí£¬RequestÊý¾ÝÒÔ¼°Cookie.
¸ù¾ÝÍøÒ³µÄÁé»îÐÔ£¬ÎÒÃÇÑ¡Ôñ±È½Ï¼Ç¼Ðεķ½·¨À´ÊµÏÖ²âÊÔ¹¦ÄÜ£¬ÀàËÆLoadRunnerÖ»Êǽű¾ÊÇ×Ô¼ºÊÖд¡£
2. ²âÊÔÒ³ÃæµÄ¹¦ÄÜÊÇ·ñ·ûºÏÒªÇó: ÒԵǽ£¬·¢±íÎÄÕÂΪÀý
3. ²âÊÔÒ³ÃæµÄÐÔÄÜÊÇ·ñ·ûºÏÒªÇó£º
    ²¢·¢Óû§ÊýÁ¿£¬ÇëÇóÏìӦʱ¼ä£¬ÊÂÎñÇëÇóÏìӦʱ¼ä£¬£¨ÍÌÍÂÂÊ£¬ TPS£¬×ÊÔ´ÀûÓÃÂÊ ÎÞ·¨·ÃÎÊ·þÎñÆ÷)£¬ µã»÷ÂÊ
4. ²âÊÔÒ³ÃæÔÚÓû§²Ù×÷ºÍÍþвÏÂÊÇ·ñ°²È«£º
    Cookie¹¥»÷£¬SQL×¢Èë¹¥»÷£¬ä¯ÀÀÆ÷¹¥»÷£¬±©Á¦¹¥»÷£¬ÊäÈë·Ç·¨Êý¾Ý£¬ÉÏ´«·Ç·¨Îļþ£¬Õ¾Íâ½Å±¾¹¥»÷£¬Ä¾Âí¼ì²é


Ïà¹ØÎĵµ£º

һƪ²»´íµÄPythonÈëÃŽ̳Ì

Ô­ÎÄ
 http://www.hetland.org/python/instant-hacking.php
Instant Hacking[Òë
ÎÄ]
ÒëÕߣº ¿Ï¶¨À´¹ý                                ......

pythonϵÄweb¿ª·¢¿ò¼Ü Django,djangoÄ£°åµÄʹÓÃ

Ä£°åÊǼòµ¥µÄÎı¾Îļþ£¬Ëü¿ÉÒÔÊÇhtml¸ñʽ»òÊÇxml,csvµÈ¸ñʽµÄ
Ä£°å°üÀ¨±äÁ¿£¬À¨Ëü»á±»ÖµËùÌæ´úµ±ÔËÐÐʱ£¬ÒÔ¼°±êÇ©Ëü¿ØÖÆÄ£°åµÄÂß¼­ÔËËãÈçif,elseµÈ
ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÄ£°å£¬ÎÒÃǽ«»á¶ÔËü×öÏêϸµÄ˵Ã÷
{% extends "base_generic.html" %}
{% block title %}{{ section.title }}{% endblock %}
{% block content %}
< ......

pythonϵÄweb¿ª·¢¿ò¼Ü Django,½¨Á¢Ä£ÐÍ

Òª´´½¨ÄãµÄapp£¨½«djangoÅäÖõ½»·¾³±äÁ¿Ï£©
python manage.py startapp polls
ËüÃǽ«»á´´½¨Ò»¸öpollsÎļþ¼Ð£¬ÀïÃæµÄÄÚÈÝÊÇ£º
¡¡¡¡polls/
¡¡¡¡¡¡¡¡__init__.py
¡¡¡¡¡¡¡¡models.py
¡¡¡¡¡¡¡¡views.py
Õâ¸öĿ¼½á¹¹¾ÍÊÇappÓ¦ÓóÌÐò¡£
±àдÊý¾Ý¿âWebÓ¦ÓóÌÐòµÄµÚÒ»²½ÊǶ¨ÒåÄãµÄÄ£ÐͲ㗗»ù±¾ÉϾÍÊÇÄãµÄÊý¾Ý¿ ......

ʹÓà Django ºÍ Python ¿ª·¢ Web Õ¾µã


 
 
Ian Maurer (ian@itmaurer.com), ×ÊÉî¹ËÎÊ, Brulant, Inc.
2006 Äê 7 ÔÂ 03 ÈÕ
±¾ÏµÁÐÎÄÕÂÒ»¹²ÓÐÁ½Æª£¬±¾ÎÄÊÇÆäÖеĵÚһƪ¡£ÔÚÕâһƪÎÄÕÂÖУ¬ÎÒÃǽ«Õ¹Ê¾ Django µÄÓ÷¨£¬Django ÊÇ Python ±à³ÌÓïÑÔÇý¶¯µÄÒ»¸ö¿ªÔ´Ä£ÐÍ-ÊÓͼ-¿ØÖÆÆ÷£¨MVC£©·ç¸ñµÄ Web Ó¦ÓóÌÐò¿ò¼Ü¡£Ê¹Óà Django£¬ÎÒÃÇÔÚ¼¸·ÖÖÓÖ®ÄÚ¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ