7 months ago
only chat application not work other functionality working perfectly
frontend error: WebSocket encountered an error:
Chat socket closed unexpectedly:
backend error: Not Found: /ws/chat/2f2ceffd-d524-4f68-881d-7170ea620c37/
all setup done perfectly but now stuck not getting the solution from anywhere
0 Replies
7 months ago
please do not create duplicate posts or cross post
7 months ago
you need to use Daphne
7 months ago
that id doesnt bring me to a project
7 months ago
you arent
release: python manage.py migrate
worker: daphne -b 0.0.0.0 -p $PORT charity_pro.asgi:application
7 months ago
you are using a Dockerfile, Procfiles are irrelevant
7 months ago
please enclose that in a code block
# Pull official base image
FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy project
COPY . /app/
# Install gunicorn
RUN pip install gunicorn
# Collect static files
# RUN python manage.py collectstatic --noinput
# Expose the dynamic port (optional, but not necessary)
EXPOSE 8000
# Use the environment variable $PORT for deployment
CMD ["gunicorn", "-k", "daphne", "-b", "0.0.0.0:$PORT", "charity_pro.asgi:application"]
7 months ago
you can edit discord messages lol
7 months ago
2 problems.
you are overwriting that CMD line via the start command in the service settings.
you are using exec form for that CMD line
7 months ago
please fix the two issues i had just brought up
7 months ago
send me your dockerfile
# Pull official base image
FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy project
COPY . /app/
# Install gunicorn
RUN pip install gunicorn daphne
# Collect static files
# RUN python manage.py collectstatic --noinput
# Expose the dynamic port (optional, but not necessary)
EXPOSE 8000
release: python manage.py migrate
worker: daphne -b 0.0.0.0 -p $PORT charity_pro.asgi:application
7 months ago
again, you are using a Dockerfile, the Procfile is totally irrelevant and unused
7 months ago
still 2 problems.
you are missing a CMD line
you are setting a start command in the service settings
so this is my dockerfile updated and removed procfile
# Pull official base image
FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy project
COPY . /app/
# Install gunicorn
RUN pip install gunicorn daphne
# Collect static files
# RUN python manage.py collectstatic --noinput
# Expose the dynamic port (optional, but not necessary)
EXPOSE 8000
# Use the environment variable $PORT for deployment
CMD ["gunicorn", "-k", "daphne", "-b", "0.0.0.0:$PORT", "charity_pro.asgi:application"]
still getting this error: Not Found: /ws/chat/2f2ceffd-d524-4f68-881d-7170ea620c37/
7 months ago
2 problems.
you are overwriting that CMD line via the start command in the service settings.
you are using exec form for that CMD line
7 months ago
filename?
7 months ago
what about it? you havent done that yet
7 months ago
send your dockerfile please
```# Pull official base image
FROM python:3.12-slim
Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DJANGOSETTINGSMODULE charitypro.settings # Properly set DJANGOSETTINGS_MODULE to point to your settings module
Set working directory
WORKDIR /app
Install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
Copy project files
COPY . /app/
Install daphne (no need for gunicorn)
RUN pip install daphne
Expose the dynamic port (optional)
EXPOSE 8000
Use the environment variable $PORT for deployment
CMD ["sh", "-c", "daphne -b 0.0.0.0 -p $PORT charity_pro.asgi:application"]
```
now getting this error:
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
7 months ago
this would be an application level issue
7 months ago
im glad you where able to solve, but please note we can't offer application level support