From 05a3fbd35a822af4bd5ca5abe28571499ab6dff6 Mon Sep 17 00:00:00 2001 From: Dmitriy Shesterkin Date: Fri, 28 Apr 2017 22:37:39 +0300 Subject: [PATCH] refactor makefile, fixtures --- Makefile | 13 ++++-- .../commons/fixtures}/cms.json | 44 ++++++++++++++++--- .../commons/fixtures}/sites.json | 0 .../customer/fixtures}/price.json | 0 .../docs/fixtures}/country.json | 0 .../docs/fixtures}/currency.json | 0 .../docs/fixtures}/measure.json | 0 project/local_settings.py.skeleton | 2 +- .../myauth/fixtures}/myauth.json | 2 +- 9 files changed, 50 insertions(+), 11 deletions(-) rename {fixtures => project/commons/fixtures}/cms.json (94%) rename {fixtures => project/commons/fixtures}/sites.json (100%) rename {fixtures => project/customer/fixtures}/price.json (100%) rename {fixtures => project/docs/fixtures}/country.json (100%) rename {fixtures => project/docs/fixtures}/currency.json (100%) rename {fixtures => project/docs/fixtures}/measure.json (100%) rename {fixtures => project/myauth/fixtures}/myauth.json (81%) diff --git a/Makefile b/Makefile index b64a28f..665ac8f 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ VENV_DIR?=$(PROJECT_DIR)/env PIP?=$(VENV_DIR)/bin/pip PYTHON?=$(VENV_DIR)/bin/python -.PHONY: all clean test run requirements install virtualenv copy_settings +.PHONY: all clean test run requirements install virtualenv copy_settings loaddata -all: copy_settings virtualenv install create_database +all: copy_settings virtualenv install create_database loaddata copy_settings: cp $(PROJECT_DIR)/project/local_settings.py.skeleton $(PROJECT_DIR)/project/local_settings.py @@ -19,7 +19,14 @@ requirements: $(PIP) install -r $(PROJECT_DIR)/requirements.txt loaddata: - $(PYTHON) manage.py manage.py loaddata data/fixtures.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/myauth/fixtures/myauth.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/commons/fixtures/cms.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/commons/fixtures/djangocms_text_ckeditor.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/commons/fixtures/sites.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/customer/fixtures/price.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/docs/fixtures/country.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/docs/fixtures/currency.json + $(PYTHON) manage.py loaddata $(PROJECT_DIR)/project/docs/fixtures/measure.json create_database: $(PYTHON) manage.py migrate diff --git a/fixtures/cms.json b/project/commons/fixtures/cms.json similarity index 94% rename from fixtures/cms.json rename to project/commons/fixtures/cms.json index ffb31d3..b47e971 100644 --- a/fixtures/cms.json +++ b/project/commons/fixtures/cms.json @@ -20,7 +20,7 @@ "changed_by": "admin", "parent": null, "creation_date": "2017-04-28T12:45:08.196Z", - "changed_date": "2017-04-28T13:20:42.882Z", + "changed_date": "2017-04-28T19:31:50.501Z", "publication_date": "2017-04-28T12:45:08.289Z", "publication_end_date": null, "in_navigation": true, @@ -55,7 +55,7 @@ "changed_by": "admin", "parent": null, "creation_date": "2017-04-28T12:45:08.292Z", - "changed_date": "2017-04-28T13:20:42.824Z", + "changed_date": "2017-04-28T19:31:50.458Z", "publication_date": "2017-04-28T12:45:08.289Z", "publication_end_date": null, "in_navigation": true, @@ -456,7 +456,23 @@ { "model": "cms.cmsplugin", "fields": { - "path": "0002", + "path": "0003", + "depth": 1, + "numchild": 0, + "placeholder": 2, + "parent": null, + "position": 1, + "language": "ru", + "plugin_type": "TextPlugin", + "creation_date": "2017-04-28T19:14:40.568Z", + "changed_date": "2017-04-28T19:31:45.727Z" + }, + "pk": 4 +}, +{ + "model": "cms.cmsplugin", + "fields": { + "path": "0004", "depth": 1, "numchild": 0, "placeholder": 3, @@ -464,10 +480,26 @@ "position": 0, "language": "ru", "plugin_type": "TextPlugin", - "creation_date": "2017-04-28T13:05:41.393Z", - "changed_date": "2017-04-28T13:20:42.787Z" + "creation_date": "2017-04-28T19:31:50.411Z", + "changed_date": "2017-04-28T19:31:50.414Z" }, - "pk": 3 + "pk": 5 +}, +{ + "model": "cms.cmsplugin", + "fields": { + "path": "0005", + "depth": 1, + "numchild": 0, + "placeholder": 3, + "parent": null, + "position": 1, + "language": "ru", + "plugin_type": "TextPlugin", + "creation_date": "2017-04-28T19:14:40.568Z", + "changed_date": "2017-04-28T19:31:50.428Z" + }, + "pk": 6 }, { "model": "cms.title", diff --git a/fixtures/sites.json b/project/commons/fixtures/sites.json similarity index 100% rename from fixtures/sites.json rename to project/commons/fixtures/sites.json diff --git a/fixtures/price.json b/project/customer/fixtures/price.json similarity index 100% rename from fixtures/price.json rename to project/customer/fixtures/price.json diff --git a/fixtures/country.json b/project/docs/fixtures/country.json similarity index 100% rename from fixtures/country.json rename to project/docs/fixtures/country.json diff --git a/fixtures/currency.json b/project/docs/fixtures/currency.json similarity index 100% rename from fixtures/currency.json rename to project/docs/fixtures/currency.json diff --git a/fixtures/measure.json b/project/docs/fixtures/measure.json similarity index 100% rename from fixtures/measure.json rename to project/docs/fixtures/measure.json diff --git a/project/local_settings.py.skeleton b/project/local_settings.py.skeleton index 90deaaf..3ad336e 100644 --- a/project/local_settings.py.skeleton +++ b/project/local_settings.py.skeleton @@ -14,7 +14,7 @@ ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(ROOT_DIR, 'db.sqlite3'), + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } diff --git a/fixtures/myauth.json b/project/myauth/fixtures/myauth.json similarity index 81% rename from fixtures/myauth.json rename to project/myauth/fixtures/myauth.json index 2c9d258..18d67b5 100644 --- a/fixtures/myauth.json +++ b/project/myauth/fixtures/myauth.json @@ -2,7 +2,7 @@ { "model": "myauth.dokuser", "fields": { - "password": "pbkdf2_sha256$20000$4lp35nWDneop$3gGZhdpBKr8qtLTEWpm9bBUGVSq2hIHJ3rKk0B3jIOA=", + "password": "pbkdf2_sha256$20000$DFxqy2ZZbqEX$TEYwNIjSWNcEeUeuo/Mq/gjnpPFNkX+nOte4ZGleu2Y=", "last_login": "2017-04-28T13:31:41.512Z", "is_superuser": true, "username": "admin",