This tutorial by FreeBSD user Chad Stovern (DigitalOcean) shows us how to get a Django website set up with Apache, mod_wsgi, and MySQL on FreeBSD 10.1.
This article shows you how to deploy a web application using Django, the popular Python framework. The beauty of developing with popular web frameworks is that a lot of repetitious work has been done for you, so you can focus on building your site.
Whether you’re a developer or not, it’s great to know that the core of what you’re running on your Droplet has undergone the scrutiny of a large open-source community and should be less susceptible to large security holes.
One thing that is not inherently simple is knowing how to get these web frameworks up and running outside of your own development or testing environment. In this article we’ll show you how to do just that, using a standard Apache, mod_wsgi, and MySQL stack running on top of FreeBSD 10.1.
- Install and configure a Python virtual environment for your Django site
- Create and configure a sample Django site for testing
- Configure a simple and secure MySQL server
- Configure a simple Apache virtual host that will serve your Django site
- Test that the newly minted site works properly
Before you begin this guide you’ll need the following:
- A FreeBSD 10.1 Droplet
- Access to your root account or an account with sudo privileges following this tutorial
- A working knowledge of how to edit text files from the command line
- The Bash shell environment, since we’ll be using Virtualenv later on this tutorial. Follow the instructions in the Changing the Default Shell section of the How To Get Started with FreeBSD 10.1 tutorial. You may need to log out and log in again to get the Bash shell for your freebsd user