Пример #1
0
"""CollegeManagementSystem URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    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 include, path
from rest_framework.urlpatterns import format_suffix_patterns
from home.views import LogInView, LogOutView
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('home.urls')),
    path('home/', include('home.urls')),
    path('c', include('rest_framework.urls')),
    path('login/', LogInView.as_view()),
    path('logout/', LogOutView.as_view()),
    path('check/', include('home.api_urls')),
]
Пример #2
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from djgeojson.views import GeoJSONLayerView
from reports.models import Entry, Report
from home.views import HomePageView, SignUpView, LoginView, LogOutView, PortalView
from django.contrib.auth.decorators import login_required, permission_required


urlpatterns = patterns(
    "",
    # Examples:
    # url(r'^$', 'mrtagis.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r"^$", HomePageView.as_view(), name="home"),
    url(r"^p/$", login_required(PortalView.as_view()), name="portal"),
    # url(r'^p/$', PortalView.as_view(),name='portal'),
    url(r"^accounts/register/$", SignUpView.as_view(), name="signup"),
    url(r"^accounts/login/$", LoginView.as_view(), name="login"),
    url(r"^accounts/logout/$", LogOutView.as_view(), name="logout"),
    # url(r'p/?P<portal>/$', HomePageView.as_view(), name ='portal'),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^signups/", include("signups.urls")),
    url(r"^reports/", include("reports.urls", namespace="reports")),
    url(r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT}),
    url(r"^language/(?P<language>[a-zA-Z\-]+)/$", "reports.views.language"),
    url(r"^data.geojson$", GeoJSONLayerView.as_view(model=Report), name="data"),
    url(r"^p/save_marker/$", "home.views.save_marker", name="save_marker"),
    url(r"^p/remove_marker/$", "home.views.remove_marker", name="remove_marker"),
)
Пример #3
0
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.contrib.auth.decorators import login_required

from home.views import HomeView, LogOutView

admin.autodiscover()

urlpatterns = patterns('',
    url(r'', include('social_auth.urls')),

    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^logout/$', login_required(LogOutView.as_view()), name='logout'),
    url(r'^entries/', include('entries.urls', namespace='entries')),
    url(r'^profiles/', include('profiles.urls', namespace='profiles')),

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

if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
        }),
    )