pyramid_signup

ภาพหน้าจอของซอฟแวร์:
pyramid_signup
รายละเอียดซอฟแวร์:
รุ่น: 0.2
วันที่อัพโหลด: 14 Apr 15
ผู้พัฒนา: John Anderson (sontek)
การอนุญาต: ฟรี
ความนิยม: 2

Rating: 4.0/5 (Total Votes: 1)

pyramid_signup เป็นระบบลงทะเบียนผู้ใช้ทั่วไปสำหรับปิรามิด
เริ่มต้น
ครั้งแรกที่ติดตั้งการอ้างอิงของโครงการ:
& nbsp; PIP ติดตั้ง requirements.txt -r
& nbsp; หลาม setup.py พัฒนา
ถัดไปเรียกใช้สคริปต์คอนโซลของเราในการติดตั้งระบบฐานข้อมูล:
& nbsp; su_setup
สุดท้ายที่จะรวม pyramid_signup ในโครงการของคุณในการกำหนดค่าปพลิเคชันของคุณคุณควรจะรวมถึง pyramid_mailer แพคเกจสำหรับ e-mail ของการตรวจสอบและลืมอีเมลรหัสผ่านและบอก pyramid_signup ที่เซสชั่นที่จะใช้สำหรับวัตถุฐานข้อมูล
& nbsp; config.include ('pyramid_mailer')
& nbsp; จาก pyramid_signup.interfaces นำเข้า ISUSession
& nbsp; config.registry.registerUtility (DBSession, ISUSession)
& nbsp; config.include ('pyramid_signup')
pyramid_signup ไม่ต้อง pyramid_tm หรือ ZopeTransactionManager กับเซสชั่นของคุณ แต่ถ้าคุณไม่ได้ใช้พวกเขาที่คุณจะต้องใช้เวลาหนึ่งขั้นตอนพิเศษที่เราไม่ได้กระทำการทำธุรกรรมสำหรับคุณเพราะที่เพิ่งจะไม่ดี!
สิ่งที่คุณต้องทำคือการสมัครเป็นสมาชิกกับเหตุการณ์การขยายและกระทำตัวเองเซสชั่นนี้ยังช่วยให้คุณสามารถที่จะทำบางการประมวลผลพิเศษก่อนการประมวลผลเสร็จสิ้น:
จากการนำเข้า pyramid_signup.events PasswordResetEvent
จากการนำเข้า pyramid_signup.events NewRegistrationEvent
จากการนำเข้า pyramid_signup.events RegistrationActivatedEvent
จากการนำเข้า pyramid_signup.events ProfileUpdatedEvent
def handle_request (event) การ:
& nbsp; ขอ = event.request
& nbsp; เซสชั่น = request.registry.getUtility (ISUSession)
& nbsp; session.commit ()
self.config.add_subscriber (handle_request, PasswordResetEvent)
self.config.add_subscriber (handle_request, NewRegistrationEvent)
self.config.add_subscriber (handle_request, RegistrationActivatedEvent)
self.config.add_subscriber (handle_request, ProfileUpdatedEvent)
ขยาย pyramid_signup
หากคุณต้องการที่จะปรับเปลี่ยนรูปแบบใด ๆ ในการสมัครใช้ปิรามิด, คุณเพียงแค่ต้องลงทะเบียนชั้นทำให้เสียโฉมใหม่เพื่อใช้ในรีจิสทรี
interaces คุณมีการแทนที่จาก pyramid_signup.interfaces:
& nbsp; ISULoginForm
& nbsp; ISURegisterForm
& nbsp; ISUForgotPasswordForm
& nbsp; ISUResetPasswordForm
& nbsp; ISUProfileForm
นี่คือวิธีที่คุณจะทำมัน (เครื่องแบบเป็นชั้นแบบฟอร์มที่กำหนดเองทำให้เสียโฉม):
& nbsp; config.registry.registerUtility (Uniform, ISULoginForm)
หากคุณต้องการที่จะแทนที่แม่แบบที่คุณสามารถใช้ฟังก์ชันสินทรัพย์แทนที่ของปิรามิด:
& nbsp; config.override_asset (to_override = 'pyramid_signup: แม่แบบ / template.mako', override_with = 'your_package: แม่แบบ / anothertemplate.mako')
แม่แบบที่คุณมีอยู่เพื่อแทนที่คือ:
& nbsp; login.mako
& nbsp; register.mako
& nbsp; forgot_password.mako
& nbsp; reset_password.mako
& nbsp; profile.mako
หากคุณต้องการที่จะแทนที่แม่กับ Jinja2 คุณเพียงแค่ต้องที่จะแทนที่การตั้งค่ามุมมอง:
config.add_view ('pyramid_signup.views.AuthController', 'เข้าสู่ระบบ' attr = 'เข้าสู่ระบบ' route_name =
& nbsp; renderer = 'yourapp: แม่แบบ / login.jinja2')
config.add_view ('pyramid_signup.views.ForgotPasswordController', attr = 'FORGOT_PASSWORD',
& nbsp; route_name = 'FORGOT_PASSWORD', renderer = 'yourapp: แม่แบบ / forgot_password.jinja2')
config.add_view ('pyramid_signup.views.ForgotPasswordController', attr = 'reset_password',
& nbsp; route_name = 'reset_password', renderer = 'yourapp: แม่แบบ / reset_password.jinja2')
config.add_view ('pyramid_signup.views.RegisterController', attr = 'ลงทะเบียน',
& nbsp; route_name = 'ลงทะเบียน', renderer = 'yourapp: แม่แบบ / register.jinja2')
config.add_view ('pyramid_signup.views.ProfileController', attr = 'รายละเอียด'
& nbsp; route_name = 'รายละเอียด', renderer = 'yourapp: แม่แบบ / profile.jinja2')
การพัฒนา
หากคุณต้องการที่จะช่วยให้การเปลี่ยนแปลงใด ๆ pyramid_signup คุณสามารถเรียกใช้การทดสอบหน่วยกับ py.test:
& nbsp; py.test
และตรวจสอบความคุ้มครองการทดสอบ:
& nbsp; py.test --cov รายงานระยะที่ขาดหายไป --cov pyramid_signup
คุณอาจพิจารณาใช้การทดสอบในแบบคู่ขนาน:
& nbsp; py.test -n4

ต้องการ

  • หลาม
  • พีระมิด

ซอฟแวร์อื่น ๆ ของนักพัฒนา John Anderson (sontek)

deform_jinja2
deform_jinja2

20 Feb 15

hapi
hapi

20 Feb 15

pyramid_mustache
pyramid_mustache

20 Feb 15

ความคิดเห็นที่ pyramid_signup

ความคิดเห็นที่ไม่พบ
เพิ่มความคิดเห็น
เปิดภาพ!