Django admin static files deployment Pythonanywhere

ian-veteran - Nov 6 - - Dev Community

Debugged Admin panel pain cross fingers so as it works
Pythonanywhere: https://iankarani.pythonanywhere.com/admin/login/?next=/admin/

Install module whitenoise: https://whitenoise.readthedocs.io/en/latest/

Django admin templates: https://github.com/django/django/tree/main/django/contrib/admin/templates/admin

Procedure:
1: Install whitenoise support Django4.2 - 5.1

  • Update the middleware in the project settings

  • Proceed to the static make the following changes adding STATIC_ROOT and STATICFILES_STORAGE

Image description

2: The run

python manage.py collectstatic
Enter fullscreen mode Exit fullscreen mode

3: Runserver

python manage.py runserver
Enter fullscreen mode Exit fullscreen mode

Ensure you template folder doesn’t miss the html files:

  • base_site.html

  • color_theme_toggle.html
    Image description

.
Terabox Video Player