def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings, root_factory=root_factory) #add root_folder property config.add_request_method(site_folder, reify=True) config.add_request_method(get_site_folder, reify=True) config.add_request_method(delegated_services, reify=True) config.add_request_method(valid_services, reify=True) config.add_request_method(is_site_moderator, reify=True) config.include('.graphql') #evolve steps config.add_evolution_step(customeraccount_evolve) config.add_evolution_step(site_urls_evolve) config.add_evolution_step(review_imgs_site_evolve) config.add_evolution_step(access_keys_evolve) config.add_evolution_step(publication_interval_evolve) config.add_evolution_step(remind_users_evolve) config.add_evolution_step(venue_hash_data_evolve) config.add_evolution_step(venue_artist_states_evolve) config.add_evolution_step(site_folder_tree_evolve) config.add_evolution_step(find_error_evolve) config.add_evolution_step(normalize_names_evolve) config.add_evolution_step(filter_evolve) config.add_evolution_step(keywords_evolve) config.add_evolution_step(reviwes_access_control_evolve) config.add_evolution_step(clean_reviews) config.add_evolution_step(venue_normalize_text) config.add_evolution_step(artist_normalize_text) config.add_evolution_step(event_normalize_text) config.add_evolution_step(reviw_normalize_text) config.add_evolution_step(clean_venues_duplicates) config.add_evolution_step(clean_artists_duplicates) config.add_evolution_step(negation_filter_evolve) config.add_evolution_step(evolve_services) config.add_evolution_step(filme_schedules_duplicates) config.add_evolution_step(update_coordinates) config.add_evolution_step(add_geo_mapping) config.add_evolution_step(add_url_storage) config.add_evolution_step(artist_hash_data_evolve) config.add_evolution_step(fix_contributors) config.add_evolution_step(change_index_for_object_zipcode_txt) config.add_evolution_step(update_zipcodes) config.add_evolution_step(reindex_venues) config.add_evolution_step(evolve_alerts) config.add_translation_dirs('lac:locale/') config.add_translation_dirs('pontus:locale/') config.add_translation_dirs('dace:locale/') config.add_translation_dirs('deform:locale/') config.add_translation_dirs('colander:locale/') config.scan() config.add_static_view('lacstatic', 'lac:static', cache_max_age=86400) # config.set_locale_negotiator(my_locale_negotiator) settings = config.registry.settings secret = settings.get('lac.secret') if secret is None: raise ConfigurationError( 'You must set a lac.secret key in your .ini file') session_factory = SignedCookieSessionFactory( secret, timeout=DEFAULT_SESSION_TIMEOUT, reissue_time=3600) config.set_session_factory(session_factory) auth_policy = AuthenticationStackPolicy() # Add an authentication policy with a one-hour timeout to control # access to sensitive information. auth_policy.add_policy( 'cookie', AuthTktAuthenticationPolicy(secret, callback=groupfinder)) # Add a second authentication policy with a one-year timeout so # we can identify the user. auth_policy.add_policy('basic', BasicAuthenticationPolicy(groupfinder)) config.set_authentication_policy(auth_policy) return config.make_wsgi_app()
def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings, root_factory=root_factory) #add root_folder property config.add_request_method(site_folder, reify=True) config.add_request_method(get_site_folder, reify=True) config.add_request_method(delegated_services, reify=True) config.add_request_method(valid_services, reify=True) config.add_request_method(is_site_moderator, reify=True) config.include('.graphql') #evolve steps config.add_evolution_step(customeraccount_evolve) config.add_evolution_step(site_urls_evolve) config.add_evolution_step(review_imgs_site_evolve) config.add_evolution_step(access_keys_evolve) config.add_evolution_step(publication_interval_evolve) config.add_evolution_step(remind_users_evolve) config.add_evolution_step(venue_hash_data_evolve) config.add_evolution_step(venue_artist_states_evolve) config.add_evolution_step(site_folder_tree_evolve) config.add_evolution_step(find_error_evolve) config.add_evolution_step(normalize_names_evolve) config.add_evolution_step(filter_evolve) config.add_evolution_step(keywords_evolve) config.add_evolution_step(reviwes_access_control_evolve) config.add_evolution_step(clean_reviews) config.add_evolution_step(venue_normalize_text) config.add_evolution_step(artist_normalize_text) config.add_evolution_step(event_normalize_text) config.add_evolution_step(reviw_normalize_text) config.add_evolution_step(clean_venues_duplicates) config.add_evolution_step(clean_artists_duplicates) config.add_evolution_step(negation_filter_evolve) config.add_evolution_step(evolve_services) config.add_evolution_step(filme_schedules_duplicates) config.add_evolution_step(update_coordinates) config.add_evolution_step(add_geo_mapping) config.add_evolution_step(add_url_storage) config.add_evolution_step(artist_hash_data_evolve) config.add_evolution_step(fix_contributors) config.add_evolution_step(change_index_for_object_zipcode_txt) config.add_evolution_step(update_zipcodes) config.add_evolution_step(reindex_venues) config.add_evolution_step(evolve_alerts) config.add_translation_dirs('lac:locale/') config.add_translation_dirs('pontus:locale/') config.add_translation_dirs('dace:locale/') config.add_translation_dirs('deform:locale/') config.add_translation_dirs('colander:locale/') config.scan() config.add_static_view('lacstatic', 'lac:static', cache_max_age=86400) # config.set_locale_negotiator(my_locale_negotiator) settings = config.registry.settings secret = settings.get('lac.secret') if secret is None: raise ConfigurationError( 'You must set a lac.secret key in your .ini file') session_factory = SignedCookieSessionFactory( secret, timeout=DEFAULT_SESSION_TIMEOUT, reissue_time=3600) config.set_session_factory(session_factory) auth_policy = AuthenticationStackPolicy() # Add an authentication policy with a one-hour timeout to control # access to sensitive information. auth_policy.add_policy( 'cookie', AuthTktAuthenticationPolicy(secret, callback=groupfinder)) # Add a second authentication policy with a one-year timeout so # we can identify the user. auth_policy.add_policy( 'basic', BasicAuthenticationPolicy(groupfinder)) config.set_authentication_policy(auth_policy) return config.make_wsgi_app()
def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings, root_factory=root_factory) config.add_request_method(ajax_api, reify=True) config.add_request_method(get_time_zone, reify=True) config.add_request_method(moderate_ideas, reify=True) config.add_request_method(moderate_proposals, reify=True) config.add_request_method(examine_ideas, reify=True) config.add_request_method(examine_proposals, reify=True) config.add_request_method(support_ideas, reify=True) config.add_request_method(support_proposals, reify=True) config.add_request_method(content_to_examine, reify=True) config.add_request_method(content_to_support, reify=True) config.add_request_method(accessible_to_anonymous, reify=True) config.add_request_method(searchable_contents, reify=True) config.add_request_method(analytics_default_content_types, reify=True) config.add_request_method(content_to_manage, reify=True) config.add_evolution_step(evolve_wg) config.add_evolution_step(evolve_states_ideas) config.add_evolution_step(evolve_state_files) config.add_evolution_step(update_len_comments) config.add_evolution_step(update_len_selections) config.add_evolution_step(evolve_process_def) config.add_evolution_step(evolve_comments) config.add_evolution_step(evolve_nodes) config.add_evolution_step(evolve_channels) config.add_evolution_step(evolve_person) config.add_evolution_step(evolve_channel_comments_at) config.add_evolution_step(subscribe_users_newsletter) config.add_evolution_step(evolve_roles_comments) config.add_evolution_step(evolve_alerts) config.add_evolution_step(evolve_alert_subjects) config.add_evolution_step(subscribe_users_notif_ids) config.add_evolution_step(evolve_mails) config.add_evolution_step(evolve_access_keys) config.add_evolution_step(format_ideas) config.add_evolution_step(publish_comments) config.add_evolution_step(evolve_nonproductive_cycle) config.add_evolution_step(evolve_files) config.add_evolution_step(evolve_add_nia_bot) config.add_evolution_step(add_guide_tour_data) config.add_evolution_step(init_guide_tour_data) config.add_evolution_step(evolve_related_correlation) config.add_evolution_step(publish_organizations) config.add_evolution_step(evolve_mails_languages) config.add_evolution_step(evolve_colors) config.add_evolution_step(evolve_usermanagement_process) config.add_evolution_step(evolve_idea_management_process) config.add_evolution_step(evolve_abstract_process) config.add_evolution_step(evolve_nia_comments) config.add_evolution_step(evolve_state_pontusFiles) config.add_evolution_step(evolve_person_tokens) config.add_evolution_step(evolve_examined_tokens) config.add_evolution_step(evolve_source_data) config.add_evolution_step(evolve_user_masks) config.add_evolution_step(evolve_amendmentmanagement_process) config.add_evolution_step(evolve_emojiable_data) config.add_evolution_step(evolve_invitation_organization_process) config.add_evolution_step(evolve_novaideoabstractprocess_process) config.add_translation_dirs('novaideo:locale/') config.add_translation_dirs('pontus:locale/') config.add_translation_dirs('dace:locale/') config.add_translation_dirs('deform:locale/') config.add_translation_dirs('colander:locale/') config.include('.graphql') config.include("pyramid_sms") config.scan() config.add_static_view('novaideostatic', 'novaideo:static', cache_max_age=86400) # config.add_subscriber(start_ioloop, IDatabaseOpenedWithRoot) config.set_locale_negotiator(my_locale_negotiator) settings = config.registry.settings secret = settings.get('novaideo.secret') if secret is None: raise ConfigurationError( 'You must set a novaideo.secret key in your .ini file') session_factory = SignedCookieSessionFactory( secret, timeout=DEFAULT_SESSION_TIMEOUT, reissue_time=3600) config.set_session_factory(session_factory) return config.make_wsgi_app()