Dears,
I am new here and i am trying to learn Django following a course. I wrote some code, uploaded my project to GitHub and configured Azure to get source from GitHub.
During the build action on GitHub portal, i see that it is stuck on collecting static files.
The error is:
django.core.exceptions.ImproperlyConfigured: You’re using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
I tried a lot of different solutions so far and in the end I have in settings.py :
STATIC_URL = ‘static/’
In deployment.py:
from .settings import *
STATIC_ROOT = str(BASE_DIR / ‘staticfiles’)
In manage.py:
settings_module = ‘backend.deployment’ if ‘WEBSITE_HOSTNAME’ in os.environ else ‘backend.settings’
In yml file:
- name: Create and start virtual environment
run: |
cd backend
export DJANGO_SETTINGS_MODULE=backend.deployment
python -m venv venv
source venv/bin/activate
On Azure App settings>Environment variables:
DJANGO_SETTINGS_MODULE = backend.deployment
Any help will be appreciated.
Kind regards,
Dobromir