-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure for PythonAnywhere deployment with SQLite and optimized set…
…tings
- Loading branch information
Showing
14 changed files
with
813 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import sys | ||
|
||
def create_log_dirs(): | ||
log_dirs = [ | ||
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs'), | ||
] | ||
|
||
for directory in log_dirs: | ||
try: | ||
os.makedirs(directory, exist_ok=True) | ||
print(f"Created directory: {directory}") | ||
except Exception as e: | ||
print(f"Error creating {directory}: {e}", file=sys.stderr) | ||
|
||
if __name__ == '__main__': | ||
create_log_dirs() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Core app initialization | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.apps import AppConfig | ||
|
||
class CoreConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'ghostsec.core' | ||
label = 'core' | ||
verbose_name = 'GhostSec Core' | ||
|
||
def ready(self): | ||
try: | ||
import ghostsec.core.signals # noqa | ||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
Development settings for GhostSec project. | ||
""" | ||
from .base import * | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'django-insecure-development-key-do-not-use-in-production' | ||
|
||
ALLOWED_HOSTS = ['*'] | ||
|
||
# Database | ||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': BASE_DIR / 'db.sqlite3', | ||
} | ||
} | ||
|
||
# Cache | ||
CACHES = { | ||
'default': { | ||
'BACKEND': 'django.core.cache.backends.dummy.DummyCache', | ||
} | ||
} | ||
|
||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
|
||
# Static files | ||
STATIC_URL = '/static/' | ||
STATIC_ROOT = BASE_DIR / 'staticfiles' | ||
|
||
# Media files | ||
MEDIA_URL = '/media/' | ||
MEDIA_ROOT = BASE_DIR / 'media' | ||
|
||
# Debug toolbar - only add if not already in INSTALLED_APPS | ||
if 'debug_toolbar' not in INSTALLED_APPS: | ||
INSTALLED_APPS += ['debug_toolbar'] | ||
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware'] | ||
INTERNAL_IPS = ['127.0.0.1'] | ||
|
||
# Disable password validation in development | ||
AUTH_PASSWORD_VALIDATORS = [] |
Oops, something went wrong.