Config Statis Files Django

18 sec read

how to start config static files django

urls.py

from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('mikrotik.urls')),
    path('automation/', include('automation.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

settings.py

STATIC_URL = '/static/'

MEDIA_URL = '/images/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static')
]

MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')

How to Run Django on Jupyter Notebook Visual Code

previously I have struggled to debug my app when running Python app directly; I need it to run on my Jupyter Workspace easily to...
admin
27 sec read

Multiple Database in Django

how to combine multiple database in django router/db_routers.py settings.py Command Migration Calling Object Database
admin
2 min read

How to secure important data with environments in Django

settings.py .Env
admin
20 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *