A simple ticketing application written in Python/Django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

urls.py 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- coding: utf-8 -*-
  2. from django.conf.urls import patterns, include, url
  3. from django.contrib import admin
  4. import main.views
  5. from django.contrib.auth.decorators import login_required
  6. # to include media files at the end
  7. from django.conf import settings
  8. from django.conf.urls.static import static
  9. urlpatterns = patterns('',
  10. # Login and settings pages
  11. url(r'^$', 'django.contrib.auth.views.login'),
  12. url(r'^logout/$', 'django.contrib.auth.views.logout_then_login'),
  13. url(r'^settings/$', login_required(main.views.usersettings_update_view), name='user-settings'),
  14. # Django admin
  15. url(r'^admin/', include(admin.site.urls)),
  16. # create new ticket
  17. url(r'^ticket/new/$', login_required(main.views.ticket_create_view), name='ticket_new'),
  18. # edit ticket
  19. url(r'^ticket/edit/(?P<pk>\d+)/$', login_required(main.views.ticket_edit_view), name='ticket_edit'),
  20. # view ticket
  21. url(r'^ticket/(?P<pk>\d+)/$', login_required(main.views.ticket_detail_view), name='ticket_detail'),
  22. # create new followup
  23. url(r'^followup/new/$', login_required(main.views.followup_create_view), name='followup_new'),
  24. # edit followup
  25. url(r'^followup/edit/(?P<pk>\d+)/$', login_required(main.views.followup_edit_view), name='followup_edit'),
  26. # create new attachment
  27. url(r'^attachment/new/$', login_required(main.views.attachment_create_view), name='attachment_new'),
  28. # ticket overviews
  29. url(r'^inbox/$', login_required(main.views.inbox_view), name='inbox'),
  30. url(r'^my-tickets/$', login_required(main.views.my_tickets_view), name='my-tickets'),
  31. url(r'^all-tickets/$', login_required(main.views.all_tickets_view), name='all-tickets'),
  32. url(r'^archive/$', login_required(main.views.archive_view), name='archive'),
  33. ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)