From 7499932337fd314ca1cea92e6f111d4616c90f03 Mon Sep 17 00:00:00 2001 From: Kelketek Rritaa Date: Sun, 29 Jun 2014 08:23:12 -0500 Subject: [PATCH] Removed creation of admin media symlink. Fixed media handling. --- game/gamesrc/web/media/README.md | 1 + src/server/initial_setup.py | 37 -------------------------------- src/settings_default.py | 9 ++------ 3 files changed, 3 insertions(+), 44 deletions(-) create mode 100644 game/gamesrc/web/media/README.md diff --git a/game/gamesrc/web/media/README.md b/game/gamesrc/web/media/README.md new file mode 100644 index 0000000000..5f2c3da7a8 --- /dev/null +++ b/game/gamesrc/web/media/README.md @@ -0,0 +1 @@ +This directory is where file uploads from Django apps are placed by default. \ No newline at end of file diff --git a/src/server/initial_setup.py b/src/server/initial_setup.py index 031abf56a8..a7af784edd 100644 --- a/src/server/initial_setup.py +++ b/src/server/initial_setup.py @@ -180,42 +180,6 @@ def start_game_time(): gametime.init_gametime() -def create_admin_media_links(): - """ - This traverses to src/web/media and tries to create a symbolic - link to the django media files from within the MEDIA_ROOT. - These are files we normally don't - want to mess with (use templates to customize the admin - look). Linking is needed since the Twisted webserver otherwise has no - notion of where the default files are - and we cannot hard-code it - since the django install may be at different locations depending - on system. - """ - import django - import os - - if django.get_version() < 1.4: - dpath = os.path.join(django.__path__[0], 'contrib', 'admin', 'media') - else: - dpath = os.path.join(django.__path__[0], 'contrib', 'admin', 'static', 'admin') - apath = os.path.join(settings.ADMIN_MEDIA_ROOT) - if os.path.isdir(apath): - print " ADMIN_MEDIA_ROOT already exists. Ignored." - return - if os.name == 'nt': - print " Admin-media files copied to ADMIN_MEDIA_ROOT (Windows mode)." - os.mkdir(apath) - os.system('xcopy "%s" "%s" /e /q /c' % (dpath, apath)) - if os.name == 'posix': - try: - os.symlink(dpath, apath) - print " Admin-media symlinked to ADMIN_MEDIA_ROOT." - except OSError, e: - print " There was an error symlinking Admin-media to ADMIN_MEDIA_ROOT:\n %s\n -> \n %s\n (%s)\n If you see issues, link manually." % (dpath, apath, e) - else: - print " Admin-media files should be copied manually to ADMIN_MEDIA_ROOT." - - def at_initial_setup(): """ Custom hook for users to overload some or all parts of the initial @@ -269,7 +233,6 @@ def handle_setup(last_step): create_channels, create_system_scripts, start_game_time, - create_admin_media_links, at_initial_setup, reset_server ] diff --git a/src/settings_default.py b/src/settings_default.py index e0db9a45af..76dc73ad0e 100644 --- a/src/settings_default.py +++ b/src/settings_default.py @@ -457,14 +457,9 @@ TEMPLATE_DEBUG = DEBUG ADMINS = () #'Your Name', 'your_email@domain.com'),) # These guys get broken link notifications when SEND_BROKEN_LINK_EMAILS is True. MANAGERS = ADMINS -# Absolute path to the directory that holds media (no trailing slash). +# Absolute path to the directory that holds file uploads from web apps. # Example: "/home/media/media.lawrence.com" -MEDIA_ROOT = os.path.join(SRC_DIR, 'web', 'media') -# Absolute path to the directory that holds (usually links to) the -# django admin media files. If the target directory does not exist, it -# is created and linked by Evennia upon first start. Otherwise link it -# manually to django/contrib/admin/media. -ADMIN_MEDIA_ROOT = os.path.join(MEDIA_ROOT, 'admin') +MEDIA_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "media") # It's safe to dis-regard this, as it's a Django feature we only half use as a # dependency, not actually what it's primarily meant for. SITE_ID = 1