احذف السطر
current = aaa.current_user.username
احذف السطر
current = aaa.current_user.username
السلام عليكم ورحمة الله وبركاته
تم بفضل الله
تفعيل سكربت contact وبرمجته بشكل جيد ﻻرسال البريد(عملت بريد خاص للموقع) موجود في الكود
المهم ضع في سكربت app
بسم الله
def send_email(author,message,subject):
username = 'bottle.pastebin@gmail.com'
password = '05060708q'
smtp='smtp.gmail.com:587'
admin = 'bottle.pastebin@gmail.com'
info_contact = string.join((
"author: %s" % author,
"To: %s" % admin,
"Subject: %s" % subject,
'',message
), "\r\n")
server = smtplib.SMTP(smtp)
server.starttls()
server.login(username,password)
server.sendmail(author, [admin], info_contact)
ومن ثم ضع هذا الكود
@route("/Contact")
def contact():
return template('templates/contact.html',last5=last_five())
@post('/contact')
def cont():
author = request.forms.get('author_email')
message = request.forms.get('new_message')
subject = request.forms.get('subject')
error = ['Please enter all information']
if author == '' and message == '' and subject =='':
return template('templates/contact.html',error=error,lasrt5=last_five())
send_email(author,message,subject)
return 'Your message has been sent successfully'
والتمبلت
{% extends 'base.html' %}
{% block info %}
<div class="jumbotron well">
<h3>Contact us</h3>
<style type='text/css'>
color:Red
</style>
<form accept-charset="UTF-8" action="/contact" method="POST">
email <input type="text" name="author_email" id="" placeholder='give us your email'/><br/>
subject <input type = 'text' name = 'subject' placeholder = 'subject . . . . . . . '><br/>
message <textarea class="span4" id="new_message" name="new_message"
placeholder="Type in your message" rows="5"></textarea>
<button class="btn btn-info" type="submit">Send Message!</button>
</form>
<div class = 'error'>
{{error}}
</div>
</div>
{% endblock %}
------------
لدي سؤال , استاذ احمد
كيف تريد ان تعطي صﻻحية للمستخدم المسجل وانت لم تعمل سكربت تسجيل , هل هذا قصدك ام انا فهمته خطأ
هل تريد ان نقوم بعمله
تم تعديل هذه المشاركة بواسطة MuStafa - HaSsan في 20 مايو 2013 في 23:28

ﻻ والله اليوم امتحنت اﻻمتحان الثالث , ﻻكن غدا لدي امتحان سهل لم ياخذ مني وقت كثير واستغللت وقت الفراغ في برمجة مدونتي اريد اكملها وايضا اتى في بالي هذا المشروع !!
صراحة لم ارى سكربت التسجيل !!
تم تعديل هذه المشاركة بواسطة MuStafa - HaSsan في 21 مايو 2013 في 00:13

تم تعديل هذه المشاركة بواسطة med reda في 21 مايو 2013 في 00:39
pycrypto
هل يوجد لها مصادر لكي اتعلمها او افهمها بشكل جيد من غير هذا الموقع
http://cork.firelet.net/
ﻻنها مكتبة ذكية ومفيدة ومختصرة باكوادها جدا وفيها مميزات غنية

تم تعديل هذه المشاركة بواسطة med reda في 21 مايو 2013 في 17:06
سوف يتم البدا في برمجة الولوج باستخدام الفيسبوك
تم تعديل هذه المشاركة بواسطة med reda في 29 مايو 2013 في 02:31
سيتم الشروع في اضافة خاصية التسجيل بعد الحكم على الاضافة الاخيرة
السلام عليكم :
ما شاء الله اضافة جميلة ..؟ اعتقد ان مكتبة فيس بوك لبايثون افضل من تويتر !! فيها دوال ﻻتوجد لتويتر !؟ مثل تسجيل الدخول !! في تويتر يتم التسجيل عن طريق معلومات تسجل فيها بحسابك في موقع المكتبة
هل لي بشرح هذا الكود (ﻻكن بحثت لم اجد كود شبيه لكودك الذي استعملته في سكربت app
ACCESS_TOKEN = params[0].split('=')[1]
EXPIRE = params[1].split('=')[1]
response, content = http.request('https://graph.facebook.com/me?access_token=%s' % ACCESS_TOKEN)
data = json.loads(content)
graph = facebook.GraphAPI(ACCESS_TOKEN)
profile = graph.get_object("me")
['access_token=CAAFXP6P6PPsBAEyQBeC3JzYclirFeXwOKfqegFISWiZBBe...............bArAZCTuZC3k', 'expires=5183849']
اي عبارة عن list بها عنصرين access_token and expire
access_token هو الرمز الذي نحتاجه للتواصل مع الـ للفايسبوك
[params[0 تساوي
['ACCESS_TOKEN=CAAFXP6P6PPsBAEyQBeC3JzYc']
['CAAFX..','CAAFXP6']
ACCESS_TOKEN = params [0]
result = ACCESS_TOKEN.split('=')
تم تعديل هذه المشاركة بواسطة med reda في 2 يونيو 2013 في 15:53
بالنسبة الى:
response, content = http.request('https://graph.facebook.com/me?access_token=%s' % ACCESS_TOKEN)
httplib2.Http.request.__doc__
حيث ان response قيمتها هي:
{'status': '200', 'content-length': '302', 'content-location': 'https://graph.facebook.com/me?access_token=CAAFXP6P6PPsBAJRGX....weV69oXNKLbvXZA7fERLquvSW.....ZCZCmP7f0sTwsL6rjsvDyZA3xv1Jj2yHTMQlot0CAo4xrf254H4njp31ewBkWVOaOeCOjhZA', 'last-modified': '2012-12-22T20:57:11+0000', 'expires': 'Sat, 01 Jan 2000 00:00:00 GMT', 'x-fb-rev': '832557', 'connection': 'keep-alive', 'etag': '"fbbddb.......5b320e6f2d1d1"', 'pragma': 'no-cache', 'cache-control': 'private, no-cache, no-store, must-revalidate', 'date': 'Sun, 02 Jun 2013 12:56:35 GMT', 'access-control-allow-origin': '*', 'content-type': 'text/javascript; charset=UTF-8', 'x-fb-debug': 'xpLWuRLdinw....QsmuB1X9MPSE0+o='}
لتفهم اكثر راجع :
http://en.wikipedia.org/wiki/List_of_HTTP_headers#Responses
و content قيمتها هي:
{"id":"10033.....3792","name":"facebook_name ","first_name":"reda","last_name":"med","link":"http:\/\/www.facebook.com\/firstname.lastname","username":"med.reda","gender":"male","email":"email\u0040gmail.com","timezone":3,"locale":"En, us","verified":true,"updated_time":"2012-12-22T20:57:11+0000"}
graph = facebook.GraphAPI(ACCESS_TOKEN)
profile = graph.get_object("me")
واخيرا اترك لك الباقي لتكتشفه وحدك
تم تعديل هذه المشاركة بواسطة med reda في 2 يونيو 2013 في 16:46
جميل الشرح عاشت يدك ومفهوم والله ,, صراحة لم اجرب قبل ان اسند قيم لمتغيرين اﻻ نادرا !!
واشكرك على نصيحة جزاك الله خيرا .

a ,b, c = [1, 2, 3]
تم تعديل هذه المشاركة بواسطة med reda في 2 يونيو 2013 في 18:29
, ﻻ اشكرك . ﻻكن شوي المكتبة فيها حماس اكثر من مكتبة تويتر ! سبق وشرحت مكتبة تويتر يمكنك ان تراه

خذ راحتك , فانا معك اقوم اﻻن ببرمجة مدونة في اطار bottle
اي شيء لم تفهمه في المكتبة قول وان شاء الله اجيبك عليه بكل سهولة
