Esempio n. 1
0
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from posts.api import PostViewSet
from posts.views import HomeView, PostDetailView, NewPostView
from users.views import UsersView, UserPostView, LoginView, LogoutView, SignupView
from users.api import UserViewSet, UserPostViewSet

router = DefaultRouter()
router.register('posts', PostViewSet, base_name='posts')
router.register('users', UserViewSet, base_name='users')
router.register('blogs', UserPostViewSet, base_name='blogs')


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name="home"),
    path('blogs/<username>/<int:pk>', PostDetailView.as_view(), name="post-detail"),
    path('blogs/', UsersView.as_view(), name="user-list"),
    path('blogs/<username>', UserPostView.as_view(), name="user-post-list"),
    path('new-post', NewPostView.as_view(), name='new-post'),
    path('login', LoginView.as_view(), name='login'),
    path('logout', LogoutView.as_view(), name='logout'),
    path('signup', SignupView.as_view(), name='signup'),

    # API URLs
    path('api/v1/', include(router.urls)),
    #path('api/v1/blogs/', UserPostViewSet.as_view({'list'}), name='blog-list'),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Esempio n. 2
0
from posts.api import PostsViewSet, UserPostsAPIView
from posts.views import LatestPostsView, PostDetailView, NewPostView
from users.api import UsersViewSet, BlogsListAPIView
from users.views import BlogsListView, BlogView, LoginView, LogoutView, SignupView

# API
router = SimpleRouter()
router.register('api/posts', PostsViewSet, basename='posts_api')
router.register('api/users', UsersViewSet, basename='users_api')

urlpatterns = [
    path('admin/', admin.site.urls),
    # Users
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('signup/', SignupView.as_view(), name='signup'),
    # Blogs
    path('blogs/', BlogsListView.as_view(), name='blogs_list'),
    path('blogs/<str:username>/', BlogView.as_view(), name='user_blog'),
    path('blogs/<str:username>/<int:pk>',
         PostDetailView.as_view(),
         name='user_post'),
    # Posts
    path('', LatestPostsView.as_view(), name='home'),
    path('new/', NewPostView.as_view(), name='new_post'),
    # API
    path('api/blogs/', BlogsListAPIView.as_view(), name='blogs_api'),
    path('api/blogs/<str:username>',
         UserPostsAPIView.as_view(),
         name='user_posts')
] + router.urls
Esempio n. 3
0
from django.urls import path

from users.views import SignupView, SigninView

app_name = 'users'

urlpatterns = [
    path('', SignupView.as_view(), name='user_signup'),
    path('sign-in/', SigninView.as_view(), name='user_signin'),
]
Esempio n. 4
0
from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import logout
from users.views import (SignupView, SigninView, AccountSettingsView,
ForgotPasswordView)
from notes.views import NoteListView
from django.contrib import admin
admin.autodiscover()

urlpatterns = [
    # user relates urls
    url('admin/', admin.site.urls),

    url(r'^signup/', SignupView.as_view(), name='signup'),
    url(r'^signin/', SigninView.as_view(), name='signin'),
    url(r'^account/', login_required(AccountSettingsView.as_view()),
        name='account_settings'),
    url(r'^forgot-password/', ForgotPasswordView.as_view(),
        name='forgot_password'),
    url(r'^signout/$', logout,
        {'next_page': '/'}, name='signout'),

    # notes
    url(r'^notes/', include('notes.urls')),
    # pads
    url(r'^pads/', include('pads.urls')),

    url(r'^$', login_required(NoteListView.as_view()), name='home'),
]
Esempio n. 5
0
from django.conf.urls import url

from users.views import (
    DashboardView,
    LoginView,
    LogoutView,
    SignupView,
    SignupAPIView,
    UserProfileAPIView,
)

urlpatterns = [
    url(r'^signup/$', SignupView.as_view(), name='signup'),
    url(r'^dashboard(?:/(?P<cat_id>[\d]+))?/$', DashboardView.as_view(), name='dashboard'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^api/user-signup/$', SignupAPIView.as_view(), name='api_signup'),
    url(r'^api/userprofile/$', UserProfileAPIView.as_view(), name='api_userprofile'),
]
Esempio n. 6
0
from but.views import HomeView
from users.views import SignupView, logout_user,\
        UserLoginView, UserProfileView, UserProfileModifyView
from trades.views import SellCreateView, GoodsListView,\
    GoodsDetailView, SellUpdateView, OrderPageView, OrderCheckView,\
    OrderCompleteView, CommentAttachView, send_email

from trades.api import *
from users.api import UserCheckAPIView, UserEmailAPIView, CertificateUserPhone, \
        CheckCertificatePhone

urlpatterns = [

    url(r'^admin/', admin.site.urls),
    url(r'^$', HomeView.as_view(), name="home"),
    url(r'^signup/$', SignupView.as_view(), name="signup"),
    url(r'^login/$', UserLoginView.as_view(), name="login"),
    url(r'^logout/$', logout_user, name="logout"),
    url(r'^register/goods/$', SellCreateView.as_view(), name="register_goods"),
    url(r'^sell/list/$', GoodsListView.as_view(), name="goods_list"),
    url(r'^sell/(?P<slug>\w+)/modify/$', SellUpdateView.as_view(), name="goods_modify"),
    url(r'^sell/(?P<slug>\w+)/comment/$', CommentAttachAPIView.as_view(), name="attach_comment"),
    url(r'^sell/(?P<slug>\w+)/$', GoodsDetailView.as_view(), name="goods_detail"),

    url(r'^api/sell/(?P<pk>\d+)/comment/$', CommentAPIView.as_view(), name="api_sell_comment"),
    url(r'^api/sell/(?P<pk>\d+)/$', SellDetailAPIView.as_view(), name="api_sell_detail"),
    url(r'^api/sell/$', SellListAPIView.as_view(), name="api_sell_list"),
    url(r'^api/user_check/$', UserCheckAPIView.as_view(), name="user_check"),
    url(r'^api/email_check/$', UserEmailAPIView.as_view(), name="email_check"),
    url(r'^api/phone_certificate/$', CertificateUserPhone.as_view(), name="phone_check"),
    url(r'^api/phone_certificate/check/$', CheckCertificatePhone.as_view(), name="phone_certificate"),
Esempio n. 7
0
from django.urls import path
from users.views import SignupView,SigninView

urlpatterns = [
    path('/signup',SignupView.as_view()),
    path('/signin',SigninView.as_view()),
]
Esempio n. 8
0
    url(r'^new-post$', CreatePostView.as_view(), name='create_post'),
    url(r'^update-post/(?P<pk>[-\w]+)/(?P<idPost>[0-9]+)/$', UpdatePostView.as_view(), name='update_post'),

    # Posts API URLs
    # Listado de posts para la home/Creacion de un post nuevo
    url(r'api/1.0/posts/$', PostListAPI.as_view(), name='post_list_api'),

    #Blogs URLs
    url(r'^blogs/$', BlogsView.as_view(), name='blogs'),
    url(r'^blogs/(?P<pk>[-\w]+)/$', DetailBlogView.as_view(), name='blog_detail'),

    # Blogs API URLs
    # Listado de blogs
    url(r'api/1.0/blogs/$', BlogsListAPI.as_view(), name='blog_list_api'),
    # Detalle de un blog: listado de posts del blog
    url(r'api/1.0/blogs/(?P<pk>[-\w]+)/$', BlogDetailAPI.as_view(), name='blog_detail_api'),
    # Detalle/Actualizacion/Borrado de un post
    url(r'api/1.0/blogs/(?P<pk>[-\w]+)/(?P<idPost>[0-9]+)/$', PostDetailAPI.as_view(), name='blog_detail_api'),

    #Users URLs
    url(r'^login', LoginView.as_view(), name='users_login'),
    url(r'^logout', LogoutView.as_view(), name='users_logout'),
    url(r'^signup', SignupView.as_view(), name='users_signup'),

    # Users API URLs
    #Listar usuarios/Crear un nuevo usuario
    url(r'api/1.0/users/$', UserListAPI.as_view(), name='user_list_api'),
    # Detalle/Actualizacion/Borrado de un usuario
    url(r'api/1.0/users/(?P<pk>[0-9]+)$', UserDetailAPI.as_view(), name='user_detail_api')
]
Esempio n. 9
0
from django.urls import path, re_path, include

from users.views import SignupView, LoginView

urlpatterns = [
    path('signup/', SignupView.as_view()),
    path('login/', LoginView.as_view()),
]
Esempio n. 10
0
router = DefaultRouter()
router.register("users", UserViewSet, base_name="users_api")
router.register("blogs", BlogViewSet, base_name="blogs_api")
router.register("posts", PostViewSet, base_name="posts_api")

urlpatterns = [
    url(r'^admin/', admin.site.urls),

#web en backend
    url(r'^$', posts_list, name="posts_list"),
    url(r'^blogs/?$', blogs_list, name="blogs_list"),
    url(r'^blog/(?P<blog_id>[0-9]+)/?$', blog_detail, name="blog_detail"),
    url(r'^blogs/(?P<username>[\w.%+-]+)/?$', posts_username_list, name="posts_username_list"),
    url(r'^blogs/(?P<username>[\w.%+-]+)/(?P<post_id>[0-9]+)/?$', post_complete, name="post_complete"),
    url(r'^new-post/?$', NewPostView.as_view(), name="new_post"),
    url(r'^new-blog/?$', NewBlogView.as_view(), name="new_blog"),

    #Acceso al sistema
    url(r'^login/?$', LoginView.as_view(), name="login"),
    url(r'^signup/?$', SignupView.as_view(), name="signup"),
    url(r'^logout/?$', logout, name="logout"),

#API
    url(r'^api/0.1/blogs/$', BlogsAPI.as_view(), name="blogs_api"),
# API Routers
    url(r'^api/1.0/', include(router.urls)),

]

Esempio n. 11
0
from Rodzynka import settings
from calendars.views import CalendarDetailView, EventCreateView, CalendarCreateView, CalendarSetUsersView, \
    EventDeleteView, EventUpdateView
from family.views import FamilyMainView, FamilyPickView, IndexView, FamilyCreateView, FamilyInviteView, FamilyJoinView, \
    FamilyAddUserView, FamilyRequestJoinView
from gallery.views import GalleryPickView, GalleryDetailView, GalleryMediaCreateView, GalleryMediaDeleteView, \
    GalleryDeleteView, GalleryCreateView
from users.views import SignupView
from wishlist.views import WishlistView, WishCreateView, WishDeleteView, WishUpdateView

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^login/$', LoginView.as_view(), name='login'),
    re_path(r'^logout/$', LogoutView.as_view(), name='logout'),
    re_path(r'^signup/$', SignupView.as_view(), name='signup'),

    re_path(r'^$', IndexView.as_view(), name='index'),

    re_path(r'^family/pick/$', FamilyPickView.as_view(), name='family_pick'),
    re_path(r'^family/create/$', FamilyCreateView.as_view(), name='family_create'),
    re_path(r'^family/requestjoin/$', FamilyRequestJoinView.as_view(), name='family_request_join'),
    re_path(r'^family/(?P<family_slug>[a-z\d-]+)/add/(?P<user_pk>[\d]+)/$',
            FamilyAddUserView.as_view(), name='family_add_user'),
    re_path(r'^family/(?P<family_slug>[a-z\d-]+)/$', FamilyMainView.as_view(), name='family_main'),
    re_path(r'^family/(?P<family_slug>[a-z\d-]+)/invite/$', FamilyInviteView.as_view(), name='family_invite'),
    re_path(r'^family/(?P<family_slug>[a-z\d-]+)/join/$', FamilyJoinView.as_view(), name='family_join'),

    re_path(r'^family/(?P<family_slug>[a-z\d-]+)/gallery/pick/$', GalleryPickView.as_view(), name='gallery_pick'),
    re_path(r'^family/(?P<family_slug>[a-z\d-]+)/gallery/(?P<gallery_pk>[\d]+)/$',
            GalleryDetailView.as_view(), name='gallery_detail'),
Esempio n. 12
0
from django.urls import path

from rest_framework_simplejwt.views import (
    TokenObtainPairView
)

from users.views import SignupView

urlpatterns = [
    path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('signup/', SignupView.as_view(), name='sign_up_user')
]
Esempio n. 13
0
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from users.api import UsersViewSet
from users.views import LoginView, LogoutView, SignupView, UsersView

router = DefaultRouter()
router.register('users', UsersViewSet, base_name='users')

urlpatterns = [

    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('register/', SignupView.as_view(), name='signup'),

    path('users/', UsersView.as_view(), name='users'),


    # API
    path('api/1.0/', include(router.urls)),
]
Esempio n. 14
0
from battling.views import (
    BattleListView,
    CreateBattleView,
    CreateTeamView,
    DeleteBattleView,
    DetailBattleView,
    HomeView,
)
from users.views import LoginView, SignupView


urlpatterns = [
    path("", HomeView.as_view(), name="home"),
    path("account/login/", LoginView.as_view(), name="login"),
    path("account/logout/", LogoutView.as_view(next_page="login"), name="logout"),
    path("account/signup/", SignupView.as_view(), name="signup"),
    path("battle/new/", CreateBattleView.as_view(), name="create_battle"),
    path("battle/list/", BattleListView.as_view(), name="battle_list"),
    path("team/<int:pk>/edit/", CreateTeamView.as_view(), name="create_team"),
    path("battle/<int:pk>/delete/", DeleteBattleView.as_view(), name="delete_battle"),
    path("battle/<int:pk>/detail/", DetailBattleView.as_view(), name="battle_detail"),
    path("oauth/", include("social_django.urls"), name="social"),
    # Signup urls
    path(
        "signup/<uidb64>/<token>/",
        views.PasswordResetConfirmView.as_view(
            template_name="registration/signup_confirm.html",
            success_url=reverse_lazy("signup_complete"),
        ),
        name="signup_confirm",
    ),
Esempio n. 15
0
urlpatterns = [
    # Profile.
    path(
        'profile/@<str:username>/',
        ProfileDetailView.as_view(),
        name='profile_detail'
    ),

    # Management of user.
    path(
        'login/',
        PlatzigramLoginView.as_view(),
        name='login'
    ),
    path(
        'logout/',
        PlatzigramLogoutView.as_view(),
        name='logout'
     ),
    path(
        'signup/',
        SignupView.as_view(),
        name='signup'
    ),
    path(
        'update_profile/',
        UpdateProfileView.as_view(),
        name='update_profile'
    ),
]
Esempio n. 16
0
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter

from users.api import SignupAPI, UserDetailAPI, BlogsListViewSet
from users.views import LoginView, LogoutView, BlogsView, SignupView

router = DefaultRouter()
router.register('api/1.0/blogs', BlogsListViewSet, base_name='api_blogs')

urlpatterns = [
    #Web URLs
    url(r'^login$', LoginView.as_view(), name='users_login'),
    url(r'^logout$', LogoutView.as_view(), name='users_logout'),
    url(r'^signup$', SignupView.as_view(), name='users_signup'),
    url(r'^blogs/$', BlogsView.as_view(), name='users_blogs'),

    #API URLs
    # url(r'^api/1.0/blogs$', BlogsListAPI.as_view(), name='api_blogslist'),
    url(r'^api/1.0/users/(?P<blogger>[a-z0-9_-]+)$',
        UserDetailAPI.as_view(),
        name='api_userdetail'),
    url(r'^api/1.0/signup$', SignupAPI.as_view(), name='api_signup'),
    url(r'', include(router.urls))
]
Esempio n. 17
0
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

from contents.api_views import CreateEntryAPIView
from contents.views import HomePageListView, EntryListView, NewTopicView, today_in_history, TopicSearchListView, ChannelTopicsListView
from interactions.views import MessageCreate, MessagesView, NewMessageView, get_message_history, get_message_poll, \
    poll_message_count
from users.views import SignupView, UserProfileEntryView, UserProfileFavoriteView, UserProfileVoteView
from interactions.api_views import CreateFavoriteAPIView, CreateVoteAPIView, DestroyVoteAPIView, DestroyFavoriteAPIView

urlpatterns = [
    path('admin/', admin.site.urls),
    path("signup/", SignupView.as_view(), name="signup"),
    path("login/", LoginView.as_view(template_name="login.html"),
         name="login"),
    path("logout/", LogoutView.as_view(), name="logout"),
    path('messages/<int:user_id>/<str:slug>/',
         MessagesView.as_view(),
         name="messagesRoute"),
    path('messages/', MessagesView.as_view(), name="allMessages"),
    path('messages/new/', NewMessageView.as_view(), name="newMessage"),
    path('ajax/messages/new/',
         login_required(MessageCreate.as_view()),
         name="newMessageAjax"),
    path('ajax/messages/count', poll_message_count, name="messageCountAjax"),
    path('ajax/messages/get', get_message_poll, name="messageGetAjax"),
    path('ajax/messages/history',
         get_message_history,
Esempio n. 18
0
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

from blog.api import PostDetailAPI, PostsListAPI
from blog.views import post_detail, MyPostsView, home, CreatePostView, blog_list
from users.api import UsersListAPI, UsersDetailAPI, UsersBlogsAPI
from users.views import LoginView, logout, SignupView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('login', LoginView.as_view(), name="login_page"),
    path('logout', logout, name="logout_page"),
    path('signup', SignupView.as_view(), name="signup_page"),
    path('new-post', CreatePostView.as_view(), name="create_post_page"),
    path('blogs/', blog_list, name="blogs_list_page"),
    path('blogs/<username>/<int:pk>', post_detail, name="post_detail_page"),
    path('blogs/<username>', MyPostsView.as_view(), name="post_by_blog_page"),
    path('', home, name="home_page"),

    # API REST
    path('api/1.0/users/<int:pk>',
         UsersDetailAPI.as_view(),
         name="api_users_detail"),
    path('api/1.0/users/', UsersListAPI.as_view(), name="api_users_list"),
    path('api/1.0/blogs/', UsersBlogsAPI.as_view(), name="api_users_blogs"),
    path('api/1.0/blog/<str:username>/<int:pk>',
         PostDetailAPI.as_view(),
         name="api_blog_post_detail"),
Esempio n. 19
0
    path('api/target-list', TargetListAPI.as_view(), name='target-list-api'),
    path('api/signal-create/',
         SignalCreateAPI.as_view(),
         name='signal-create-api'),
    path('api/signal-update/<int:pk>/',
         SignalUpdateAPI.as_view(),
         name='signal-update-api'),
    path('api/condition-create/',
         ConditionCreateAPI.as_view(),
         name='condition-create-api'),
    path('api/coin-detail/<slug:slug>/',
         CoinDetailAPI.as_view(),
         name='coin-detial-api'),
    path('login/', LoginView.as_view(), name='account_login'),
    path('logout/', LogoutView.as_view(), name='account_logout'),
    path('signup/', SignupView.as_view(), name='account_signup'),
    path('reset-password/',
         PasswordResetView.as_view(),
         name='account_reset_password'),
    path('confirm-email/(?P<key>[-:\w]+)/',
         confirm_email,
         name='account_confirm_email'),

    # password reset
    path('password/reset/', password_reset, name='account_reset_password'),
    path('password/reset/done/',
         password_reset_done,
         name='account_reset_password_done'),
    path('password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/',
         password_reset_from_key,
         name='account_reset_password_from_key'),
from users.views import LoginView, LogoutView, SignupView
from blogs.views import BlogsView

urlpatterns = [
    # (?P<pk>[0-9]+) => valor en parámetro pk (?P<pk>), que será 1 o más números del 0 al 9

    url(r'^admin/', include(admin.site.urls)),

    # urls nombradas
    url(r'^blogs/$', BlogsView.as_view(), name='blog_home'),    # listado de blogs, con vista basada en clase BlogsView
    url(r'^$', HomeView.as_view(), name='post_home'),           # listado de posts publicados, con vista basada en clase HomeView
    url(r'^blogs/(?P<username>[a-z]+)/$', UserPostsView.as_view(), name='blog_posts'),     # listado posts blog usuario, basada en la clase UserPostView
    url(r'^blogs/(?P<username>[a-zA-Z]+)/(?P<post_id>[0-9]+)$', DetailView.as_view(), name='post_detail'),   # detalle post, basado en clase DetailView


    url(r'^signup/$', SignupView.as_view(), name='user_signup'), # signup o creación de cuenta de usuario, con vista basada en clase SignupView
    url(r'^login$', LoginView.as_view(), name='user_login'),    # login, con vista basada en clase LoginView
    url(r'^logout$', LogoutView.as_view(), name='user_logout'), # logout, con vista basada en clase LogoutView

    url(r'^new-post/$', CreateView.as_view(), name='post_create'),   # creación nuevo post, con vista basada en clase CreateView


    # Users' API URLs
    url(r'^api/1.0/users/$', UserListAPI.as_view(), name='user_list_api'),      # url con listado de users para la API, basado en clases
    url(r'^api/1.0/users/(?P<pk>[0-9]+)$', UserDetailAPI.as_view(), name='user_detail_api'),     #url detalle usuario para la api

    # Posts' API URLs
    url(r'^api/1.0/blogs/(?P<username>[a-z]+)/$', PostListAPI.as_view(), name='post_list_api'),     # API listado de posts de blog
    url(r'^api/1.0/posts/(?P<pk>[0-9]+)$', PostDetailAPI.as_view(), name='post_detail_api'),     # API detalle de post: CRUD.

    # Blogs' API URLs
Esempio n. 21
0
from django.urls import path

from users.views import LoginView, LogoutView, ProfileView, SignupView

app_name = 'users'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('cadastro/', SignupView.as_view(), name='signup'),
    path('perfil/<int:pk>', ProfileView.as_view(), name='profile'),
]