mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-28 16:25:44 +08:00
Migrate backend to sqlite spatialite
This commit is contained in:
parent
8e202305b3
commit
14d99fc7c2
5 changed files with 367 additions and 150 deletions
|
@ -14,6 +14,7 @@ from pathlib import Path
|
|||
from dotenv import load_dotenv # Python dotenv
|
||||
import os
|
||||
|
||||
|
||||
load_dotenv() # loads the configs from .env
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
|
@ -50,8 +51,10 @@ else:
|
|||
EMAIL_PORT = str(os.getenv('PROD_EMAIL_PORT'))
|
||||
EMAIL_USE_TLS = str(os.getenv('PROD_EMAIL_TLS'))
|
||||
|
||||
|
||||
# Application definition
|
||||
GEOS_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +
|
||||
r"\Lib\site-packages\osgeo\geos_c.dll")
|
||||
GDAL_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +
|
||||
r"\Lib\site-packages\osgeo\gdal304.dll")
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'daphne',
|
||||
|
@ -61,6 +64,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.gis',
|
||||
'rest_framework',
|
||||
'rest_framework_simplejwt',
|
||||
'djoser',
|
||||
|
@ -123,11 +127,18 @@ WSGI_APPLICATION = 'config.wsgi.application'
|
|||
# Database
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
"""DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}"""
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
}
|
||||
}
|
||||
|
||||
AUTH_USER_MODEL = 'accounts.CustomUser'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue