Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    horus 0.9.9

    Download button

    No screenshots available
    Downloads: 71  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    John Anderson (sontek) | More programs
    BSD License / FREE
    August 31st, 2012, 16:07 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    horus description

    Generic user registration for pyramid

    horus is a generic user registration system for pyramid.

    Getting Started

    First, Install the dependencies of the project:

      pip install -r requirements.txt

     python setup.py develop

    Next, run our console script to setup the database:

      su_setup

    Finally, to include horus in your project, in your apps configuration, you should include the package pyramid_mailer for the validation e-mail and forgot password e-mail and tell horus which session to use for the database objects.

     config.include('pyramid_mailer')
     from horus.interfaces import IHorusSession
     config.registry.registerUtility(DBSession, IHorusSession)
     config.include('horus')


    horus does not require pyramid_tm or the ZopeTransactionManager with your session but if you do not use them you do have to take one extra step, we don't commit transactions for you because that just wouldn't be nice!

    All you have to do is to subscribe to the extension events and commit the session yourself, this also gives you the ability to do some extra processing before processing is finished:

    from horus.events import PasswordResetEvent
    from horus.events import NewRegistrationEvent
    from horus.events import RegistrationActivatedEvent
    from horus.events import ProfileUpdatedEvent

    def handle_request(event):
     request = event.request
     session = request.registry.getUtility(IHorusSession)
     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)


    Extending horus

    If you would like to modify any of the forms in pyramid signup, you just need to register the new deform class to use in the registry.

    The interaces you have available to override from horus.interfaces:

     IHorusLoginForm

     IHorusRegisterForm

     IHorusForgotPasswordForm

     IHorusResetPasswordForm

     IHorusProfileForm

    This is how you would do it (uniform being a custom deform Form class):

     config.registry.registerUtility(UNIForm, IHorusLoginForm)

    If you would like to override the templates you can use pyramid's override asset functionality:

     config.override_asset(to_override='horus:templates/template.mako', override_with='your_package:templates/anothertemplate.mako')

    The templates you have available to override are:

     login.mako

     register.mako

     forgot_password.mako

     reset_password.mako

     profile.mako

    If you would like to override the templates with Jinja2, you just have to override the view configuration:

    config.add_view('horus.views.AuthController', attr='login', route_name='login',
     renderer='yourapp:templates/login.jinja2')
    config.add_view('horus.views.ForgotPasswordController', attr='forgot_password',
     route_name='forgot_password', renderer='yourapp:templates/forgot_password.jinja2')
    config.add_view('horus.views.ForgotPasswordController', attr='reset_password',
     route_name='reset_password', renderer='yourapp:templates/reset_password.jinja2')
    config.add_view('horus.views.RegisterController', attr='register',
     route_name='register', renderer='yourapp:templates/register.jinja2')
    config.add_view('horus.views.ProfileController', attr='profile',
     route_name='profile', renderer='yourapp:templates/profile.jinja2')


    Development

    If you would like to help make any changes to horus, you can run its unit tests with py.test:

      py.test

    and to check test coverage:

      py.test --cov-report term-missing --cov horus

    you might also consider running the tests in parallel:

      py.test -n4


    Product's homepage

    Requirements:

    · Python
    · pyramid

      


    TAGS:

    user registration | Python library | Python | pyramid | user

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM