diff --git a/Makefile.local b/Makefile.local --- a/Makefile.local +++ b/Makefile.local @@ -24,8 +24,8 @@ .PHONY: run-migrations run-migrations: - python3 swh/web/manage.py migrate -v0 2>/dev/null - python3 swh/web/manage.py createcachetable -v0 2>/dev/null + python3 swh/web/manage.py migrate --settings=swh.web.settings.development -v0 2>/dev/null + python3 swh/web/manage.py createcachetable --settings=swh.web.settings.development -v0 2>/dev/null .PHONY: run-migrations-prod run-migrations-prod: @@ -44,16 +44,16 @@ echo "flush_all" | nc -q 2 localhost 11211 2>/dev/null run-django-webpack-devserver: run-migrations yarn-install - bash -c "trap 'trap - SIGINT SIGTERM ERR; kill %1' SIGINT SIGTERM ERR; $(YARN) start-dev & sleep 10 && cd swh/web && python3 manage.py runserver --nostatic" + bash -c "trap 'trap - SIGINT SIGTERM ERR; kill %1' SIGINT SIGTERM ERR; $(YARN) start-dev & sleep 10 && cd swh/web && python3 manage.py runserver --nostatic --settings=swh.web.settings.development" run-django-webpack-dev: build-webpack-dev run-migrations - python3 swh/web/manage.py runserver --nostatic + python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.development run-django-webpack-prod: build-webpack-prod run-migrations-prod clear-memcached python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.production run-django-server-dev: run-migrations - python3 swh/web/manage.py runserver --nostatic + python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.development run-django-server-prod: run-migrations-prod clear-memcached python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.production diff --git a/swh/web/manage.py b/swh/web/manage.py --- a/swh/web/manage.py +++ b/swh/web/manage.py @@ -5,7 +5,6 @@ # License: GNU Affero General Public License version 3, or any later version # See top-level LICENSE file for more information -import os import sys from swh.web import config @@ -16,12 +15,6 @@ # in swh/web/urls.py, we pass the nostatic options to runserver # in order to have gzip compression enabled. swh_web_config['serve_assets'] = '--nostatic' in sys.argv - if len(sys.argv) > 1 and sys.argv[1] == 'test': - os.environ.setdefault("DJANGO_SETTINGS_MODULE", - "swh.web.settings.tests") - else: - os.environ.setdefault("DJANGO_SETTINGS_MODULE", - "swh.web.settings.development") # import root urls module for swh-web before running the django dev server # in order to ensure it will be automatically reloaded when source files # are modified (as django autoreload feature only works if the modules are