2018-04-03 20:50:00 +00:00
|
|
|
from cms.models.pagemodel import Page
|
2017-07-28 20:18:56 +00:00
|
|
|
from django.conf.urls import include, url
|
2015-05-01 23:30:30 +00:00
|
|
|
from django.contrib import admin
|
2018-04-03 20:50:00 +00:00
|
|
|
from django.contrib.sites.models import Site
|
2015-10-04 15:38:01 +00:00
|
|
|
from django.conf.urls.i18n import i18n_patterns
|
2015-05-21 07:21:22 +00:00
|
|
|
from django.conf.urls.static import static
|
2017-07-18 21:39:52 +00:00
|
|
|
from django.views import i18n, static as static_view
|
2015-09-15 14:57:56 +00:00
|
|
|
|
2015-11-02 20:45:04 +00:00
|
|
|
from django.conf import settings
|
2017-10-11 22:32:47 +00:00
|
|
|
from hosting.views import (
|
|
|
|
RailsHostingView, DjangoHostingView, NodeJSHostingView
|
|
|
|
)
|
2018-10-02 08:02:38 +00:00
|
|
|
from datacenterlight.views import PaymentOrderView
|
2016-03-07 16:49:02 +00:00
|
|
|
from membership import urls as membership_urls
|
2016-06-30 06:23:14 +00:00
|
|
|
from ungleich_page.views import LandingView
|
2017-05-14 10:06:11 +00:00
|
|
|
from django.views.generic import RedirectView
|
|
|
|
from django.core.urlresolvers import reverse_lazy
|
2016-05-08 17:58:37 +00:00
|
|
|
import debug_toolbar
|
2015-05-01 23:30:30 +00:00
|
|
|
|
2017-09-07 15:31:17 +00:00
|
|
|
urlpatterns = [
|
|
|
|
url(r'^index.html$', LandingView.as_view()),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^open_api/',
|
|
|
|
include('opennebula_api.urls', namespace='opennebula_api')),
|
2017-09-07 15:31:17 +00:00
|
|
|
url(r'^railshosting/', RailsHostingView.as_view(),
|
|
|
|
name="rails.hosting"),
|
|
|
|
url(r'^nodehosting/', NodeJSHostingView.as_view(),
|
|
|
|
name="node.hosting"),
|
|
|
|
url(r'^djangohosting/', DjangoHostingView.as_view(),
|
|
|
|
name="django.hosting"),
|
|
|
|
url(r'^nosystemd/', include('nosystemd.urls', namespace="nosystemd")),
|
|
|
|
url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^jsi18n/(?P<packages>\S+?)/$', i18n.javascript_catalog),
|
2018-10-03 05:55:56 +00:00
|
|
|
url(r'^product/(?P<product_slug>[\w-]+)/$',
|
|
|
|
PaymentOrderView.as_view(),
|
|
|
|
name='show_product'),
|
2017-09-07 15:31:17 +00:00
|
|
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
|
|
|
|
urlpatterns += i18n_patterns(
|
|
|
|
url(r'^hosting/', include('hosting.urls', namespace="hosting")),
|
|
|
|
)
|
2015-09-15 14:57:56 +00:00
|
|
|
|
2015-10-04 15:38:01 +00:00
|
|
|
# note the django CMS URLs included via i18n_patterns
|
2018-04-03 20:50:00 +00:00
|
|
|
REDIRECT_TO_CMS = False
|
|
|
|
if Page.objects.filter(site_id=Site.objects.get_current().id).count():
|
|
|
|
REDIRECT_TO_CMS = True
|
|
|
|
|
2017-07-18 21:39:52 +00:00
|
|
|
urlpatterns += i18n_patterns(
|
2017-09-07 15:31:17 +00:00
|
|
|
url(r'^admin/', include(admin.site.urls)),
|
|
|
|
url(r'^datacenterlight/',
|
|
|
|
include('datacenterlight.urls', namespace="datacenterlight")),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^hosting/', RedirectView.as_view(url=reverse_lazy('hosting:login')),
|
|
|
|
name='redirect_hosting_login'),
|
2017-09-07 15:31:17 +00:00
|
|
|
url(r'^alplora/', include('alplora.urls', namespace="alplora")),
|
|
|
|
url(r'^membership/', include(membership_urls)),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^digitalglarus/',
|
|
|
|
include('digitalglarus.urls', namespace="digitalglarus")),
|
|
|
|
url(r'^cms/blog/', include('ungleich.urls', namespace='ungleich')),
|
|
|
|
url(r'^blog/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>\w[-\w]*)/$',
|
2017-09-22 06:47:42 +00:00
|
|
|
RedirectView.as_view(pattern_name='ungleich:post-detail')),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^blog/$',
|
2018-04-21 17:09:44 +00:00
|
|
|
RedirectView.as_view(url=reverse_lazy('ungleich:post-list')),
|
|
|
|
name='blog_list_view'),
|
2018-04-03 22:35:12 +00:00
|
|
|
url(r'^cms/', include('cms.urls')),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^blog/', include('djangocms_blog.urls', namespace='djangocms_blog')),
|
2018-04-03 21:28:47 +00:00
|
|
|
url(r'^$', RedirectView.as_view(url='/cms') if REDIRECT_TO_CMS
|
2018-04-03 22:35:25 +00:00
|
|
|
else LandingView.as_view()),
|
2018-04-12 16:54:50 +00:00
|
|
|
url(r'^', include('ungleich_page.urls', namespace='ungleich_page')),
|
2017-09-07 15:31:17 +00:00
|
|
|
)
|
|
|
|
|
2017-07-18 21:39:52 +00:00
|
|
|
urlpatterns += [
|
2017-09-07 15:31:17 +00:00
|
|
|
url(r'^media/(?P<path>.*)$',
|
|
|
|
static_view.serve, {
|
|
|
|
'document_root': settings.MEDIA_ROOT,
|
|
|
|
}),
|
|
|
|
]
|
|
|
|
|
2015-05-23 06:33:35 +00:00
|
|
|
if settings.DEBUG:
|
2017-07-18 21:39:52 +00:00
|
|
|
urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]
|