diff --git a/dynamicweb2/urls.py b/dynamicweb2/urls.py index a681735..c17e2c9 100644 --- a/dynamicweb2/urls.py +++ b/dynamicweb2/urls.py @@ -14,14 +14,95 @@ 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 re_path, path, include +# from datacenterlight.views import PaymentOrderView +# +# urlpatterns = [ +# path('admin/', admin.site.urls), +# re_path('hosting/', include('hosting.urls')), +# re_path(r'^product/(?P[\w-]+)/$', +# PaymentOrderView.as_view(), +# name='show_product'), +# ] + + +from cms.models.pagemodel import Page +from django.urls import include, re_path, path from django.contrib import admin -from django.urls import re_path, path, include -from hosting.views import PaymentOrderView +from django.contrib.sites.models import Site +from django.conf.urls.i18n import i18n_patterns +from django.conf.urls.static import static +from django.views import i18n, static as static_view + +from django.conf import settings + +import hosting +from hosting.views import ( + RailsHostingView, DjangoHostingView, NodeJSHostingView +) +from datacenterlight.views import PaymentOrderView +from webhook import views as webhook_views +from membership import urls as membership_urls +from ungleich_page.views import LandingView +from django.views.generic import RedirectView +from django.urls import reverse_lazy +from django.views.static import serve as static_serve + urlpatterns = [ path('admin/', admin.site.urls), - re_path('hosting/', include('hosting.urls')), - re_path(r'^product/(?P[\w-]+)/$', - PaymentOrderView.as_view(), - name='show_product'), -] \ No newline at end of file + re_path(r'^index.html$', LandingView.as_view()), + # re_path(r'^open_api/', include('opennebula_api.urls', namespace='opennebula_api',), name="opennebula_api"), + re_path(r'^railshosting/', RailsHostingView.as_view(), name="rails.hosting"), + re_path(r'^nodehosting/', NodeJSHostingView.as_view(), name="node.hosting"), + re_path(r'^djangohosting/', DjangoHostingView.as_view(), name="django.hosting"), + re_path(r'^product/(?P[\w-]+)/$', PaymentOrderView.as_view(), name='show_product'), + path('hosting/', include('hosting.urls')), + path('datacenterlight/', include('datacenterlight.urls'), name='datacenterlight'), + path('i18n/', include('django.conf.urls.i18n')), # Language switcher URL + re_path(r'^cms/', include('cms.urls')), +] +# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +urlpatterns += i18n_patterns( + + # Add other internationalized patterns here if needed +) + + + +# note the django CMS URLs included via i18n_patterns +REDIRECT_TO_CMS = False +# if Page.objects.filter(site_id=Site.objects.get_current().id).count(): +# REDIRECT_TO_CMS = True + +# urlpatterns += i18n_patterns( +# path('admin/', admin.site.urls), +# re_path(r'^datacenterlight/', +# include(('datacenterlight.urls', 'datacenterlight'), namespace="datacenterlight")), +# re_path(r'^hosting/', RedirectView.as_view(url=reverse_lazy('hosting:login')), +# name='redirect_hosting_login'), +# re_path(r'^membership/', include(membership_urls)), +# #re_path(r'^cms/blog/', include('ungleich.urls', namespace='ungleich')), +# #re_path(r'^blog/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\w[-\w]*)/$', +# # RedirectView.as_view(pattern_name='ungleich:post-detail')), +# #re_path(r'^blog/$', +# # RedirectView.as_view(url=reverse_lazy('ungleich:post-list')), +# # name='blog_list_view'), +# re_path(r'^cms/', include('cms.urls')), +# #re_path(r'^blog/', include('djangocms_blog.urls', namespace='djangocms_blog')), +# re_path(r'^webhooks/', webhook_views.handle_webhook), +# re_path(r'^$', RedirectView.as_view(url='/cms') if REDIRECT_TO_CMS else LandingView.as_view()), +# re_path(r'^', include(('ungleich_page.urls', 'ungleich_page'), namespace='ungleich_page')), +# ) + +# urlpatterns += [ +# # re_path(r'^media/(?P.*)$', +# # static_view.serve, { +# # 'document_root': settings.MEDIA_ROOT, +# # }), +# re_path(r'^media/(?P.*)$', static_serve, { +# 'document_root': settings.MEDIA_ROOT, +# }), +# ] \ No newline at end of file