Skip to content

Commit 8d4ba5c

Browse files
committed
nginx configured
1 parent c861cc8 commit 8d4ba5c

6 files changed

Lines changed: 20 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ dmypy.json
136136

137137
cache
138138

139-
static
139+
nginx/static
140140
/emails/

nginx/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ FROM nginx:1.21-alpine
22

33
RUN rm /etc/nginx/conf.d/default.conf
44
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
5+
COPY ./static /procollab/static

nginx/nginx.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ server {
2626
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2727
proxy_set_header X-Forwarded-Host $server_name;
2828
}
29+
30+
location /static/ {
31+
alias /procollab/static/; # Укажите путь к вашим статическим файлам здесь
32+
}
33+
2934
}

procollab_skills/settings.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
from pathlib import Path
22
from decouple import config
33

4+
import mimetypes
5+
6+
mimetypes.add_type("application/javascript", ".js", True)
7+
mimetypes.add_type("text/css", ".css", True)
8+
mimetypes.add_type("text/html", ".html", True)
9+
10+
411
BASE_DIR = Path(__file__).resolve().parent.parent
512

613
SECRET_KEY = config("DJANGO_SECRET_KEY", cast=str)
714

815
DEBUG = config("DEBUG", default=False, cast=bool)
916

1017
ALLOWED_HOSTS = [
18+
"127.0.0.1:8001",
1119
"127.0.0.1:8000",
1220
"127.0.0.1",
1321
"localhost",
@@ -31,6 +39,8 @@
3139
"https://dev.procollab.ru",
3240
]
3341

42+
CORS_ALLOW_ALL_ORIGINS = True
43+
3444
INSTALLED_APPS = [
3545
"django.contrib.admin",
3646
"django.contrib.auth",
@@ -124,16 +134,16 @@
124134
},
125135
]
126136

127-
LANGUAGE_CODE = "en-us"
137+
LANGUAGE_CODE = "ru-ru"
128138

129-
TIME_ZONE = "UTC"
139+
TIME_ZONE = "Europe/Moscow"
130140

131141
USE_I18N = True
132142

133143
USE_TZ = True
134144

135145
STATIC_URL = "/static/"
136-
STATIC_ROOT = BASE_DIR / "static"
146+
STATIC_ROOT = BASE_DIR / "nginx/static"
137147

138148
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"
139149

0 commit comments

Comments
 (0)