Skip to content

Commit

Permalink
contrihub: urls: Change base url if mentioned in env
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Verma <shashank.verma2002@gmail.com>
  • Loading branch information
shank03 committed Oct 4, 2023
1 parent a1d232f commit 63f9c19
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion contrihub/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from decouple import config
from django.contrib import admin
# from django.conf.urls import
from django.urls import path, include, re_path

urlpatterns = [
BASE_URL = config('BASE_URL', default=None)

basepatterns = [
path('admin/', admin.site.urls),
path('', include('home.urls')),
path('profile/', include('user_profile.urls')),
Expand All @@ -26,3 +29,10 @@
# this url is handled by social_django app under social-auth-app-django python library
re_path(r'^oauth/', include('social_django.urls', namespace='social')),
]

if BASE_URL:
urlpatterns = [
path(str(BASE_URL), include(basepatterns))
]
else:
urlpatterns = basepatterns

0 comments on commit 63f9c19

Please sign in to comment.