Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Django changed path for urls


Hello Team,

I have installed Django template and as default all working fine,
Now we want some URL path changed, so we made changes to _keenthemes\url.py file,
If you see we have added App/ in URL,
After that, we see assets are not loading, as it looks for App/asset path,

So how can we change the default asset path for images? or other items.

The image is linked at https://imgur.com/a/OlkiA4q



from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from _keenthemes.views import SystemView

urlpatterns = [
path('admin/', admin.site.urls),

# Dashboard urls
path('App/', include('dashboards.urls')),


path('App/', include('futures.urls')),

# Auth urls
path('login/', include('auth.urls')),


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Jigar,

Since you have added the "App/" prefix to your URLs, you need to update the STATIC_URL in your Django project's settings. This is necessary to ensure that the static files are served from the correct path based on your new URL structure.

In your settings.py file, update the STATIC_URL:


STATIC_URL = "/App/static/"


This change reflects the new URL path of your app and will allow Django to correctly locate the static files.

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(