mod: url админки из .env
This commit is contained in:
@@ -21,15 +21,16 @@ env = environ.Env(
|
||||
# If BASE_DIR is .../dicquo, then .env is at BASE_DIR.parent/.env
|
||||
environ.Env.read_env(os.path.join(BASE_DIR.parent, '.env'))
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = env('SECRET_KEY')
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = env('DEBUG')
|
||||
|
||||
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=[])
|
||||
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['127.0.0.1', 'localhost'])
|
||||
|
||||
# Custom Admin URL from .env
|
||||
ADMIN_URL = env('ADMIN_URL', default='admin/')
|
||||
|
||||
#########################################
|
||||
# Настройки сообщений об ошибках когда все упало и т.п.
|
||||
|
||||
@@ -19,7 +19,7 @@ from django.urls import path, re_path
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib.sitemaps.views import sitemap
|
||||
from django.views.generic import TemplateView
|
||||
from dicquo import settings
|
||||
from django.conf import settings
|
||||
from web import views
|
||||
from web.sitemaps import DictumSitemap
|
||||
|
||||
@@ -28,7 +28,7 @@ sitemaps = {
|
||||
}
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
re_path(f'^{settings.ADMIN_URL}', admin.site.urls),
|
||||
|
||||
re_path(r'^$', views.IndexView.as_view()),
|
||||
re_path(r'^(?P<dq_id>\d{1,12})_\S*$', views.DictumDetailView.as_view()),
|
||||
|
||||
Reference in New Issue
Block a user