Important implementation notes for django-nextjs
mainTo ensure a stable integration, follow these requirements:
- Public Files: Place Next.js public files in the
public/nextsubdirectory. - Middleware: Ensure all your Django middlewares are async-capable.
- URL Configuration: Set
APPEND_SLASH = Falsein your Djangosettings.pyto prevent redirect loops. Do not add trailing slashes to your Next.js paths inurls.py. - Data Flow: Use an API (like Django REST Framework or GraphQL) to pass data between Django and Next.js.
- Server Management: This package does not start the Next.js server; you must run
npm run devornpm run startseparately.