diff --git a/.gitignore b/.gitignore index b31636e..e17711a 100644 --- a/.gitignore +++ b/.gitignore @@ -174,4 +174,6 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ -app/logs \ No newline at end of file +app/logs + +app/project/local_settings.py \ No newline at end of file diff --git a/app/project/production_settings.py b/app/project/production_settings.py new file mode 100644 index 0000000..c7d5d42 --- /dev/null +++ b/app/project/production_settings.py @@ -0,0 +1 @@ +DEBUG = False diff --git a/app/project/settings.py b/app/project/settings.py index c985c0b..451bf41 100644 --- a/app/project/settings.py +++ b/app/project/settings.py @@ -6,8 +6,6 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.environ.get('SECRET_KEY', 'django-debug-key') -DEBUG = os.environ.get('DEBUG', True) - ALLOWED_HOSTS = ['*'] INSTALLED_APPS = [ @@ -18,7 +16,6 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', - 'settings.apps.SettingsConfig', 'bot.apps.BotConfig', ] @@ -87,7 +84,7 @@ USE_I18N = True USE_TZ = True -STATIC_URL = 'static/' +STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') MEDIA_URL = "/media/" @@ -95,14 +92,14 @@ MEDIA_ROOT = os.path.join(BASE_DIR, "media") DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -CSRF_TRUSTED_ORIGINS = ["https://*", "http://0.0.0.0:8000"] +CSRF_TRUSTED_ORIGINS = ["https://lirchzakhar.fvds.ru/", "http://0.0.0.0:8000"] EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.mail.ru' EMAIL_PORT = 587 EMAIL_USE_TLS = True -EMAIL_HOST_USER = 'zakhar4443@mail.ru' # Ваш email на Mail.ru -EMAIL_HOST_PASSWORD = 'utgLGfsSmbWHggLDdTa7' # Пароль от вашего email +EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER') # Ваш email на Mail.ru +EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD') # Пароль от вашего email DEFAULT_FROM_EMAIL = EMAIL_HOST_USER REDIS_HOST = os.getenv('REDIS_HOST') or "localhost" @@ -119,3 +116,8 @@ CELERY_RESULT_SERIALIZER = 'json' TELEGRAM_API_URL = "https://api.telegram.org/bot" import project.logging_settings + +try: + import project.local_settings +except ImportError: + import project.production_settings \ No newline at end of file