TheJoker
TheJoker
RRailway
Created by TheJoker on 11/16/2024 in #✋|help
Trouble creating superuser django
I'm unable to login as super user into a Django backend. More specifically I can't seem to create the user from Railway CLI locally. I link my Django project with Railway link then railway run python manage.py cre.......... It successfully creates the superuser. When I goto my Railway deployed environment nothing has changed? I must be missging a stage or miss understanding what to do here.......I tired adding the the creating command to my start but it doesn't allow it to run. NOTE - i'm not connected to my Production db locally as I get a error django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: No such host is known.` I pressume this is why. I need to connect o production db before running the Railway CLI obviosuly. So how do I solve the host name error so I can connect to production. I have checked env varibles and they seem correct...production build is working and deployed.I just get this error when connecting locally. I using dj_database in my django setting to parse the db adress held in my .env. if live == True: print("live) DATABASES = { 'default': dj_database_url.config(default=os.getenv('DATABASE_URL')) } Project ID 314df6c0-152c-4a1a-b00a-815bc40f86b9
4 replies
RRailway
Created by TheJoker on 11/8/2024 in #✋|help
React and Django REST Framework
Project ID: N/A Quick query before I start working on something. I have deployed a React frontend with a Pocketbase API before on Railway, but i had to deploy so separate projects then axios to the API url How do I deploy DRF and React (separate repos) to the same Railway project and get them talking to each other?
10 replies
RRailway
Created by TheJoker on 9/26/2024 in #✋|help
access from localhost
Project id: n/a Hi, I have a Pocketbase instance running on Railway which I am using to store data and access this in a React project by calling the URL of the PB instance, this React project is on another Railway container. All works well. When in my dev environment i cant access the pocketbase url from locahost. Is there anyway I can set it up to accept localhost requests?
10 replies
RRailway
Created by TheJoker on 1/3/2024 in #✋|help
Files in Volumes
I'm writing a file to a volume within my project, is there anyway to view that file within Railway (cant' see any) is it a case of writing a script to view files from a volume? id - n/a
9 replies
RRailway
Created by TheJoker on 12/31/2023 in #✋|help
[CRITICAL] WORKER TIMEOUT (pid:13) error
My app builds OK and deploys but I notice static files in Console/Network are pending, then once they load in my Railway Deploy logs I get
[12] [CRITICAL] WORKER TIMEOUT (pid:13)

[13] [INFO] Worker exiting (pid: 13)

[12] [ERROR] Worker (pid:13) exited with code 1

[12] [ERROR] Worker (pid:13) exited with code 1.

[14] [INFO] Booting worker with pid: 14
[12] [CRITICAL] WORKER TIMEOUT (pid:13)

[13] [INFO] Worker exiting (pid: 13)

[12] [ERROR] Worker (pid:13) exited with code 1

[12] [ERROR] Worker (pid:13) exited with code 1.

[14] [INFO] Booting worker with pid: 14
Is it timing out whilst trying to load my static files? The site is also incredible slow to load betwenn requests. Site is being buit via this railway.json, i've tried adding timeout command to gunicorn as I read that may solve the problem but not 100% of syntax within a json file
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"]
}
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --no-input && gunicorn mysite.wsgi"
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"]
}
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --no-input && gunicorn mysite.wsgi"
}
}
11 replies
RRailway
Created by TheJoker on 12/30/2023 in #✋|help
Static files not working
This is related to a Django problem where Railway isn't collecting my static files on deployment, i know this is a common problem with Dajngo and is usually an easy fix but tried everything. I using Whitenoise to serve them, it's installed, doubled checked. Static settings are pointing towards where they should...project structure is ..foo/static In my settings...
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)

STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATIC_URL = "/static/"
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)

STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATIC_URL = "/static/"
I'm running collect static at build, files are in repo. I realise this code be an issue with my code and unrelated to Railway, but i've checked everything. id - 175edb31-fcdb-4550-a1d8-3f56f4ed6301
7 replies
RRailway
Created by TheJoker on 12/26/2023 in #✋|help
Dajngo/Tailwind deployment Error: No start command could be found
Project id - 5b1ca7b8-37a6-491d-a6e1-2ca3e0236431 Hi, can someone help me with this error I am getting on build. Its a Django project which is dependant on Tailwind (via Django-Tailwind), I understand it needs Node to function but my pre-deployment research led me to believe that Django-Tailwind would compile the package.json and Nix would automatically install Node and any dependencies on Build (oh so easy right 🙂 ). Obviously this isn't the case. What should I be looking to put into my package.json, which I assume needs a script/command ? I'm a Python/Django person so this is a mystery to me. Any help much appreciated.
103 replies
RRailway
Created by TheJoker on 12/12/2023 in #✋|help
Logging user data
Hi, I'm about to put a Django project into production on Railway, at the moment in dev testing I'm logging visitors IP addresses/time stamps to a text file. Is there a proven workflow within Railway which can securely handle this sort of thing? How do I write to a file in a secure way?
8 replies
RRailway
Created by TheJoker on 5/9/2023 in #✋|help
Django, Tailwind deployment
Hey, i'm building a project with Django and Tailwind and just thinking ahead with deployment to Railway (already deployed a couple of apps and it's amazing). Tailwind is reliant on Node, how do I deploy a Django/Node project? Does Nixpacks handle everything on build? Any advice much appreciated.
4 replies
RRailway
Created by TheJoker on 5/7/2023 in #✋|help
Django + Node deployment
Hi, i'm currently building a Wagtail (Django) project that uses Tailwind (Django-Tailwind) which is reliant on Node. Can anyone advise me on how I go about starting a Railway deployment for this? I already have a couple of Django apps up and running which was straightforward, but, want to prepare for any complexities once this is ready for deployment on Railway. I normally deploy from Github Repo via browser. Will Nixpacks build everything?
4 replies
RRailway
Created by TheJoker on 1/16/2023 in #✋|help
Getting custom domain working without www
Hi, i'm not totally sure this is a specific Railway issue but any help is much appreciated. I have a 123Reg cutom domain which works great with www, but I can't get it to work without, it just redirects to a 123reg holding page. I raised a ticket with 123Reg and they have been next to useless. There is nothing specific in the Railway docs. Any help? id - 1b555e82-d5b7-4d50-b9de-354684ce6be6
9 replies
RRailway
Created by TheJoker on 11/17/2022 in #✋|help
Re-deployment option
Hi, I have a app deployed and was running all good, I made some changes locally and pushed these to Gihub but I turned off automatic deployments. How do I redeploy my app, I can't see that option anywhere? I restarted the previous deployment and that didn't build my latest commit. I enabled automatic deployments again but still nothing. prohect i/d - 1b555e82-d5b7-4d50-b9de-354684ce6be6
4 replies
RRailway
Created by TheJoker on 11/13/2022 in #✋|help
relation 'foo_bar' does not exist
Hi, i'm trying to deploy a Django app put getting error with my DB relationships as they don't exists, i'm unsure how to create them with Railway, all works well locally. The app has deployed but after connecting Postgres and running migrate (which goes fine) and creating a superuser, I get "ProgrammingError at / relation "foo_bar" does not exist". I don't see any of my models in the DB so obvious i'll be getting this problem. How do i go about migrating my local DB to Railway? Sorry kinda new to deployment. ID - 1b555e82-d5b7-4d50-b9de-354684ce6be6
3 replies
RRailway
Created by TheJoker on 11/10/2022 in #✋|help
Nixpacks error on build
Hi, just trying to deploy a Django project to Railway for the first time (simple right?) via Github but i't failing straight away and i'm getting this error in build logs - "Nixpacks was unable to generate a build plan for this app. Please check the documentation for supported languages: https://nixpacks.com" Everything looks fine with my file structure on Github. Procfile, requirements, runtime are all there. Any advice much appreciated
7 replies