• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Django deployment

Django deployment

Installing in production doesn't need to be hard

  • Home
  • Blog
  • About

Uncategorized

How to setup Apache with Gunicorn

2016-11-30

Many people seem to think that it’s either Apache+mod_wsgi or nginx+Gunicorn. However, Apache+gunicorn makes a great combination, and it’s usually much easier to configure than mod_wsgi.

All you need is [Read more…] about How to setup Apache with Gunicorn

How Django static files work in production

2016-11-21

If you have trouble understanding STATIC_ROOT, STATIC_URL, collectstatic, and the web server’s configuration, it’s because some things are better said with pictures than with text. Here are the pictures. If you want them in PDF format, you can get them at the end of the post. Media files work similar, except that there is no collectstatic; Django saves them directly in MEDIA_ROOT and the web server serves them from there.

[Read more…] about How Django static files work in production

Why nginx is faster than Apache, and why you needn’t necessarily care

2016-11-15

It is no secret that nginx is faster and consumes less memory than Apache. If you always wondered why nginx’s architecture makes it faster but never understood it, I’m explaining it in this post. I also put nginx’s greater efficiency in perspective, and I show that, for many cases, the difference doesn’t matter so much as many people believe. What matters is to deliver a project early and economically. If you are more comfortable with Apache than with nginx, rather than investing in learning nginx, it might be better to pay for a slightly larger virtual machine or to use a content delivery network (and very often none of these solutions is necessary).

[Read more…] about Why nginx is faster than Apache, and why you needn’t necessarily care

What is the difference between a shell variable and an environment variable?

2016-11-07

You are reading this because you can’t understand why os.getenv('SOMEVAR') doesn’t work when echo $SOMEVAR does; or because you’ve never figured out why this mysterious shell command, export, is needed.

[Read more…] about What is the difference between a shell variable and an environment variable?

virtualenv demystified

2016-11-01

If you have difficulty understanding virtualenv, one reason is it’s misnamed. I don’t see anything virtual about it. It would be more accurate to call it an isolated python environment, which is what I will be calling it in this article.

[Read more…] about virtualenv demystified

How to use ngrep to debug HTTP headers

2016-10-24

You deploy Django with gunicorn. Your web server communicates with it with proxy_pass (nginx) or with ProxyPass (apache), together with several other directives that pass headers and so on. Your web site doesn’t work properly. Is the web server misconfigured, or is Django misbehaving? Here’s how to find out.
[Read more…] about How to use ngrep to debug HTTP headers

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Go to Next Page »

Primary Sidebar

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in