mirror of
https://github.com/thecyberlearn/chat-backend.git
synced 2026-08-18 20:32:52 +00:00
Features: - Django REST API backend - Multi-strategy web scraping system (Beautiful Soup, Playwright, Firecrawl) - Anti-detection features (proxy rotation, user-agent rotation) - Data export functionality (JSON, CSV, TXT) - Business and CrawledPage models - Enhanced crawling service with fallback mechanisms 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
846 B
Python
30 lines
846 B
Python
from django.conf import STATICFILES_STORAGE_ALIAS, settings
|
|
from django.contrib.staticfiles.finders import get_finders
|
|
from django.core.checks import Error
|
|
|
|
E005 = Error(
|
|
f"The STORAGES setting must define a '{STATICFILES_STORAGE_ALIAS}' storage.",
|
|
id="staticfiles.E005",
|
|
)
|
|
|
|
|
|
def check_finders(app_configs=None, **kwargs):
|
|
"""Check all registered staticfiles finders."""
|
|
errors = []
|
|
for finder in get_finders():
|
|
try:
|
|
finder_errors = finder.check()
|
|
except NotImplementedError:
|
|
pass
|
|
else:
|
|
errors.extend(finder_errors)
|
|
return errors
|
|
|
|
|
|
def check_storages(app_configs=None, **kwargs):
|
|
"""Ensure staticfiles is defined in STORAGES setting."""
|
|
errors = []
|
|
if STATICFILES_STORAGE_ALIAS not in settings.STORAGES:
|
|
errors.append(E005)
|
|
return errors
|