#Django static wont work

23 messages · Page 1 of 1 (latest)

short sundial
#

none of my static files are loading or anything ive tried whitenoise and it works locally with debug to false but on railway nothing works.

fleet bridgeBOT
#

Project ID: N/A

short sundial
#

N/A

fleet bridgeBOT
#

It sounds like you may need to configure the STATICFILES_STORAGE setting and white noise configuration. Try following the instructions to see if that helps.

short sundial
#

I did already percy

#

lol

lean ravine
#

With an AWS S3 bucket static files worked fine on my Django app after COLLECTSTATIC with settings.py of:-

INSTALLED_APPS = [.... 'storages', .....]

AWS_STORAGE_BUCKET_NAME = 'your_bucket_name'
AWS_S3_REGION_NAME = 'your-region'  # e.g. us-east-2
AWS_DEFAULT_ACL = None
AWS_S3_CUSTOM_DOMAIN = f'{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com' #Used by django-storages

STATICFILES_LOCATION = 'staticfiles'
STATICFILES_STORAGE = 'custom_storages.StaticStorage' # For AWS Static Storage
MEDIAFILES_LOCATION = 'media'
DEFAULT_FILE_STORAGE = 'custom_storages.MediaStorage' # and Not MEDIAFILES_STORAGE as you might expect

Sounds like you are more familiar with whitenoise than I but if you would like a doublecheck I believe the comparable settings would be:-'

MIDDLEWARE = [ ....'whitenoise.middleware.WhiteNoiseMiddleware', ....]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
short sundial
#

but i had a nother question

#

Do you know if I am able to run a discord bot alongside django

info if it matters
Disnake (discord package)
Latest Django
Waitress Command to run: "web: waitress-serve --listen=*:5000 incognito.wsgi:application"

white silo
short sundial
#

i created a command

#

for it

#

like py manage.py RunBot and htat works but idk how to run them both at once

white silo
#

Create a new service in your project and add the Github repo for your bot there

#

Dashboard --> Project --> New (Top right) --> Github repo

floral holly
silk iron
#

What is the actual problem?
My guess is you're not certain how to create another service that runs a different command than runserver? But without more info it's hard to help.

short sundial
#

switched to react.js

#

but

#

you honestly should just get the website hosted on railway or something else and run the bot locally