Static files not being served on Railway

I deployed my Django app to Railway and I cant see the images. I know the issues probably lies in some configuration related to serving files in production. These are my config settings from Django:

import os

from datetime import timedelta

from pathlib import Path

import dotenv

import json

# Build paths inside the project like this: BASE_DIR / 'subdir'.

BASE_DIR = Path(__file__).resolve().parent.parent

dotenv_file = os.path.join(BASE_DIR, ".env")

if os.path.isfile(dotenv_file):


DEBUG = os.environ.get('DJANGO_DEBUG', 'False') == 'True'


# Application definition

    # apps


WSGI_APPLICATION = 'backend.wsgi.application'
    os.path.join(BASE_DIR, 'static'),

STATIC_URL = '/static/'

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

my Proc file:

web: gunicorn ‘backend.wsgi’
web: python migrate && gunicorn backend.wsgi

Is there something I might have to configure in Railway?

You need to run this command in your computer to create staticfiles folder in your Django structure with all static files.
python collectstatic

In you can use.

STATIC_ROOT = BASE_DIR / 'staticfiles'

Finnaly you need to push to your GIT repository the static files folder, created with the above command collectstatic.