Working with dates and times in any programming language can be a huge hassle. There are so many ways to mess up when using different date and time formats, dealing with timezones, and accounting for daylight savings time. There are a lot of things to remember to get right. I'll show you everything you need to know about working with dates and times in Python to make it easy so you can feel confident any time you have work with them.
With older versions of Drupal you could not run Drupal without Apache or Nginx to perform the URL rewrites needed to use the application with clean URLs.
New versions of Drupal (8+) come with a
.ht.router.php file that is specifically used to run local development instances with just the built-in PHP web server. No Apache, no Wamp, no Mamp, no Xampp. Just the built-in PHP server.
In addition, you don't have to use MySQL an setup a separate database. Drupal supports SQLite3 so can completely skip any MySQL setup.
This means you can run a local Drupal development environment with nothing but PHP.
- No Apache
- No MySQL
- No Wamp,Xampp,Mamp
- Just PHP
Following the method in this guide works on Windows, Mac, and Linux equally.
MacOS comes with PHP 7, Apache2 http server, and SQLite built-in which is everything you need to run a Drupal site. If you want to use MySQL, that is an additional install. In this guide, we will look at how to setup Drupal on your Mac.
Composer is a command-line tool for managing dependencies in PHP projects. In this guide we will look at how to install Composer and use it to add and install some project dependencies as well as how to create your own local package and use it within an application.
The GitPython project allows you to work in Python with Git repositories. In this guide we'll look at some basic operations like:
- Initializing a repo
- Cloning a repo
- Adding and committing
- Pushing and pulling with remotes
- Checking for changes
- Getting a diff
- Listing and switching branches
SSH (secure shell) is good for remotely managing machines using a secure connection.
Typically you will log in to a server using the command-line
ssh tool, or something like
PuTTy or MobaXTerm. This guide will show you how to use Python to connect and run commands
over SSH using the Paramiko package.
FTP or File Transfer Protocol is a common way to transfer files. For FTP, Python has a built in package called ftplib.
There is also a Secure File Transfer Protocol (SFTP) that uses SSH to encrypt the communication. We will focus just on traditional FTP in this guide. For SFTP you can check out the Paramiko package.
In this guide, we will look at some basic operations like:
- Connect and login to an FTP server
- List directories and files
- Upload and download files
Note these examples are all using Python 3.
Python 3 has built-in libraries for IMAP, POP3, and SMTP. We will focus on learning how to send mail with SMTP and read/manage email with IMAP. We will also look at how to send an SMS text message using email.
If you need your own email hosting, check out Interserver.net hosting where you can host unlimited emails for unlimited domains as cheap as $4/month. You could also set up your own SMTP server on a VPS, but that is a hassle.