Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

После запуска не загрузился базовый шаблон #6

Closed
SergeyMi37 opened this issue Jun 2, 2023 · 4 comments

Comments

@SergeyMi37
Copy link

После запуска не загрузился базовый шаблон
image

Админка работает нормально

@natkaida
Copy link
Owner

natkaida commented Jun 2, 2023

Настройки для разработки (не для продакшена) в config/settings.py :

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    BASE_DIR / 'static'
]

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

@SergeyMi37
Copy link
Author

Не помогло
(venv) student@st:~/App/blogit$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/student/App/blogit/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/student/App/blogit/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/student/App/blogit/venv/lib/python3.8/site-packages/django/core/management/base.py", line 546, in check
raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting.

System check identified 1 issue (0 silenced).

@SergeyMi37
Copy link
Author

Помогло так.
STATIC_ROOT = BASE_DIR / "staticfiles"

@XJIeb
Copy link

XJIeb commented Sep 25, 2023

#STATIC_ROOT = os.path.join(BASE_DIR, 'collected_static/')

STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]

не знаю стоит ли писать но вдруг, я python manage.py collectstatic писал еще

А так проект стоящий, понравилась реализация. Красиво сделано

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants