P
P
Pan Propan2018-08-14 11:32:14
Django
Pan Propan, 2018-08-14 11:32:14

How to set MEDIA_URL in Django+VueJS?

All the best, I have dough.
I'm trying to master a bunch of Django + VueJS.
I add articles through the Django Admin. Content is received via Django Rest Framework and displayed on the front via Vue.
Faced such a problem.
Django gives me the html text of the article, which already contains the paths to the images. And they are written from the root url on which Django is spinning, i.e. htttp://localhost:8000, and since the front works for me on http://localhost:/8080 , then I can’t see the images accordingly.
An example of the path that is available is
localhost:8080/media/django-summernote/2018-07-15/...
MediaRoot settings are as follows

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question