Re: [Django] #34185: Serving static/media files during development can't work when use SCRIPT_NAME

2022-11-29 Thread Django
#34185: Serving static/media files during development can't work when use
SCRIPT_NAME
---+--
 Reporter:  YQ |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Documentation  |  Version:  4.1
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Carlton Gibson):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Did you see the note about this topic in the STATIC_URL docs?
 https://docs.djangoproject.com/en/4.1/ref/settings/#static-url

 Please see TicketClosingReasons/UseSupportChannels for places to get usage
 advice.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184c2ca1613-9e189495-8b7c-410c-94e4-36cd8cc3d0bf-00%40eu-central-1.amazonses.com.


Re: [Django] #34185: Serving static/media files during development can't work when use SCRIPT_NAME

2022-11-25 Thread Django
#34185: Serving static/media files during development can't work when use
SCRIPT_NAME
---+--
 Reporter:  YQ |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Documentation  |  Version:  4.1
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Description changed by YQ:

Old description:

> The Documentation:
> https://docs.djangoproject.com/en/4.1/howto/static-files/#serving-static-
> files-during-development
>

> {{{
> urlpatterns = [
> # ... the rest of your URLconf goes here ...
> ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
> }}}
>
> My SCRIPT_NAME is '/django'
>
> Page not found problem when access the static files:(the debug info)
>
> {{{
> Page not found (404)
> Request Method: GET
> Request URL:
> http://www.abc.xyz/django/static/appdl/bulma/bulma.0.9.4.min.css
> Raised by:  django.views.static.serve
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
> [name='index']
> appdl/
> admin/
> ^django/static/(?P.*)$
> ^django/media/(?P.*)$
> The current path, static/appdl/bulma/bulma.0.9.4.min.css, didn’t match
> any of these.
> }}}
>
> Prefix 'django' shouldn't  In url patterns.
>
> So, this code should be replaced:
> {{{
> static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
> }}}

New description:

 The Documentation:
 https://docs.djangoproject.com/en/4.1/howto/static-files/#serving-static-
 files-during-development


 {{{
 urlpatterns = [
 # ... the rest of your URLconf goes here ...
 ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
 }}}

 My SCRIPT_NAME is '/django'

 Page not found problem when access the static files:(the debug info)

 {{{
 Page not found (404)
 Request Method: GET
 Request URL:
 http://www.abc.xyz/django/static/appdl/bulma/bulma.0.9.4.min.css
 Raised by:  django.views.static.serve
 Using the URLconf defined in mysite.urls, Django tried these URL patterns,
 in this order:

 [name='index']
 appdl/
 admin/
 ^django/static/(?P.*)$
 ^django/media/(?P.*)$
 The current path, static/appdl/bulma/bulma.0.9.4.min.css, didn’t match any
 of these.
 }}}

 Prefix 'django' shouldn't  In url patterns.

 So, this code should be replaced:
 {{{
 static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
 }}}

 to


 {{{
 static('static/', document_root=settings.STATIC_ROOT)
 }}}

 because the  'settings.STATIC_URL' added SCRIPT_NAME  as prefix.

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184b2b1f5b6-5c61a40a-010c-4626-ab02-2e74ef40d101-00%40eu-central-1.amazonses.com.


[Django] #34185: Serving static/media files during development can't work when use SCRIPT_NAME

2022-11-25 Thread Django
#34185: Serving static/media files during development can't work when use
SCRIPT_NAME
-+
   Reporter:  YQ |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Documentation  |Version:  4.1
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 The Documentation:
 https://docs.djangoproject.com/en/4.1/howto/static-files/#serving-static-
 files-during-development


 {{{
 urlpatterns = [
 # ... the rest of your URLconf goes here ...
 ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
 }}}

 My SCRIPT_NAME is '/django'

 Page not found problem when access the static files:(the debug info)

 {{{
 Page not found (404)
 Request Method: GET
 Request URL:
 http://www.abc.xyz/django/static/appdl/bulma/bulma.0.9.4.min.css
 Raised by:  django.views.static.serve
 Using the URLconf defined in mysite.urls, Django tried these URL patterns,
 in this order:

 [name='index']
 appdl/
 admin/
 ^django/static/(?P.*)$
 ^django/media/(?P.*)$
 The current path, static/appdl/bulma/bulma.0.9.4.min.css, didn’t match any
 of these.
 }}}

 Prefix 'django' shouldn't  In url patterns.

 So, this code should be replaced:
 {{{
 static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184b00c1549-90e9d40e-a41d-44f2-9de3-30f38db35088-00%40eu-central-1.amazonses.com.