JeffPeterson
JeffPeterson
RRailway
Created by JeffPeterson on 10/12/2024 in #✋|help
How to get Caddy, React, and Express to play nice with each other?
@Brody You're amazing! Thanks that was all it was.
8 replies
RRailway
Created by JeffPeterson on 10/12/2024 in #✋|help
How to get Caddy, React, and Express to play nice with each other?
Navigating to the Frontend: https://railway-deployment-testing.up.railway.app/test After navigating to the Frontend, there is a button which requests some API. Here is a simple GET endpoint in the Express backend: /api/v1/helloWorld That endpoint will throw the CORS error from the React application. Currently, the backend service is unexposed publicly and I intend to only use internal networking. However, I did test that the backend service works when it has its own exposed domain.
8 replies
RRailway
Created by JeffPeterson on 10/12/2024 in #✋|help
How to get Caddy, React, and Express to play nice with each other?
bd9d2446-119b-4082-a16d-a0e471fa974d
8 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
No problem! I am going to figure out why the Django application is not using the django_session table
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Basically it was a string
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Ah okay I fixed it. It was actually a syntax error where I did not put "*" in:
exec gunicorn --forwarded-allow-ips * django_project.wsgi --bind [::]:${PORT} --timeout 0
exec gunicorn --forwarded-allow-ips * django_project.wsgi --bind [::]:${PORT} --timeout 0
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
This is also correct
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
That is correct
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Unfortunately I had signed an NDA so it is not possible at the moment. But if you would like to look at a specific file I can do my best to provide it
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Here is my repository structure:
backend-django
django_project
AppTwo
...
Core
API
v1
__init__.py
admin.py
apps.py
helpers.py
permisssions.py
serializers.py
services.py
views.py
viewsets.py
v2
(similar to v1)
migrations
...
django_project
__init__.py
asgi.py
router.py
urls.py
wsgi.py
settings
__init__.py
base.py
settings_local.py
settings_production.py
set_up.sh
backend-django
django_project
AppTwo
...
Core
API
v1
__init__.py
admin.py
apps.py
helpers.py
permisssions.py
serializers.py
services.py
views.py
viewsets.py
v2
(similar to v1)
migrations
...
django_project
__init__.py
asgi.py
router.py
urls.py
wsgi.py
settings
__init__.py
base.py
settings_local.py
settings_production.py
set_up.sh
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Maybe it is how my project structure is structured?
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
No sir
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
And set_up.sh:
exec gunicorn --forwarded-allow-ips * django_project.wsgi --bind [::]:${PORT} --timeout 0
exec gunicorn --forwarded-allow-ips * django_project.wsgi --bind [::]:${PORT} --timeout 0
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
FROM python:3.11.6

WORKDIR /app/django_project

COPY ./backend-django/requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY ./backend-django /app

WORKDIR /app/django_project

EXPOSE 8000
EXPOSE 5672
EXPOSE 15672

# RUN python manage.py makemigrations && python manage.py migrate

CMD ["sh", "set_up.sh"]
FROM python:3.11.6

WORKDIR /app/django_project

COPY ./backend-django/requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY ./backend-django /app

WORKDIR /app/django_project

EXPOSE 8000
EXPOSE 5672
EXPOSE 15672

# RUN python manage.py makemigrations && python manage.py migrate

CMD ["sh", "set_up.sh"]
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
And there is no additional start command in my railway settings
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Actually it fails locally also
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Oh you mean in railway
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Sorry, where would I find the service settings? I am not using a procfile or a gunicorn config file
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Unfortunately I get the same error:
Failed to find attribute 'application' in 'Core'.
Failed to find attribute 'application' in 'Core'.
I must be doing something wrong:
gunicorn --forwarded-allow-ips * django_project.wsgi --bind [::]:${PORT} --timeout 0
gunicorn --forwarded-allow-ips * django_project.wsgi --bind [::]:${PORT} --timeout 0
46 replies
RRailway
Created by JeffPeterson on 3/21/2024 in #✋|help
Retrieving Django database sessions work locally behind a proxy but fail on Railway?
Ahh thanks for the information. I will reploy now
46 replies