from django.conf.urls import patterns, include, url
from notes.views import NotesView

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^$', NotesView.as_view(), name="text_notes"),
    # url(r'^hellodjango/', include('hellodjango.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)
Exemplo n.º 2
0
# API urls
v1_api = Api(api_name='v1')
v1_api.register(NoteResource())
v1_api.register(NotebookResource())
v1_api.register(DummyNoteResource())
v1_api.register(SharedNoteResource())
v1_api.register(NewsResource())
v1_api.register(CreateUserResource())
v1_api.register(UserResource())
v1_api.register(PasswordRecoveryResource())

urlpatterns = patterns('',
    url(r'^api/', include(v1_api.urls)),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^upload/', include('uploads.urls')),
    url(r'^i/(?P<filename>.+)', S3RedirectView.as_view(), name='image'),
    url(r'^$', TemplateView.as_view(template_name="home.html"), name='homepage'),
    url(r'^feedback/$', TemplateView.as_view(template_name="feedback.html"), name='feedback'),

    url(r'^app/$', NotesView.as_view(), name='index'),
    url(r'^\+(?P<public_id>[a-z0-9]+)/$', SharedNoteRedirectView.as_view(), name='shared_note'),

    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm',
        kwargs={'template_name': 'auth/password_reset_confirm.html'}),
    url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete',
        name='password_reset_complete',
        kwargs={'template_name': 'auth/password_reset_complete.html'}),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 3
0
v1_api.register(CreateUserResource())
v1_api.register(UserResource())
v1_api.register(PasswordRecoveryResource())

urlpatterns = patterns(
    '',
    url(r'^api/', include(v1_api.urls)),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^upload/', include('uploads.urls')),
    url(r'^i/(?P<filename>.+)', S3RedirectView.as_view(), name='image'),
    url(r'^$',
        TemplateView.as_view(template_name="home.html"),
        name='homepage'),
    url(r'^feedback/$',
        TemplateView.as_view(template_name="feedback.html"),
        name='feedback'),
    url(r'^app/$', NotesView.as_view(), name='index'),
    url(r'^\+(?P<public_id>[a-z0-9]+)/$',
        SharedNoteRedirectView.as_view(),
        name='shared_note'),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        'django.contrib.auth.views.password_reset_confirm',
        name='password_reset_confirm',
        kwargs={'template_name': 'auth/password_reset_confirm.html'}),
    url(r'^reset/done/$',
        'django.contrib.auth.views.password_reset_complete',
        name='password_reset_complete',
        kwargs={'template_name': 'auth/password_reset_complete.html'}),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(
    settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: liuyc
@file: url.py
@time: 2017/1/14 11:13
@describe:
"""
from django.conf.urls import url, include

from notes.views import NotesView, NotesDetailView, NotesEditorView, NewEditorView

urlpatterns = [
    # 笔记列表
    url(r'^list/$', NotesView.as_view(), name="note_list"),

    # 笔记详情
    url(r'^detail/(?P<note_id>\d+)/$',
        NotesDetailView.as_view(),
        name="note_detail"),

    # 编辑
    url(r'^editor/(?P<note_id>\d+)/$',
        NotesEditorView.as_view(),
        name="note_editor"),

    # 增加笔记
    url(r'^editor/$', NewEditorView.as_view(), name="new_editor"),
]