attempting to resolve setting configuration errors

main
Damon Del Priore 2020-11-19 00:00:16 -05:00
parent 99d5406a47
commit 43aad3ead9
15 changed files with 40 additions and 22 deletions

View File

@ -11,6 +11,6 @@ import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookshelf_management.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE','bookshelf_management.settings.settings_base')
application = get_asgi_application()

View File

@ -14,14 +14,14 @@ import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
#BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
#BASE_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
# use environment variable to set DJANGO_SECRET_KEY
#SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
@ -33,10 +33,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'zgwvzeb!oca99v&c(=lljl)y_&^33dwoqs@%)arujer_#x(#gn'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
ALLOWED_HOSTS = [
'localhost'
'localhost',
'127.0.0.1'
]
# Application definition

View File

@ -0,0 +1,3 @@
from settings_base import *
DEBUG = False

View File

@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookshelf_management.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE','bookshelf_management.settings.settings_base')
application = get_wsgi_application()

View File

@ -2,9 +2,9 @@
import os
import sys
import bookshelf_management.settings.py
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE','bookshelf_management.settings.settings_base')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
@ -13,7 +13,8 @@ if __name__ == '__main__':
#sys.path.append("/mnt/c/Users/damon/Desktop/bookshelf-management/bookshelf_management/bookshelf_management/settings")
#export DJANGO_SETTINGS_MODULE=bookshelf_management.settings
'''
try:
from django.core.management import execute_from_command_line

View File

@ -74,4 +74,7 @@ fi
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
#DJANGO_SETTINGS_MODULE="/mnt/c/Users/damon/Desktop/bookshelf-management/bookshelf_management/bookshelf_management/settings/settings_base.py"
#export DJANGO_SETTINGS_MODULE

View File

@ -1,12 +1,8 @@
#!/mnt/c/users/damon/desktop/bookshelf-management/my_env/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'Django','console_scripts','django-admin'
__requires__ = 'Django'
# -*- coding: utf-8 -*-
import re
import sys
from pkg_resources import load_entry_point
from django.core.management import execute_from_command_line
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('Django', 'console_scripts', 'django-admin')()
)
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(execute_from_command_line())

View File

@ -1,7 +1,21 @@
#!/mnt/c/users/damon/desktop/bookshelf-management/my_env/bin/python3
# EASY-INSTALL-DEV-SCRIPT: 'Django==3.2','django-admin.py'
__requires__ = 'Django==3.2'
__import__('pkg_resources').require('Django==3.2')
__file__ = '/mnt/c/users/damon/desktop/bookshelf-management/django/django/bin/django-admin.py'
with open(__file__) as f:
exec(compile(f.read(), __file__, 'exec'))
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was deprecated in Django 3.1 and removed in Django '
'4.0. Please manually remove this script from your virtual environment '
'and use django-admin instead.'
)
if __name__ == "__main__":
warnings.warn(
'django-admin.py is deprecated in favor of django-admin.',
RemovedInDjango40Warning,
)
management.execute_from_command_line()