To me, you are not going to serve static files but media files, am sure
that the image linked above was as a result of uploading it somewhere,
However much you try, heroku does not handle media files, when you upload
your image, the next refresh of the running dyno will delete it from your
file directory, unless you find a way of saving your images in the db
direct which django does not emphasise, you should push your media and
static files to AWS S3 bucket, if possible, please serve them using
cloudfront, your issue will be solved well.

This also increases your sites speed.

On Sun, Dec 5, 2021 at 4:41 PM Lakshyaraj Dash X-D 25 <
dashlakshyaraj2...@gmail.com> wrote:

> Inside settings.py,
>
> Write these two lines of code and your static files will be served
>
> import os
>
> STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
>
> On Sun, Dec 5, 2021, 18:49 Rahul <gerarounak...@gmail.com> wrote:
>
>> see brother i am not shouting at all . i am using heroku for deployment
>> and i didnt got any big error just in websites console ''failed to load
>> resource server responded with the status of 404 ''
>> i had deployed by pushing files to github and then using heroku  . i had
>> also used whitenoise but it didnt worked ,, im using sqllite3 which is
>> provided by django ..
>>
>> my website is working fine . just all the images which are shown in
>> picture are not working[image: problem.PNG]
>> On Saturday, 4 December 2021 at 22:03:56 UTC+5:30 Kasper Laudrup wrote:
>>
>>> On 04/12/2021 10.52, Rahul wrote:
>>> > hey guys  am using default database i.e. SQL Lite3 but when i deploy
>>> it
>>> > on heroku my static files are not getting served . Please suggest what
>>> > should i do??
>>> >
>>>
>>> You should tell us some relevant details, e.g. how you are deploying
>>> your project, any error messages, which instructions you have followed
>>> for deploying etc. so someone actually has a chance of helping you.
>>>
>>>
>>> > should i use postgres ???
>>> >
>>>
>>> Static files and the choice of database are not related so that won't
>>> make a difference.
>>>
>>> > Please HELP
>>> >
>>>
>>> Please don't SHOUT.
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF7qQgDYN6YudyqsuJvSyv2b8PWaO1r1fmveamxKYivMM793gA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF7qQgDYN6YudyqsuJvSyv2b8PWaO1r1fmveamxKYivMM793gA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
jet

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMjc0xVDBPC7U5ftiNJL9b_3N%2BV_v9pF9HCm_gUqFgVu1iqG5A%40mail.gmail.com.
  • ... Rahul
    • ... Kasper Laudrup
      • ... Rahul
        • ... Lakshyaraj Dash X-D 25
          • ... Jet Ezra
        • ... Kasper Laudrup
    • ... 'Mr. Aryan Sharma 4-Year B.Tech. Computer Science and Engineering' via Django users
    • ... Adriano Machado

Reply via email to