Hi Max,

On 10/13/2014 01:39 AM, Max Nathaniel Ho wrote:
> Hi all,
> 
> I am going through this tutorial on Tango with Django
> - http://www.tangowithdjango.com/book/chapters/templates_static.html
> 
> I extracted the specific part of the tutorial as seen in *BOLD*.
> 
> 
>     *4.4. The Static Media
>     
> Server<http://www.tangowithdjango.com/book/chapters/templates_static.html#the-static-media-server>*
> 
> *Now that you can dispatch static files, let’s look at uploading media.
> Many websites provide their users with the ability to do this - for
> example, to upload a profile image. This section shows you how to add a
> simple development media server to your Django project. The development
> media server can be used in conjunction with file uploading forms which
> we will touch upon in Chapter 8
> <http://www.tangowithdjango.com/book/chapters/login.html#login-label>.*
> 
> *So, how do we go about setting up a development media server? The first
> step is to create another new directory called media within our Django
> project’s root (e.g.<workspace>/tango_with_django_project/). The
> new media directory should now be sitting alongside
> your templates and static directories. After you create the directory,
> you must then modify your Django project’s urls.py file, located in the
> project configuration directory
> (e.g.<workspace>/tango_with_django_project/tango_with_django_project/).
> Add the following code to the urls.py file.*

I think that tutorial is confusing things by calling it a "Static Media
Server".

In Django terminology, "static assets" and "media" are two very
different things. "Static assets" are assets that are required for your
site to function (part of its code) and should be checked into your
version control. An example might be your site's logo.

Media, on the other hand, are part of your site's data, not it's code.
They are generally uploaded by users of your site, and you would back
them up periodically (along with your database contents), but not check
them into your codebase. An example might be user avatar images.

> It teaches about Static Media Server. Is this something that is still
> current?

Yes, if your site will have uploaded media, it is still necessary to
configure your local development server to serve them (and a standalone
web server, or a service like S3 or a CDN, to serve them in production).
The instructions given in that tutorial look correct. Here are the
related Django docs:
https://docs.djangoproject.com/en/1.7/ref/views/#serving-files-in-development

> From my understanding of the Official Django Tutorial and the
> Documentation, we can just use static files as seen here
> - https://docs.djangoproject.com/en/1.6/howto/static-files/

The staticfiles contrib app is only for handling static assets, not
uploaded media.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/543C07A6.6090207%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to