2👍
✅
You need to add Alias /static/ /opt/bitnami/apps/django/django_projects/Project/static/
to your virtualhost config so the server knows to map /static/
requests to that folder.
1👍
I wasted A LOT of time on this, here’s my final working bitnami.conf
file.
<VirtualHost _default_:80>
WSGIDaemonProcess django_site python-home=/opt/bitnami/projects/env python-path=/opt/bitnami/projects/django_site.com
WSGIProcessGroup django_site
WSGIScriptAlias / /opt/bitnami/projects/django_site.com/django_site/wsgi.py
<Directory /opt/bitnami/projects/django_site.com>
AllowOverride all
Require all granted
Options FollowSymlinks
WSGIProcessGroup django_site
</Directory>
Alias /static/ /opt/bitnami/projects/django_site.com/static/
</VirtualHost>
Include "/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf"
Note:
-
I know it’s not recommended, but I put all the codes inside
bitnami.conf
and neglectedhttpd-app.conf
andhttpd-prefix.conf
-
I created python virtualenv at
/opt/bitnami/projects/env
and installed all needed libraries there -
I added the below code to my
settings.py
file before runningpython manage.py collectstatic
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
- [Django]-How to get the upload progress in using Django?
- [Django]-Serializing and deserializing in Django Rest Framework
- [Django]-Django, Borg pattern, API calls, caching results
- [Django]-Target WSGI Script Cannot Be Loaded as Python Module in Django App
- [Django]-Django loaddata returns a permission denied for relation
Source:stackexchange.com