| 205 | | full path to a directory where you'd like Django to store uploaded |
|---|
| 206 | | files. (For performance, these files are not stored in the database.) |
|---|
| 207 | | Define ``MEDIA_URL`` as the base public URL of that directory. Make |
|---|
| 208 | | sure that this directory is writable by the Web server's user |
|---|
| 209 | | account. |
|---|
| | 205 | full path to a directory where you'd like Django to store uploaded |
|---|
| | 206 | files. (For performance, these files are not stored in the database.) |
|---|
| | 207 | Define ``MEDIA_URL`` as the base public URL of that directory. Make |
|---|
| | 208 | sure that this directory is writable by the Web server's user |
|---|
| | 209 | account. |
|---|
| 216 | | (relative to ``MEDIA_ROOT``). You'll must likely want to use the |
|---|
| 217 | | convenience ``get_<fieldname>_url`` function provided by Django. For |
|---|
| 218 | | example, if your ``ImageField`` is called ``mug_shot``, you can get |
|---|
| 219 | | the absolute URL to your image in a template with ``{{ |
|---|
| 220 | | object.get_mug_shot_url }}``. |
|---|
| | 216 | (relative to ``MEDIA_ROOT``). You'll must likely want to use the |
|---|
| | 217 | convenience ``get_<fieldname>_url`` function provided by Django. For |
|---|
| | 218 | example, if your ``ImageField`` is called ``mug_shot``, you can get |
|---|
| | 219 | the absolute URL to your image in a template with ``{{ |
|---|
| | 220 | object.get_mug_shot_url }}``. |
|---|