2009-12-31 01:26:56 +03:00
|
|
|
from django.conf.urls.defaults import patterns, url, include
|
|
|
|
from django.contrib import admin
|
|
|
|
from django.shortcuts import redirect
|
|
|
|
|
2010-07-12 23:54:51 +04:00
|
|
|
from amo.urlresolvers import reverse
|
2009-12-31 01:43:25 +03:00
|
|
|
from . import views
|
|
|
|
|
2009-12-31 01:26:56 +03:00
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
|
|
|
# AMO stuff.
|
2010-04-14 02:59:28 +04:00
|
|
|
url('^$', lambda r: redirect('admin:index'), name='zadmin.home'),
|
2010-03-25 01:52:02 +03:00
|
|
|
url('^env$', views.env, name='amo.env'),
|
2010-04-14 02:59:28 +04:00
|
|
|
url('^flagged', views.flagged, name='zadmin.flagged'),
|
2010-06-30 02:28:40 +04:00
|
|
|
url('^hera', views.hera, name='zadmin.hera'),
|
2010-04-14 02:59:28 +04:00
|
|
|
url('^settings', views.settings, name='zadmin.settings'),
|
2009-12-31 01:26:56 +03:00
|
|
|
|
|
|
|
# The Django admin.
|
|
|
|
url('^models/', include(admin.site.urls)),
|
|
|
|
)
|
2010-07-12 23:54:51 +04:00
|
|
|
|
|
|
|
|
|
|
|
# Hijack the admin's login to use our pages.
|
|
|
|
def login(request):
|
|
|
|
url = '%s?to=%s' % (reverse('users.login'), request.path)
|
|
|
|
return redirect(url)
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.login = login
|