from django.conf.urls import include, url from views import ProjectDetailView, ProjectCreateView, ProjectUpdateView, \ ProjectDeleteView, ProjectListView, create_version urlpatterns = [ url(r'^create/$', ProjectCreateView.as_view(), name='project-create'), url(r'^list/$', ProjectListView.as_view(), name='project-list'), url(r'^(?P<slug>[\w-]+)/$', ProjectDetailView.as_view(), name='project-detail'), url(r'^(?P<slug>[\w-]+)/edit/$', ProjectUpdateView.as_view(), name='project-edit'), url(r'^(?P<slug>[\w-]+)/delete/$', ProjectDeleteView.as_view(), name='project-delete'), url(r'^(?P<slug>[\w-]+)/create-version/$', create_version, name='project-create-version'), ]
from django.conf.urls import patterns, url from django.views.generic import ListView from models import Project from views import ProjectDetailView urlpatterns = \ patterns('', url(r'^$', ListView.as_view(queryset=Project.objects.order_by('ranking')[:3], context_object_name='project_list', template_name='index.html')), url(r'^(?P<pk>\d+)/$', ProjectDetailView.as_view()), )
# basic app views url(regex='^$', view=ProjectListView.as_view(), name='home'), # Project management url(regex='^pending-project/list/$', view=PendingProjectListView.as_view(), name='pending-project-list'), url(regex='^approve-project/(?P<pk>\d+)/$', view=ApproveProjectView.as_view(), name='project-approve'), url(regex='^project/list/$', view=ProjectListView.as_view(), name='project-list'), url(regex='^project/(?P<pk>\d+)/$', view=ProjectDetailView.as_view(), name='project-detail'), url(regex='^project/delete/(?P<pk>\d+)/$', view=ProjectDeleteView.as_view(), name='project-delete'), url(regex='^project/create/$', view=ProjectCreateView.as_view(), name='project-create'), url(regex='^project/update/(?P<pk>\d+)/$', view=ProjectUpdateView.as_view(), name='project-update'), # Category management # This view is only accessible via ajax url(regex='^json-category/list/(?P<version>\d+)/$',
from django.conf.urls.defaults import * from views import OrganizationDetailView, ProjectDetailView urlpatterns = patterns('', url(r'organizations/(?P<organization_id>[0-9a-f]{32,32})/$', OrganizationDetailView.as_view(), name='organization_detail_by_id'), url(r'organizations/(?P<slug>[0-9a-z-]+)/$', OrganizationDetailView.as_view(), name='organization_detail'), url(r'projects/(?P<project_id>[0-9a-f]{32,32})/$', ProjectDetailView.as_view(), name='project_detail_by_id'), url(r'projects/(?P<slug>[0-9a-z-]+)/$', ProjectDetailView.as_view(), name='project_detail'), )
ProjectDeleteView, ProjectCreateView, ProjectListView, ProjectUpdateView, PendingProjectListView, ApproveProjectView, ProjectBallotListView, ) urlpatterns = patterns( "", # basic app views url(regex="^$", view=ProjectListView.as_view(), name="home"), # Project management url(regex="^pending-project/list/$", view=PendingProjectListView.as_view(), name="pending-project-list"), url(regex="^approve-project/(?P<slug>[\w-]+)/$", view=ApproveProjectView.as_view(), name="project-approve"), url(regex="^project/list/$", view=ProjectListView.as_view(), name="project-list"), url(regex="^(?P<slug>[\w-]+)/$", view=ProjectDetailView.as_view(), name="project-detail"), url(regex="^(?P<slug>[\w-]+)/ballots/$", view=ProjectBallotListView.as_view(), name="project-ballot-list"), url(regex="^project/(?P<slug>[\w-]+)/delete/$", view=ProjectDeleteView.as_view(), name="project-delete"), url(regex="^project/create/$", view=ProjectCreateView.as_view(), name="project-create"), url(regex="^project/(?P<slug>[\w-]+)/update/$", view=ProjectUpdateView.as_view(), name="project-update"), ) if settings.DEBUG: # static files (images, css, javascript, etc.) urlpatterns += patterns( "", (r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT}) )