Opened 15 years ago
Closed 15 years ago
#15598 closed (fixed)
When STATIC_URL starts with 'http://' an exception is thrown in DEBUG mode
| Reported by: | Sergey Grigoriev | Owned by: | Jannis Leidel | 
|---|---|---|---|
| Component: | contrib.staticfiles | Version: | 1.3-rc | 
| Severity: | Keywords: | blocker | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
I have set up Apache to serve my static files,
STATIC_ROOT is /var/www/static
STATIC_URL is 'http://localhost/static'
The error is:
ImproperlyConfigured at /booking/page1
URL 'http://localhost/static' not allowed as static prefix
Request Method:         GET
Request URL:         http://localhost:8000/booking/page1
Django Version:         1.3 rc 1
Exception Type:         ImproperlyConfigured
Exception Value:         
URL 'http://localhost/static' not allowed as static prefix
Exception Location:         /usr/local/lib/python2.6/dist-packages/django/conf/urls/static.py in static, line 23
Python Executable:         /usr/bin/python
Python Version:         2.6.6
Python Path:         
['/home/serg/Work/sms/webui',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/local/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/usr/lib/pymodules/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.6/gtk-2.0']
Attachments (1)
Change History (6)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
| Summary: | When STATIC_URL starts with 'http://' an exception is thrown → When STATIC_URL starts with 'http://' an exception is thrown in DEBUG mode | 
|---|
comment:3 by , 15 years ago
| Has patch: | set | 
|---|
comment:4 by , 15 years ago
| Keywords: | blocker added | 
|---|
Not sure what the right response is here, but it's a problem with a new feature, so marking as a blocker to make sure it isn't forgotten before 1.3 final.
After setting DEBUG to False in settings.py the exception is not thrown anymore.
elif ':' in prefix:
I don't think that the developer in DEBUG mode should be limited to use relative path only.