السلام عليكم :
اعمل على اطار bottle ولدي مشكلة , تعلمت من اﻻستاذ احمد يوسف وولاسف لم استطع حلها ومتوقف عن التعليم وعن تكملة السكربت بسببها
وهي لدي ملفين
ملف css
وملف tpl(template)
وضعت اﻻشتقاقات في القالب (template)
ﻻكن المشكلة عندما اجرب السكربت
ﻻيخرج التصميم وعندما افتح سورس الصفحة واضغط على مسار التصميم يخرج error(404)
قالو لي اخدمها كملف static_file
فعلتها ﻻكن فقط على الرابط الي اعمله انا يضهر التصميم اما الصفحات اﻻخرى ﻻ تضهر
وهذا الكود الي عملته
كود سكربت (لتسجيل)
# -*- coding: utf-8 -*-
import MySQLdb
from bottle import route,run,request,response,debug,post,template,static_file,SimpleTemplate
import config
import sys
from cgi import escape as xss
from MySQLdb import escape_string as xsql
try:
def mysql():
db = MySQLdb.connect(config.host, config.user,config.passwd , config.db, charset = "utf8", use_unicode = True)
db.autocommit(1)
return db.cursor()
except Exception,R:
print 'SOrrY~!',R
def insinfo(username,password,email):
insert = mysql()
insert.execute("INSERT INTO infosign(username,password,email) VALUES('%s','%s','%s')"%(username,password,email))
@route('/')
def login_form():
return template('/home/coder/Desktop/login/signup.tpl')
return '''
<html>
<body>
<table border="1" width="100%" height="190%" bordercolor="Blue">
<td align = center>
<img src="http://localhostr.com/file/930/L0E06jXAAeYD/hads.jpeg" alt="عذرا .. حدث خلل في الصورة">
<form action="login" method="POST">
<p>اهﻻ بك في موقع هدية</p></br>
<p><font color="Blue">اسم المستخدم*</font>: </p><input name="usernames" type="text" /></br>
<p><font color="Blue">الرقم السري*</font>: </p><input name="passwords" type="password" /></br>
<p><font color="Blue">البريد اﻻلكتروني*</font>:</p><input name="email" type="text" /></br>
<input type="submit" value="Enter" />
</from>
</td>
</table>
</body>
</html>'''
@post('/login')
def login_submit():
username= request.forms.get('usernames')
password= request.forms.get('passwords')
email = request.forms.get('email')
insinfo(username,password,email)
debug(True)
run(host='localhost',port=8080)
كود ملف css
https://gist.github....-Hassan/5075909
كود
اﻻشتقاقات(template(
https://gist.github....-Hassan/5075914
هذه هي مشكلتي اكثر من اسبوع اعمل على حلها وسبحان الله لم استطع
