I have a small problem in my urls can you please help
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from django.conf.urls.i18n import i18n_patterns # Base URL patterns urlpatterns = [ path('i18n/', include('django.conf.urls.i18n')), # Language switching ] # Internationalized patterns with i18n_patterns urlpatterns += i18n_patterns( path('admin/', admin.site.urls), # Admin URLs path('checkout/', include('checkout.urls')), # Checkout URLs path('blog/', include('blog.urls', namespace='blog')), # Blog URLs path('', include('store.urls')), # Store URLs prefix_default_language=True, # Disable prefix for default language ) # Serve media files during development if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if this is True prefix_default_language=True then stripe does not accept payments and when its false then it accepts payments but the page loads without a language prefix and it does not load right I need the page to load with http://127.0.0.1:8000/en/ and not http://127.0.0.1:8000/ I have checked everything the settings file and still, thank you
السؤال
Mohamed Farahat
مرحبا,
I have a small problem in my urls can you please help
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from django.conf.urls.i18n import i18n_patterns # Base URL patterns urlpatterns = [ path('i18n/', include('django.conf.urls.i18n')), # Language switching ] # Internationalized patterns with i18n_patterns urlpatterns += i18n_patterns( path('admin/', admin.site.urls), # Admin URLs path('checkout/', include('checkout.urls')), # Checkout URLs path('blog/', include('blog.urls', namespace='blog')), # Blog URLs path('', include('store.urls')), # Store URLs prefix_default_language=True, # Disable prefix for default language ) # Serve media files during development if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if this is True prefix_default_language=True then stripe does not accept payments and when its false then it accepts payments but the page loads without a language prefix and it does not load right I need the page to load with http://127.0.0.1:8000/en/ and not http://127.0.0.1:8000/ I have checked everything the settings file and still, thank you
4 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.