From 129fde566cf77336e1e187cc7125cd807c59df5a Mon Sep 17 00:00:00 2001 From: BottomOfCulture Date: Sun, 12 Jun 2022 01:10:06 +0300 Subject: [PATCH] fix deps.txt --- articles/settings.py | 8 ++++---- frontend/package.json | 2 +- nginx.conf | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 nginx.conf diff --git a/articles/settings.py b/articles/settings.py index 4915982..a19aaf2 100644 --- a/articles/settings.py +++ b/articles/settings.py @@ -40,7 +40,7 @@ DEBUG = env.bool('DJANGO_DEBUG', True) INSTALLED_APPS = [ 'app', - 'whitenoise.runserver_nostatic', + # 'whitenoise.runserver_nostatic', 'corsheaders', 'django.contrib.admin', 'django.contrib.auth', @@ -53,8 +53,8 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', - 'whitenoise.middleware.WhiteNoiseMiddleware', - 'spa.middleware.SPAMiddleware', + # 'whitenoise.middleware.WhiteNoiseMiddleware', + # 'spa.middleware.SPAMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -96,7 +96,7 @@ DATABASES = { } -STATICFILES_STORAGE = 'spa.storage.SPAStaticFilesStorage' +# STATICFILES_STORAGE = 'spa.storage.SPAStaticFilesStorage' # Password validation diff --git a/frontend/package.json b/frontend/package.json index 54e00ea..43080de 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -36,6 +36,6 @@ "scripts": { "start": "parcel index.html -p 31235", "gqlcg": "graphql-codegen --config codegen.yml", - "build": "parcel build index.html --dist-dir build" + "build": "parcel build index.html --dist-dir build --public-url /static/" } } diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..458811a --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + server_name 161.35.151.134; + + location /static { + alias /var/www/Tasks_App/public/static; + } + + location /uploads { + alias /var/www/Tasks_App/public/uploads; + } + + location / { + include proxy_params; + proxy_pass http://localhost:8000/; + } +} \ No newline at end of file