Basic functionality ready.
This commit is contained in:
@@ -10,6 +10,7 @@ For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/4.2/ref/settings/
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
@@ -25,18 +26,22 @@ SECRET_KEY = 'django-insecure-#_89g9-8to*_ogxz_e0jpnqlreo0hy10odxc_)99$cs66=#7(*
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['127.0.0.1', '192.168.3.42', 'nibasa', 'imgs.nibasa']
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
# Django apps.
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
|
||||
# Project apps.
|
||||
'viewer'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@@ -116,8 +121,19 @@ USE_TZ = True
|
||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
# Gallery paths.
|
||||
GALLERY_ROOT = None
|
||||
THUMBNAILS_ROOT = None
|
||||
|
||||
# Attempt to load local settings if any.
|
||||
try:
|
||||
from .local_settings import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
@@ -14,9 +14,26 @@ 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 path
|
||||
|
||||
# Django imports.
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.urls import (path,
|
||||
include)
|
||||
|
||||
# Project imports
|
||||
from home.views import index
|
||||
|
||||
###########################################################################################
|
||||
# URL Patterns. #
|
||||
###########################################################################################
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
# Index.
|
||||
path('', index, name = 'home'),
|
||||
|
||||
# Add invoices app urls.
|
||||
path('gallery/', include('viewer.urls')),
|
||||
] + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)\
|
||||
+ static('imgs/', document_root = settings.GALLERY_ROOT)\
|
||||
+ static('thumbs/', document_root = settings.THUMBNAILS_ROOT)
|
||||
|
||||
Reference in New Issue
Block a user