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