Iceman
Page load times too slow
I've added an endpoint to my site which is receiving requests multiple times a second and then updating the database. The problem is that it's massively slowing down page load times - some times taking more than 50 seconds to load.
I've changed the runtime to V2 and increased the replicas to 4 but it's not made much difference. I'm currently using the Hobby plan and wonder if I need to upgrade to the Pro plan or just offload the database updates to Redis or another server entirely.
Any help would be much appreciated. Thanks!
12 replies
Egress usage has sky-rocketed
I deleted my postgress database a week ago and reinstalled it only to find yesterday that the egress usage had gone from almost nothing to $18.
I have since deleted the database and reinstalled it again and now it's gone down to around a third of that. Any idea how to get it back to almost nothing again? I have no idea what has caused it to jump.
25 replies
SECURE_SSL_REDIRECT setting for Django
From the docs:
Note
If turning this to True causes infinite redirects, it probably means your site is running behind a proxy and can’t tell which requests are secure and which are not. Your proxy likely sets a header to indicate secure requests; you can correct the problem by finding out what that header is and configuring the SECURE_PROXY_SSL_HEADER setting accordingly.
I'm getting infinite redirects, anyone know where you can find the header for this? I've tried SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
but it didn't work.
Any help would be much appreciated!12 replies
Can't install Weasyprint in Django
Hi, I'm trying to install Weasyprint in my Dango project. I've got it working locally but can't seem to upload it to the server and get this error:
OSError: cannot load library 'gobject-2.0-0': gobject-2.0-0: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0-0'
/bin/bash: line 1: -----: command not found
This is my nixpacks.toml:
[phases.setup]
nixPkgs = ["...", "pango", "libffi" ]
I've been going through their installation guide but can't figure out what I'm missing. This is the guide: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html
Any help would be appreciated.111 replies
Redis not configured properly for Django
Hi, I'm trying to use Redis with Django and Channels. I keep getting this error message which seems to be suggesting that Redis isn't configured for running redis-py commands.
I've tried to change the channel layer settings and not got anywhere. I don't know whether I'm supposed to be adding some sort of default setting for Redis itself. - got no idea why it's trying to connect to localhost. Anyone have any idea how to fix this?
r.hset(self.scope['user'].username, mapping={'channel' : self.channel_name})
File "/opt/venv/lib/python3.11/site-packages/redis/commands/core.py", line 5019, in hset
return self.execute_command("HSET", name, *items)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/redis/client.py", line 505, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/redis/connection.py", line 1073, in get_connection
connection.connect()
File "/opt/venv/lib/python3.11/site-packages/redis/connection.py", line 265, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
15 replies
Does anyone know what the procfile command should be for Django Daphne?
I'm trying to move from wsgi to asgi in Django and not sure what the procfile command should be.
I've tried changing gunicorn app.wsgi to `daphne app.asgi but it didn't work.
6 replies
Railway run not working
Hi, I'm trying to run a local command in visual studio code: railway run python manage.py createsuperuser
Every time I run it, I get "Looking good? Run
railway up
to deploy your changes!" which is clearly not what I'm looking for.
Could you please let me know how to fix this?225 replies