Пример #1
0
from django.conf.urls.defaults import patterns, include, url
from cloudmailin.views import MailHandler
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from mailpost.views import create_post

urlpatterns = patterns('',
                       url(r'^books/', include('books.urls',namespace='books',app_name='books')),                       
                       url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='auth_logout'),
                       url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
                       url(r'^admin/', include(admin.site.urls)),
                       (r'^accounts/', include('registration_backend.urls',namespace="registration",app_name="registration")),
)

urlpatterns += patterns('django.contrib.staticfiles.views',
                        url(r'^static/(?P<path>.*)$', 'serve', kwargs={"insecure": True}),
                            url(r'^', include('bookere.frontend.urls',namespace='frontend',app_name='frontend')),
)

mail_handler = MailHandler()
mail_handler.register_address(
    address="*****@*****.**",
    secret= "9e6a1be956c7ef8aea57",    
    callback=create_post,
    )

urlpatterns += patterns('',
                       url(r'^cloudmailin/$', mail_handler),
                       )
Пример #2
0
                except Wallet.DoesNotExist:
                    return HttpResponseNotFound()


            elif subject.find('Debit') != -1:
                return HttpResponseNotFound()

        else:
            return HttpResponseNotFound()
    else:
        return HttpResponseNotFound()
        


mail_handler = MailHandler()
mail_handler.register_address(
    address='*****@*****.**',
    secret='c6f79f44035efd74581c',
    callback=extract_mail
)




def content_extractor(content):
    try:
        tmatch = re.search(r'Account Number[\t:,.0-9 ]+',content, re.IGNORECASE)#[\t:,.0-9 ]+
        account = (re.sub('[\t:,.a-zA-Z ]+', '', tmatch.group()))

        tmatch = re.search(r'Amount[\t:,.0-9 ]+',content, re.IGNORECASE)#[\t:,.0-9 ]+
Пример #3
0
                                     report='savings')
                    wall.save()

                except Wallet.DoesNotExist:
                    return HttpResponseNotFound()

            elif subject.find('Debit') != -1:
                return HttpResponseNotFound()

        else:
            return HttpResponseNotFound()
    else:
        return HttpResponseNotFound()


mail_handler = MailHandler()
mail_handler.register_address(address='*****@*****.**',
                              secret='c6f79f44035efd74581c',
                              callback=extract_mail)


def content_extractor(content):
    try:
        tmatch = re.search(r'Account Number[\t:,.0-9 ]+', content,
                           re.IGNORECASE)  #[\t:,.0-9 ]+
        account = (re.sub('[\t:,.a-zA-Z ]+', '', tmatch.group()))

        tmatch = re.search(r'Amount[\t:,.0-9 ]+', content,
                           re.IGNORECASE)  #[\t:,.0-9 ]+
        amount = float(re.sub('[\t:,a-zA-Z ]+', '', tmatch.group()))
Пример #4
0
dajaxice_autodiscover()


urlpatterns = patterns('',
                       url(r'^books/', include('books.urls',namespace='books',app_name='books')),                       
                       url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='auth_logout'),
                       url(r'^%s/' % settings.DAJAXICE_MEDIA_PREFIX, include('dajaxice.urls')),
                       url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
                       url(r'^admin/', include(admin.site.urls)),
                       url(r'^api/', include('bookere.api.urls')),
                       url(r'^accounts/', include('registration_backend.urls',namespace="registration",app_name="registration")),
                       url(r'^', include('bookere.frontend.urls',namespace='frontend',app_name='frontend')),
)


mail_handler = MailHandler()
my_address="*****@*****.**"
my_secret= "9e6a1be956c7ef8aea57"
mail_handler.register_address(
    address = my_address,
    secret = my_secret,
    callback = create_post,
    )

urlpatterns += patterns('',
                        url(r'^cloudmailin/$', mail_handler, name='cloudmailin'),
                        url(r'^fake_email_client/$', login_required(FakeEmailView.as_view(address=my_address, secret=my_secret))),
                        )

urlpatterns += patterns('django.contrib.staticfiles.views',
                        url(r'^static/(?P<path>.*)$', 'serve', kwargs={"insecure": True}),
Пример #5
0
from django.conf.urls.defaults import *
from cloudmailin.views import MailHandler

def mail_stub(**kwargs):
    pass

def mail_500(**kwargs):
    raise Exception('this is a made up exception')

mail_handler = MailHandler()
mail_handler.register_address(
    address='*****@*****.**',
    secret='notactuallysecret',
    callback=mail_stub
)
mail_handler.register_address(
    address='*****@*****.**',
    secret='notactuallysecret',
    callback=mail_500
)

urlpatterns = patterns('',
    url(r'^mail/$', mail_handler),
)
Пример #6
0
            recipient_list=[author.email],
            fail_silently=True)

    except Exception, e:

        logging.debug("[postbymail] 500: %s" % e.message)

        send_mail(subject=
                  '[TransparencyCaucus] Sorry, unable to create new blog post',
                  message='%s\n\n%s' % (e.message, text),
                  from_email='*****@*****.**',
                  recipient_list=[sender],
                  fail_silently=True)


mail_handler = MailHandler()
mail_handler.register_address(
    '*****@*****.**',
    '7eeb8b1cc3dc07d24f1e',
    postbymail,
)

urlpatterns = patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^(?P<year>\d{4})/(?P<slug>[0-9a-zA-Z_\-]+)/$',
        'act.views.post_detail',
        name='post_detail'),
    url(r'^blog/postbymail/$', mail_handler),
    url(r'^blog/', include('blogdor.urls')),
    url(r'^contact/', Hello()),
Пример #7
0
from mailstuff.views import create_post
urlpatterns = patterns(
    '',
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', direct_to_template, {'template': 'landing.html'}),
    url(r'^landing', direct_to_template, {'template': 'landing.html'}),
    url(r'^list/', 'reminders.views.list'),
    url(r'^log_view', 'reminders.views.log_view'),
    url(r'^logout_action', 'reminders.views.logout_action'),
    url(r'^send_reminder', 'reminders.views.send_a_reminder'),
    url(r'^reminders/', include('reminders.urls')),
    url(r'^accounts/', include('registration.urls')),
)

mail_handler = MailHandler()
mail_handler.register_address(
    address='*****@*****.**',
    secret='1966e09d704fd149bd60',
    callback=create_post,
)

urlpatterns += patterns(
    '',
    url(r'^cloudmailin/$', mail_handler),
)

urlpatterns += patterns(
    'django.contrib.staticfiles.views',
    url(r'^static/(?P<path>.*)$', 'serve', kwargs={"insecure": True}),
)
Пример #8
0
from django.views.generic.simple import direct_to_template
from cloudmailin.views import MailHandler
from mailstuff.views import create_post
urlpatterns = patterns('',
     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
     url(r'^admin/', include(admin.site.urls)),
     url(r'^$', direct_to_template, {'template': 'landing.html'}),
     url(r'^landing', direct_to_template, {'template': 'landing.html'}),
     url(r'^list/', 'reminders.views.list'),
     url(r'^log_view', 'reminders.views.log_view'),
     url(r'^logout_action', 'reminders.views.logout_action'),
     url(r'^send_reminder', 'reminders.views.send_a_reminder'),
     url(r'^reminders/', include('reminders.urls')),
     url(r'^accounts/', include('registration.urls')),
)

mail_handler = MailHandler()
mail_handler.register_address(
    address='*****@*****.**',
    secret='1966e09d704fd149bd60',
    callback=create_post,
)

urlpatterns += patterns('',
     url(r'^cloudmailin/$', mail_handler),
)

urlpatterns += patterns('django.contrib.staticfiles.views',
    url(r'^static/(?P<path>.*)$', 'serve', kwargs={"insecure": True}),
)