1
I hate my life
i missed the $ in one of my urls.py
what i had
url(r'^', views.index, name='index'),
what i changed to
url(r'^$', views.index, name='index'),
It took me more than 24 hours to figure it out but i still dont know why only the files that i wanted to get were affected
0
In the for loop
<audio controls>
<source src="{{audios.Audio_File.url}}" type="audio/{{audios.Audio_File.type}}">
Your browser does not support the audio tag.
</audio>
At least we will know if the browser is supporting the audio and then we will debug it from there.
- Using nested Django transaction.atomic() to handle exceptions?
- Django / WagtailCMS β get attribute (eg body text) of child page using get_context
- Is it possible to build a homepage with python on virtual server when the sudo command is disabled?
- Django 2.7 Rest API Validation Request
- Optimise Django subquery (currently using `annotate` and `Count`)
0
I believe that you should first configure your static and media in settings
BASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))
import os.path
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(ROOT_PATH, 'static/')
MEDIA_ROOT = os.path.join(ROOT_PATH, 'media/')
MEDIA_URL = '/media/'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader'
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
then just put some file in static and try to access it through browser, then check your Audio_File.url so itβs generating properly
Source:stackexchange.com