yori_39035
yori_39035
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
I figured out the issue! What was happening is I was not using a GET decorator for the Python method. While that method was working on local (because of following a tutorial), Django must require a decorator for security authentication from an external URL (just a guess). But that worked! Thank you so much for your help!!!
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
yes, but i'm not returning data from a database currently, just dummy test data in the python script
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
yes
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
I am just using the Django Starter REST repo given by Railway
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
No description
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Railway:
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
No description
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
0.0.0.0:
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
However, I noticed that the header size is much larger for 0.0.0.0 url, so maybe an authentication thing? ]
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
I would have to make another one because this is the company git
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Here is the response from 0.0.0.0:8000/join-codes endpoint which returns also a successful response, but this time returns the actual data: Summary URL: http://0.0.0.0:8000/join-codes/ Status: 200 OK Source: Network Address: 127.0.0.1:8000 Request GET /join-codes/ HTTP/1.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Connection: keep-alive Host: 0.0.0.0:8000 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15 Response HTTP/1.1 200 OK Content-Length: 178 Content-Type: application/json Cross-Origin-Opener-Policy: same-origin Date: Sun, 10 Sep 2023 22:53:28 GMT Referrer-Policy: same-origin Server: WSGIServer/0.2 CPython/3.10.9 Vary: origin X-Content-Type-Options: nosniff X-Frame-Options: DENY
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Here is the response from the Railway URL: (200 succesful REST API response but no data returned) Summary URL: https://django-rest-starter-production-xxxx.up.railway.app/join-codes/ Status: 200 Source: Network Address: xxxxxx Request :method: GET :scheme: https :authority: django-rest-starter-production-xxxx.up.railway.app :path: /join-codes/ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Connection: keep-alive Cookie: stripe_mid=f83557e6-3a42-4594-bafb-3c24a3bfdd8e0150bd; stripe_sid=2e6be1d1-6830-491e-8805-b12f10c8f22daf9969; ajs_anonymous_id=e9a1b8cf-e0ce-4e0e-b88c-707c374f04ba; ajs_user_id=39160776-f724-4d9e-a4b8-cd23a2df7871; csrftoken=hyPsStxpwOdc4OnEOAxHudDFxaHwI6uH Host: django-rest-starter-production-7b48.up.railway.app Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: none User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15 Response :status: 200 Content-Length: 2 Content-Type: application/json Cross-Origin-Opener-Policy: same-origin Date: Sun, 10 Sep 2023 22:50:45 GMT Referrer-Policy: same-origin Server: railway Vary: origin X-Content-Type-Options: nosniff X-Frame-Options: DENY
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
*I get the empty [] JSON endpoint data from the Railway domain
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
No, I'm not. The endpoint is there because when I specify a different endpoint from the one I set up I get a page not found. However, when I try the Railway domain, I get the [] JSON endpoint data. However, at 0.0.0.0:8000/endpoint, the data returns just fine
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Hmmm, still not working. Maybe some sort of Django authentication thing
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Do I need to also perhaps add this to trusted origins?
ALLOWED_HOSTS = [""]

Comment out the following line and place your railway URL, and your production URL in the array.
CSRF_TRUSTED_ORIGINS = ["
"]
ALLOWED_HOSTS = [""]

Comment out the following line and place your railway URL, and your production URL in the array.
CSRF_TRUSTED_ORIGINS = ["
"]
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
I believe this adds all available hosts? ALLOWED_HOSTS = ["*"] That's what I have
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
* at the railway domain
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Still not working. The end point works at: http://0.0.0.0:8000/join-codes/ but does not work at the domains. At https://django-rest-starter-production-xxxx.up.railway.app/join-codes/ I return an empty [] get response where the above returns json data Is this something I have to configure within Django?
34 replies
RRailway
Created by yori_39035 on 9/10/2023 in #✋|help
http://0.0.0.0:8000 to url
Thanks, that's what I already did
34 replies