From eee35e00bf0d0eb3d2a9f08f72c7052962fecbf6 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 28 Feb 2019 10:27:12 +0100 Subject: [PATCH] Reorganize code. --- .gitignore | 0 apps/archive/tests.py | 16 ---------------- {apps => src}/archive/__init__.py | 0 {apps => src}/archive/admin.py | 0 {apps => src}/archive/constants.py | 0 {apps => src}/archive/cover.png | Bin {apps => src}/archive/forms.py | 0 .../archive/locale/pl/LC_MESSAGES/django.mo | Bin .../archive/locale/pl/LC_MESSAGES/django.po | 0 .../archive/migrations/0001_initial.py | 0 ...lishing_tags__del_field_audiobook_publish.py | 0 ...urce_sha1__add_field_audiobook_translator.py | 0 ...004_auto__chg_field_audiobook_source_file.py | 0 ...t_name__add_field_audiobook_index__add_fi.py | 0 {apps => src}/archive/migrations/__init__.py | 0 {apps => src}/archive/models.py | 0 {apps => src}/archive/settings.py | 0 {apps => src}/archive/static/style.css | 0 {apps => src}/archive/tasks.py | 0 {apps => src}/archive/templates/404.html | 0 {apps => src}/archive/templates/500.html | 0 .../archive/templates/archive/base.html | 0 .../archive/templates/archive/file_managed.html | 0 .../archive/templates/archive/file_new.html | 0 .../templates/archive/file_unmanaged.html | 0 .../archive/templates/archive/list.html | 0 .../archive/templates/archive/list_new.html | 0 .../templates/archive/list_published.html | 0 .../templates/archive/list_publishing.html | 0 .../templates/archive/list_unmanaged.html | 0 .../templates/archive/list_unpublished.html | 0 .../archive/tags/multiple_tags_table.html | 0 .../templates/archive/tags/tags_table.html | 0 {apps => src}/archive/templates/base.html | 0 .../archive/templates/registration/login.html | 0 {apps => src}/archive/templatetags/__init__.py | 0 {apps => src}/archive/templatetags/tags.py | 0 {apps => src}/archive/urls.py | 0 {apps => src}/archive/utils.py | 0 {apps => src}/archive/views.py | 0 {audiobooks => src/audiobooks}/__init__.py | 0 {audiobooks => src/audiobooks}/settings.py | 6 ++---- {audiobooks => src/audiobooks}/urls.py | 0 {audiobooks => src/audiobooks}/wsgi.py | 0 {audiobooks => src}/manage.py | 6 +++--- 45 files changed, 5 insertions(+), 23 deletions(-) mode change 100755 => 100644 .gitignore delete mode 100644 apps/archive/tests.py rename {apps => src}/archive/__init__.py (100%) rename {apps => src}/archive/admin.py (100%) rename {apps => src}/archive/constants.py (100%) rename {apps => src}/archive/cover.png (100%) rename {apps => src}/archive/forms.py (100%) rename {apps => src}/archive/locale/pl/LC_MESSAGES/django.mo (100%) rename {apps => src}/archive/locale/pl/LC_MESSAGES/django.po (100%) rename {apps => src}/archive/migrations/0001_initial.py (100%) rename {apps => src}/archive/migrations/0002_auto__del_field_audiobook_publishing_tags__del_field_audiobook_publish.py (100%) rename {apps => src}/archive/migrations/0003_auto__add_field_audiobook_source_sha1__add_field_audiobook_translator.py (100%) rename {apps => src}/archive/migrations/0004_auto__chg_field_audiobook_source_file.py (100%) rename {apps => src}/archive/migrations/0005_auto__add_field_audiobook_part_name__add_field_audiobook_index__add_fi.py (100%) rename {apps => src}/archive/migrations/__init__.py (100%) rename {apps => src}/archive/models.py (100%) rename {apps => src}/archive/settings.py (100%) rename {apps => src}/archive/static/style.css (100%) rename {apps => src}/archive/tasks.py (100%) rename {apps => src}/archive/templates/404.html (100%) rename {apps => src}/archive/templates/500.html (100%) rename {apps => src}/archive/templates/archive/base.html (100%) rename {apps => src}/archive/templates/archive/file_managed.html (100%) rename {apps => src}/archive/templates/archive/file_new.html (100%) rename {apps => src}/archive/templates/archive/file_unmanaged.html (100%) rename {apps => src}/archive/templates/archive/list.html (100%) rename {apps => src}/archive/templates/archive/list_new.html (100%) rename {apps => src}/archive/templates/archive/list_published.html (100%) rename {apps => src}/archive/templates/archive/list_publishing.html (100%) rename {apps => src}/archive/templates/archive/list_unmanaged.html (100%) rename {apps => src}/archive/templates/archive/list_unpublished.html (100%) rename {apps => src}/archive/templates/archive/tags/multiple_tags_table.html (100%) rename {apps => src}/archive/templates/archive/tags/tags_table.html (100%) rename {apps => src}/archive/templates/base.html (100%) rename {apps => src}/archive/templates/registration/login.html (100%) rename {apps => src}/archive/templatetags/__init__.py (100%) rename {apps => src}/archive/templatetags/tags.py (100%) rename {apps => src}/archive/urls.py (100%) rename {apps => src}/archive/utils.py (100%) rename {apps => src}/archive/views.py (100%) rename {audiobooks => src/audiobooks}/__init__.py (100%) rename {audiobooks => src/audiobooks}/settings.py (97%) rename {audiobooks => src/audiobooks}/urls.py (100%) rename {audiobooks => src/audiobooks}/wsgi.py (100%) rename {audiobooks => src}/manage.py (76%) diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/apps/archive/tests.py b/apps/archive/tests.py deleted file mode 100644 index 501deb7..0000000 --- a/apps/archive/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/apps/archive/__init__.py b/src/archive/__init__.py similarity index 100% rename from apps/archive/__init__.py rename to src/archive/__init__.py diff --git a/apps/archive/admin.py b/src/archive/admin.py similarity index 100% rename from apps/archive/admin.py rename to src/archive/admin.py diff --git a/apps/archive/constants.py b/src/archive/constants.py similarity index 100% rename from apps/archive/constants.py rename to src/archive/constants.py diff --git a/apps/archive/cover.png b/src/archive/cover.png similarity index 100% rename from apps/archive/cover.png rename to src/archive/cover.png diff --git a/apps/archive/forms.py b/src/archive/forms.py similarity index 100% rename from apps/archive/forms.py rename to src/archive/forms.py diff --git a/apps/archive/locale/pl/LC_MESSAGES/django.mo b/src/archive/locale/pl/LC_MESSAGES/django.mo similarity index 100% rename from apps/archive/locale/pl/LC_MESSAGES/django.mo rename to src/archive/locale/pl/LC_MESSAGES/django.mo diff --git a/apps/archive/locale/pl/LC_MESSAGES/django.po b/src/archive/locale/pl/LC_MESSAGES/django.po similarity index 100% rename from apps/archive/locale/pl/LC_MESSAGES/django.po rename to src/archive/locale/pl/LC_MESSAGES/django.po diff --git a/apps/archive/migrations/0001_initial.py b/src/archive/migrations/0001_initial.py similarity index 100% rename from apps/archive/migrations/0001_initial.py rename to src/archive/migrations/0001_initial.py diff --git a/apps/archive/migrations/0002_auto__del_field_audiobook_publishing_tags__del_field_audiobook_publish.py b/src/archive/migrations/0002_auto__del_field_audiobook_publishing_tags__del_field_audiobook_publish.py similarity index 100% rename from apps/archive/migrations/0002_auto__del_field_audiobook_publishing_tags__del_field_audiobook_publish.py rename to src/archive/migrations/0002_auto__del_field_audiobook_publishing_tags__del_field_audiobook_publish.py diff --git a/apps/archive/migrations/0003_auto__add_field_audiobook_source_sha1__add_field_audiobook_translator.py b/src/archive/migrations/0003_auto__add_field_audiobook_source_sha1__add_field_audiobook_translator.py similarity index 100% rename from apps/archive/migrations/0003_auto__add_field_audiobook_source_sha1__add_field_audiobook_translator.py rename to src/archive/migrations/0003_auto__add_field_audiobook_source_sha1__add_field_audiobook_translator.py diff --git a/apps/archive/migrations/0004_auto__chg_field_audiobook_source_file.py b/src/archive/migrations/0004_auto__chg_field_audiobook_source_file.py similarity index 100% rename from apps/archive/migrations/0004_auto__chg_field_audiobook_source_file.py rename to src/archive/migrations/0004_auto__chg_field_audiobook_source_file.py diff --git a/apps/archive/migrations/0005_auto__add_field_audiobook_part_name__add_field_audiobook_index__add_fi.py b/src/archive/migrations/0005_auto__add_field_audiobook_part_name__add_field_audiobook_index__add_fi.py similarity index 100% rename from apps/archive/migrations/0005_auto__add_field_audiobook_part_name__add_field_audiobook_index__add_fi.py rename to src/archive/migrations/0005_auto__add_field_audiobook_part_name__add_field_audiobook_index__add_fi.py diff --git a/apps/archive/migrations/__init__.py b/src/archive/migrations/__init__.py similarity index 100% rename from apps/archive/migrations/__init__.py rename to src/archive/migrations/__init__.py diff --git a/apps/archive/models.py b/src/archive/models.py similarity index 100% rename from apps/archive/models.py rename to src/archive/models.py diff --git a/apps/archive/settings.py b/src/archive/settings.py similarity index 100% rename from apps/archive/settings.py rename to src/archive/settings.py diff --git a/apps/archive/static/style.css b/src/archive/static/style.css similarity index 100% rename from apps/archive/static/style.css rename to src/archive/static/style.css diff --git a/apps/archive/tasks.py b/src/archive/tasks.py similarity index 100% rename from apps/archive/tasks.py rename to src/archive/tasks.py diff --git a/apps/archive/templates/404.html b/src/archive/templates/404.html similarity index 100% rename from apps/archive/templates/404.html rename to src/archive/templates/404.html diff --git a/apps/archive/templates/500.html b/src/archive/templates/500.html similarity index 100% rename from apps/archive/templates/500.html rename to src/archive/templates/500.html diff --git a/apps/archive/templates/archive/base.html b/src/archive/templates/archive/base.html similarity index 100% rename from apps/archive/templates/archive/base.html rename to src/archive/templates/archive/base.html diff --git a/apps/archive/templates/archive/file_managed.html b/src/archive/templates/archive/file_managed.html similarity index 100% rename from apps/archive/templates/archive/file_managed.html rename to src/archive/templates/archive/file_managed.html diff --git a/apps/archive/templates/archive/file_new.html b/src/archive/templates/archive/file_new.html similarity index 100% rename from apps/archive/templates/archive/file_new.html rename to src/archive/templates/archive/file_new.html diff --git a/apps/archive/templates/archive/file_unmanaged.html b/src/archive/templates/archive/file_unmanaged.html similarity index 100% rename from apps/archive/templates/archive/file_unmanaged.html rename to src/archive/templates/archive/file_unmanaged.html diff --git a/apps/archive/templates/archive/list.html b/src/archive/templates/archive/list.html similarity index 100% rename from apps/archive/templates/archive/list.html rename to src/archive/templates/archive/list.html diff --git a/apps/archive/templates/archive/list_new.html b/src/archive/templates/archive/list_new.html similarity index 100% rename from apps/archive/templates/archive/list_new.html rename to src/archive/templates/archive/list_new.html diff --git a/apps/archive/templates/archive/list_published.html b/src/archive/templates/archive/list_published.html similarity index 100% rename from apps/archive/templates/archive/list_published.html rename to src/archive/templates/archive/list_published.html diff --git a/apps/archive/templates/archive/list_publishing.html b/src/archive/templates/archive/list_publishing.html similarity index 100% rename from apps/archive/templates/archive/list_publishing.html rename to src/archive/templates/archive/list_publishing.html diff --git a/apps/archive/templates/archive/list_unmanaged.html b/src/archive/templates/archive/list_unmanaged.html similarity index 100% rename from apps/archive/templates/archive/list_unmanaged.html rename to src/archive/templates/archive/list_unmanaged.html diff --git a/apps/archive/templates/archive/list_unpublished.html b/src/archive/templates/archive/list_unpublished.html similarity index 100% rename from apps/archive/templates/archive/list_unpublished.html rename to src/archive/templates/archive/list_unpublished.html diff --git a/apps/archive/templates/archive/tags/multiple_tags_table.html b/src/archive/templates/archive/tags/multiple_tags_table.html similarity index 100% rename from apps/archive/templates/archive/tags/multiple_tags_table.html rename to src/archive/templates/archive/tags/multiple_tags_table.html diff --git a/apps/archive/templates/archive/tags/tags_table.html b/src/archive/templates/archive/tags/tags_table.html similarity index 100% rename from apps/archive/templates/archive/tags/tags_table.html rename to src/archive/templates/archive/tags/tags_table.html diff --git a/apps/archive/templates/base.html b/src/archive/templates/base.html similarity index 100% rename from apps/archive/templates/base.html rename to src/archive/templates/base.html diff --git a/apps/archive/templates/registration/login.html b/src/archive/templates/registration/login.html similarity index 100% rename from apps/archive/templates/registration/login.html rename to src/archive/templates/registration/login.html diff --git a/apps/archive/templatetags/__init__.py b/src/archive/templatetags/__init__.py similarity index 100% rename from apps/archive/templatetags/__init__.py rename to src/archive/templatetags/__init__.py diff --git a/apps/archive/templatetags/tags.py b/src/archive/templatetags/tags.py similarity index 100% rename from apps/archive/templatetags/tags.py rename to src/archive/templatetags/tags.py diff --git a/apps/archive/urls.py b/src/archive/urls.py similarity index 100% rename from apps/archive/urls.py rename to src/archive/urls.py diff --git a/apps/archive/utils.py b/src/archive/utils.py similarity index 100% rename from apps/archive/utils.py rename to src/archive/utils.py diff --git a/apps/archive/views.py b/src/archive/views.py similarity index 100% rename from apps/archive/views.py rename to src/archive/views.py diff --git a/audiobooks/__init__.py b/src/audiobooks/__init__.py similarity index 100% rename from audiobooks/__init__.py rename to src/audiobooks/__init__.py diff --git a/audiobooks/settings.py b/src/audiobooks/settings.py similarity index 97% rename from audiobooks/settings.py rename to src/audiobooks/settings.py index 3f92da0..6ec4fe7 100644 --- a/audiobooks/settings.py +++ b/src/audiobooks/settings.py @@ -2,9 +2,7 @@ # -*- coding: utf-8 -*- import os -import sys -PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) -sys.path.insert(0, os.path.join(PROJECT_ROOT, "../apps")) +PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -53,7 +51,7 @@ USE_L10N = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = os.path.join(PROJECT_ROOT, '../media') +MEDIA_ROOT = os.path.join(PROJECT_ROOT, '../media/') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. diff --git a/audiobooks/urls.py b/src/audiobooks/urls.py similarity index 100% rename from audiobooks/urls.py rename to src/audiobooks/urls.py diff --git a/audiobooks/wsgi.py b/src/audiobooks/wsgi.py similarity index 100% rename from audiobooks/wsgi.py rename to src/audiobooks/wsgi.py diff --git a/audiobooks/manage.py b/src/manage.py similarity index 76% rename from audiobooks/manage.py rename to src/manage.py index 3e4eedc..3281d70 100755 --- a/audiobooks/manage.py +++ b/src/manage.py @@ -2,13 +2,13 @@ from django.core.management import execute_manager import imp try: - imp.find_module('settings') # Assumed to be in the same directory. + imp.find_module('settings', ['audiobooks']) except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) sys.exit(1) -import settings +import audiobooks.settings if __name__ == "__main__": - execute_manager(settings) + execute_manager(audiobooks.settings) -- 2.20.1