Why Does Mezzanine include /static/ in .gitignore?

639 views
Skip to first unread message

easypie

unread,
Oct 3, 2012, 4:31:29 PM10/3/12
to mezzani...@googlegroups.com
Is the reason because most people serve their static on a different server? like amazon or other cdn servers? for me, I've always served my static on the same server as my site. apache for hosting and nginx for solely serving static. Having '/static/' ignored by git make it less convenient  cus I don't plan to serve my file on a different server.

How do you serve your static? With whom do you serve it with (CDN)? How do you streamline your process?

I do 'fab all' and then configure nginx to serve location /static/ { ... } then the server and its static files are all set. I always wondered how others did it. I'm new and kind of lost in all of this.

Stephen McDonald

unread,
Oct 3, 2012, 5:07:25 PM10/3/12
to mezzani...@googlegroups.com
I believe the thinking was that everything that goes into the project's static directory is copied over from apps with the collectstatic command, so it does't belong in version control. This is done with the intention of serving static content from the project and not from a CDN.

You may very well have apps within the project, and their static directories should be in version control, so if the ignore files (both git and hg) are ignoring those, we should change them.
--
Stephen McDonald
http://jupo.org

Matthew Miles Clark

unread,
Oct 3, 2012, 5:48:00 PM10/3/12
to mezzani...@googlegroups.com
I ran into exactly that problem (git ignoring static directories in
apps within the project) and needed to change the .gitignore file to
specify only the top level static directory (which it's right to
ignore).

Brian Schott

unread,
Oct 3, 2012, 8:03:40 PM10/3/12
to mezzani...@googlegroups.com
The reason is that serving /static directly from Apache or Nginx is MUCH faster than percolating down through the URL dispatcher and being served out through a Django view. It is much better to have a /static served out before it gets to Django.

Brian
Message has been deleted

easypie

unread,
Oct 4, 2012, 1:31:46 AM10/4/12
to mezzani...@googlegroups.com
How does everyone get their static files such as website theme's graphic images over to the server? Do you guys git push the files to a repository and then pull the repository from remote production server and route it using something like nginx? I have my theme files inside /home/user/project/static/theme/{...}. I noticed in Mezzanine, there is a directory inside /static/ called 'img'. Do we drop our graphic image theme files in there?
Reply all
Reply to author
Forward
0 new messages