From e2a8a438524e1ace86e995885603c0d05badd023 Mon Sep 17 00:00:00 2001 From: thatchej Date: Fri, 15 Nov 2019 10:19:50 -0800 Subject: [PATCH] add Dockerfile and flatten folder structure by 1 level --- Dockerfile | 13 +++++++++++++ blogproj/{blogproj => }/__init__.py | 0 blogproj/{blogproj => }/settings.py | 5 ++++- blogproj/{blogproj => }/urls.py | 0 blogproj/{blogproj => }/views.py | 0 blogproj/{blogproj => }/wsgi.py | 0 {blogproj/mainapp => mainapp}/__init__.py | 0 {blogproj/mainapp => mainapp}/admin.py | 0 {blogproj/mainapp => mainapp}/apps.py | 0 .../mainapp => mainapp}/migrations/0001_initial.py | 0 .../migrations/0002_auto_20191004_0501.py | 0 .../mainapp => mainapp}/migrations/__init__.py | 0 {blogproj/mainapp => mainapp}/models.py | 0 .../templates/mainapp/filtered_post_list.html | 0 .../templates/mainapp/index.html | 0 .../templates/mainapp/post.html | 0 .../templates/mainapp/snippet_post_link.html | 0 .../templates/mainapp/snippet_tag_labels.html | 0 {blogproj/mainapp => mainapp}/tests.py | 0 {blogproj/mainapp => mainapp}/urls.py | 0 {blogproj/mainapp => mainapp}/views.py | 0 blogproj/manage.py => manage.py | 0 {blogproj/module1 => module1}/tests.py | 0 requirements.txt | 2 ++ {blogproj/static => static}/apple-touch-icon.png | Bin {blogproj/static => static}/browserconfig.xml | 0 {blogproj/static => static}/css/main.css | 0 {blogproj/static => static}/favicon.ico | Bin {blogproj/static => static}/fonts/GothamBold.ttf | Bin {blogproj/static => static}/fonts/GothamBook.ttf | Bin {blogproj/static => static}/fonts/GothamMedium.ttf | Bin .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin {blogproj/static => static}/index.html | 0 {blogproj/static => static}/js/main.js | 0 .../js/vendor/modernizr-2.8.3-respond-1.4.2.min.js | 0 {blogproj/static => static}/js/vendor/npm.js | 0 {blogproj/static => static}/tile-wide.png | Bin {blogproj/static => static}/tile.png | Bin {blogproj/templates => templates}/base.html | 0 {blogproj/users => users}/__init__.py | 0 {blogproj/users => users}/admin.py | 0 {blogproj/users => users}/apps.py | 0 {blogproj/users => users}/forms.py | 0 .../users => users}/migrations/0001_initial.py | 0 {blogproj/users => users}/migrations/__init__.py | 0 {blogproj/users => users}/models.py | 0 .../templates/registration/login.html | 0 .../templates/registration/register.html | 0 {blogproj/users => users}/tests.py | 0 {blogproj/users => users}/urls.py | 0 {blogproj/users => users}/views.py | 0 54 files changed, 19 insertions(+), 1 deletion(-) rename blogproj/{blogproj => }/__init__.py (100%) rename blogproj/{blogproj => }/settings.py (95%) rename blogproj/{blogproj => }/urls.py (100%) rename blogproj/{blogproj => }/views.py (100%) rename blogproj/{blogproj => }/wsgi.py (100%) rename {blogproj/mainapp => mainapp}/__init__.py (100%) rename {blogproj/mainapp => mainapp}/admin.py (100%) rename {blogproj/mainapp => mainapp}/apps.py (100%) rename {blogproj/mainapp => mainapp}/migrations/0001_initial.py (100%) rename {blogproj/mainapp => mainapp}/migrations/0002_auto_20191004_0501.py (100%) rename {blogproj/mainapp => mainapp}/migrations/__init__.py (100%) rename {blogproj/mainapp => mainapp}/models.py (100%) rename {blogproj/mainapp => mainapp}/templates/mainapp/filtered_post_list.html (100%) rename {blogproj/mainapp => mainapp}/templates/mainapp/index.html (100%) rename {blogproj/mainapp => mainapp}/templates/mainapp/post.html (100%) rename {blogproj/mainapp => mainapp}/templates/mainapp/snippet_post_link.html (100%) rename {blogproj/mainapp => mainapp}/templates/mainapp/snippet_tag_labels.html (100%) rename {blogproj/mainapp => mainapp}/tests.py (100%) rename {blogproj/mainapp => mainapp}/urls.py (100%) rename {blogproj/mainapp => mainapp}/views.py (100%) rename blogproj/manage.py => manage.py (100%) rename {blogproj/module1 => module1}/tests.py (100%) rename {blogproj/static => static}/apple-touch-icon.png (100%) rename {blogproj/static => static}/browserconfig.xml (100%) rename {blogproj/static => static}/css/main.css (100%) rename {blogproj/static => static}/favicon.ico (100%) rename {blogproj/static => static}/fonts/GothamBold.ttf (100%) rename {blogproj/static => static}/fonts/GothamBook.ttf (100%) rename {blogproj/static => static}/fonts/GothamMedium.ttf (100%) rename {blogproj/static => static}/fonts/glyphicons-halflings-regular.eot (100%) rename {blogproj/static => static}/fonts/glyphicons-halflings-regular.svg (100%) rename {blogproj/static => static}/fonts/glyphicons-halflings-regular.ttf (100%) rename {blogproj/static => static}/fonts/glyphicons-halflings-regular.woff (100%) rename {blogproj/static => static}/index.html (100%) rename {blogproj/static => static}/js/main.js (100%) rename {blogproj/static => static}/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js (100%) rename {blogproj/static => static}/js/vendor/npm.js (100%) rename {blogproj/static => static}/tile-wide.png (100%) rename {blogproj/static => static}/tile.png (100%) rename {blogproj/templates => templates}/base.html (100%) rename {blogproj/users => users}/__init__.py (100%) rename {blogproj/users => users}/admin.py (100%) rename {blogproj/users => users}/apps.py (100%) rename {blogproj/users => users}/forms.py (100%) rename {blogproj/users => users}/migrations/0001_initial.py (100%) rename {blogproj/users => users}/migrations/__init__.py (100%) rename {blogproj/users => users}/models.py (100%) rename {blogproj/users => users}/templates/registration/login.html (100%) rename {blogproj/users => users}/templates/registration/register.html (100%) rename {blogproj/users => users}/tests.py (100%) rename {blogproj/users => users}/urls.py (100%) rename {blogproj/users => users}/views.py (100%) diff --git a/Dockerfile b/Dockerfile index 8b13789..c709a34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,14 @@ +FROM python:3.7-alpine +WORKDIR /src/app/ + +COPY ./requirements.txt . + +RUN ["pip", "install", "-r", "./requirements.txt"] + +COPY . . + +RUN addgroup -S projects && adduser -S -H projects -G projects +RUN chown -R projects:projects /src/app + +USER projects diff --git a/blogproj/blogproj/__init__.py b/blogproj/__init__.py similarity index 100% rename from blogproj/blogproj/__init__.py rename to blogproj/__init__.py diff --git a/blogproj/blogproj/settings.py b/blogproj/settings.py similarity index 95% rename from blogproj/blogproj/settings.py rename to blogproj/settings.py index ce1ec05..8ee8136 100644 --- a/blogproj/blogproj/settings.py +++ b/blogproj/settings.py @@ -15,6 +15,9 @@ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner' +TEST_OUTPUT_DIR = BASE_DIR +TEST_OUTPUT_FILE_NAME = '.report.xml' # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ @@ -128,4 +131,4 @@ LOGIN_URL = 'login' LOGIN_REDIRECT_URL = 'index' -AUTH_USER_MODEL = 'users.User' \ No newline at end of file +AUTH_USER_MODEL = 'users.User' diff --git a/blogproj/blogproj/urls.py b/blogproj/urls.py similarity index 100% rename from blogproj/blogproj/urls.py rename to blogproj/urls.py diff --git a/blogproj/blogproj/views.py b/blogproj/views.py similarity index 100% rename from blogproj/blogproj/views.py rename to blogproj/views.py diff --git a/blogproj/blogproj/wsgi.py b/blogproj/wsgi.py similarity index 100% rename from blogproj/blogproj/wsgi.py rename to blogproj/wsgi.py diff --git a/blogproj/mainapp/__init__.py b/mainapp/__init__.py similarity index 100% rename from blogproj/mainapp/__init__.py rename to mainapp/__init__.py diff --git a/blogproj/mainapp/admin.py b/mainapp/admin.py similarity index 100% rename from blogproj/mainapp/admin.py rename to mainapp/admin.py diff --git a/blogproj/mainapp/apps.py b/mainapp/apps.py similarity index 100% rename from blogproj/mainapp/apps.py rename to mainapp/apps.py diff --git a/blogproj/mainapp/migrations/0001_initial.py b/mainapp/migrations/0001_initial.py similarity index 100% rename from blogproj/mainapp/migrations/0001_initial.py rename to mainapp/migrations/0001_initial.py diff --git a/blogproj/mainapp/migrations/0002_auto_20191004_0501.py b/mainapp/migrations/0002_auto_20191004_0501.py similarity index 100% rename from blogproj/mainapp/migrations/0002_auto_20191004_0501.py rename to mainapp/migrations/0002_auto_20191004_0501.py diff --git a/blogproj/mainapp/migrations/__init__.py b/mainapp/migrations/__init__.py similarity index 100% rename from blogproj/mainapp/migrations/__init__.py rename to mainapp/migrations/__init__.py diff --git a/blogproj/mainapp/models.py b/mainapp/models.py similarity index 100% rename from blogproj/mainapp/models.py rename to mainapp/models.py diff --git a/blogproj/mainapp/templates/mainapp/filtered_post_list.html b/mainapp/templates/mainapp/filtered_post_list.html similarity index 100% rename from blogproj/mainapp/templates/mainapp/filtered_post_list.html rename to mainapp/templates/mainapp/filtered_post_list.html diff --git a/blogproj/mainapp/templates/mainapp/index.html b/mainapp/templates/mainapp/index.html similarity index 100% rename from blogproj/mainapp/templates/mainapp/index.html rename to mainapp/templates/mainapp/index.html diff --git a/blogproj/mainapp/templates/mainapp/post.html b/mainapp/templates/mainapp/post.html similarity index 100% rename from blogproj/mainapp/templates/mainapp/post.html rename to mainapp/templates/mainapp/post.html diff --git a/blogproj/mainapp/templates/mainapp/snippet_post_link.html b/mainapp/templates/mainapp/snippet_post_link.html similarity index 100% rename from blogproj/mainapp/templates/mainapp/snippet_post_link.html rename to mainapp/templates/mainapp/snippet_post_link.html diff --git a/blogproj/mainapp/templates/mainapp/snippet_tag_labels.html b/mainapp/templates/mainapp/snippet_tag_labels.html similarity index 100% rename from blogproj/mainapp/templates/mainapp/snippet_tag_labels.html rename to mainapp/templates/mainapp/snippet_tag_labels.html diff --git a/blogproj/mainapp/tests.py b/mainapp/tests.py similarity index 100% rename from blogproj/mainapp/tests.py rename to mainapp/tests.py diff --git a/blogproj/mainapp/urls.py b/mainapp/urls.py similarity index 100% rename from blogproj/mainapp/urls.py rename to mainapp/urls.py diff --git a/blogproj/mainapp/views.py b/mainapp/views.py similarity index 100% rename from blogproj/mainapp/views.py rename to mainapp/views.py diff --git a/blogproj/manage.py b/manage.py similarity index 100% rename from blogproj/manage.py rename to manage.py diff --git a/blogproj/module1/tests.py b/module1/tests.py similarity index 100% rename from blogproj/module1/tests.py rename to module1/tests.py diff --git a/requirements.txt b/requirements.txt index 4c2e358..9d77c28 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ Django==2.2.5 pytz==2019.2 +six==1.13.0 sqlparse==0.3.0 +unittest-xml-reporting==2.5.2 diff --git a/blogproj/static/apple-touch-icon.png b/static/apple-touch-icon.png similarity index 100% rename from blogproj/static/apple-touch-icon.png rename to static/apple-touch-icon.png diff --git a/blogproj/static/browserconfig.xml b/static/browserconfig.xml similarity index 100% rename from blogproj/static/browserconfig.xml rename to static/browserconfig.xml diff --git a/blogproj/static/css/main.css b/static/css/main.css similarity index 100% rename from blogproj/static/css/main.css rename to static/css/main.css diff --git a/blogproj/static/favicon.ico b/static/favicon.ico similarity index 100% rename from blogproj/static/favicon.ico rename to static/favicon.ico diff --git a/blogproj/static/fonts/GothamBold.ttf b/static/fonts/GothamBold.ttf similarity index 100% rename from blogproj/static/fonts/GothamBold.ttf rename to static/fonts/GothamBold.ttf diff --git a/blogproj/static/fonts/GothamBook.ttf b/static/fonts/GothamBook.ttf similarity index 100% rename from blogproj/static/fonts/GothamBook.ttf rename to static/fonts/GothamBook.ttf diff --git a/blogproj/static/fonts/GothamMedium.ttf b/static/fonts/GothamMedium.ttf similarity index 100% rename from blogproj/static/fonts/GothamMedium.ttf rename to static/fonts/GothamMedium.ttf diff --git a/blogproj/static/fonts/glyphicons-halflings-regular.eot b/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from blogproj/static/fonts/glyphicons-halflings-regular.eot rename to static/fonts/glyphicons-halflings-regular.eot diff --git a/blogproj/static/fonts/glyphicons-halflings-regular.svg b/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from blogproj/static/fonts/glyphicons-halflings-regular.svg rename to static/fonts/glyphicons-halflings-regular.svg diff --git a/blogproj/static/fonts/glyphicons-halflings-regular.ttf b/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from blogproj/static/fonts/glyphicons-halflings-regular.ttf rename to static/fonts/glyphicons-halflings-regular.ttf diff --git a/blogproj/static/fonts/glyphicons-halflings-regular.woff b/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from blogproj/static/fonts/glyphicons-halflings-regular.woff rename to static/fonts/glyphicons-halflings-regular.woff diff --git a/blogproj/static/index.html b/static/index.html similarity index 100% rename from blogproj/static/index.html rename to static/index.html diff --git a/blogproj/static/js/main.js b/static/js/main.js similarity index 100% rename from blogproj/static/js/main.js rename to static/js/main.js diff --git a/blogproj/static/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js b/static/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js similarity index 100% rename from blogproj/static/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js rename to static/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js diff --git a/blogproj/static/js/vendor/npm.js b/static/js/vendor/npm.js similarity index 100% rename from blogproj/static/js/vendor/npm.js rename to static/js/vendor/npm.js diff --git a/blogproj/static/tile-wide.png b/static/tile-wide.png similarity index 100% rename from blogproj/static/tile-wide.png rename to static/tile-wide.png diff --git a/blogproj/static/tile.png b/static/tile.png similarity index 100% rename from blogproj/static/tile.png rename to static/tile.png diff --git a/blogproj/templates/base.html b/templates/base.html similarity index 100% rename from blogproj/templates/base.html rename to templates/base.html diff --git a/blogproj/users/__init__.py b/users/__init__.py similarity index 100% rename from blogproj/users/__init__.py rename to users/__init__.py diff --git a/blogproj/users/admin.py b/users/admin.py similarity index 100% rename from blogproj/users/admin.py rename to users/admin.py diff --git a/blogproj/users/apps.py b/users/apps.py similarity index 100% rename from blogproj/users/apps.py rename to users/apps.py diff --git a/blogproj/users/forms.py b/users/forms.py similarity index 100% rename from blogproj/users/forms.py rename to users/forms.py diff --git a/blogproj/users/migrations/0001_initial.py b/users/migrations/0001_initial.py similarity index 100% rename from blogproj/users/migrations/0001_initial.py rename to users/migrations/0001_initial.py diff --git a/blogproj/users/migrations/__init__.py b/users/migrations/__init__.py similarity index 100% rename from blogproj/users/migrations/__init__.py rename to users/migrations/__init__.py diff --git a/blogproj/users/models.py b/users/models.py similarity index 100% rename from blogproj/users/models.py rename to users/models.py diff --git a/blogproj/users/templates/registration/login.html b/users/templates/registration/login.html similarity index 100% rename from blogproj/users/templates/registration/login.html rename to users/templates/registration/login.html diff --git a/blogproj/users/templates/registration/register.html b/users/templates/registration/register.html similarity index 100% rename from blogproj/users/templates/registration/register.html rename to users/templates/registration/register.html diff --git a/blogproj/users/tests.py b/users/tests.py similarity index 100% rename from blogproj/users/tests.py rename to users/tests.py diff --git a/blogproj/users/urls.py b/users/urls.py similarity index 100% rename from blogproj/users/urls.py rename to users/urls.py diff --git a/blogproj/users/views.py b/users/views.py similarity index 100% rename from blogproj/users/views.py rename to users/views.py