├── .gitignore ├── thanks └── README.md ├── windows-help └── README.md ├── git-tips ├── .gitignore └── README.md ├── LICENSE ├── installation-instructions ├── conda-virtualenv.md ├── virtualenv-installation.md ├── README.md ├── python-installation-windows.md ├── python-installation-linux.md ├── python-installation-mac.md └── starting-your-project.md ├── command-line-tips └── README.md ├── pycon-tutorial ├── README.md └── additional-resources.md ├── python-tips └── README.md ├── irc-tips └── README.md ├── additional-resources └── README.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | -------------------------------------------------------------------------------- /thanks/README.md: -------------------------------------------------------------------------------- 1 | # Thank you 2 | 3 | ## Security vulnerability reports 4 | 5 | Big thanks to [@amanmahendra00](http://github.com/amanmahendra00/) for reporting a vulnerability with my discussion 6 | forum and recommended fixes. 7 | -------------------------------------------------------------------------------- /windows-help/README.md: -------------------------------------------------------------------------------- 1 | # Python Installation 2 | 3 | See this document: 4 | [https://github.com/hellowebapp/hellowebapp/blob/master/installation-instructions/python-installation-windows.md](https://github.com/hellowebapp/hellowebapp/blob/master/installation-instructions/python-installation-windows.md) 5 | 6 | # Command Line 7 | 8 | If you have Windows 7 or later, you can use PowerShell ([tutorial here](http://cli.learncodethehardway.org/book/ex1.html#windows)). The above installation 9 | instructions also install mingw, which can be used as well. 10 | 11 | # Bugs 12 | 13 | Bugs will be added here! 14 | -------------------------------------------------------------------------------- /git-tips/.gitignore: -------------------------------------------------------------------------------- 1 | db.sqlite3 2 | venv 3 | *.pyc 4 | staticfiles 5 | .DS_STORE 6 | *.zip 7 | *.csv 8 | *.png 9 | *.jpeg 10 | *.jpg 11 | .env* 12 | settings_local.py 13 | post-double.py 14 | labels 15 | node_modules 16 | 17 | # Byte-compiled / optimized / DLL files 18 | __pycache__/ 19 | *.py[cod] 20 | 21 | # C extensions 22 | *.so 23 | 24 | # Distribution / packaging 25 | .Python 26 | env/ 27 | build/ 28 | develop-eggs/ 29 | dist/ 30 | downloads/ 31 | eggs/ 32 | lib/ 33 | lib64/ 34 | parts/ 35 | sdist/ 36 | var/ 37 | *.egg-info/ 38 | .installed.cfg 39 | *.egg 40 | 41 | # PyInstaller 42 | # Usually these files are written by a python script from a template 43 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 44 | *.manifest 45 | *.spec 46 | 47 | # Installer logs 48 | pip-log.txt 49 | pip-delete-this-directory.txt 50 | 51 | # Unit test / coverage reports 52 | htmlcov/ 53 | .tox/ 54 | .coverage 55 | .cache 56 | nosetests.xml 57 | coverage.xml 58 | 59 | # Translations 60 | *.mo 61 | *.pot 62 | 63 | # Django stuff: 64 | *.log 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Tracy Osborn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /installation-instructions/conda-virtualenv.md: -------------------------------------------------------------------------------- 1 | ### Start your virtual environment in conda 2 | 3 | If you're using Conda you'll get an error when you try to `pip install virtualenv`. 4 | That's because Conda is a virtual environment manager as well as a package manager. 5 | Now that you're within your empty project folder, create your virtual 6 | environment: 7 | 8 | conda create --name venv python 9 | 10 | And then activate the environment: 11 | 12 | source activate venv 13 | 14 | You should see something like this in your command line before the folder 15 | structure - the (venv) indicates you're in the virtual environment: 16 | 17 | (venv)limedaring@Orion ~/projects/hellowebapp $ 18 | 19 | /(Orion is my computer's name and limedaring is my username - your exact setup 20 | will be different.) 21 | 22 | Now you're in your bubble, so we can start installing project-specific utilities. 23 | If you ever need to deactivate your environment, run 24 | 25 | source deactivate 26 | 27 | And now on to [installing Django](https://github.com/hellowebapp/hellowebapp/tree/master/installation-instructions/starting-your-project.md#install-django). 28 | -------------------------------------------------------------------------------- /command-line-tips/README.md: -------------------------------------------------------------------------------- 1 | # Command line tips 2 | 3 | **New!** I've written a command line zine (for OSX only, at the moment) to walk 4 | you through learning the command line. 5 | 6 | See it here: 7 | [https://hellowebbooks.com/learn-command-line](https://hellowebbooks.com/learn-command-line) 8 | 9 | It's available as a printable, an online PDF, online HTML, and other versions. 10 | Windows/Linux coming soon. 11 | 12 | Other than that, here are the really basic commands that'll help you 13 | navigate (assuming you're on a Linux-based system, like Mac OS, or using the 14 | Linux Subsystem for Windows): 15 | 16 | * **ls**: Shows the contents of the directory you're currently in. 17 | * **cd FOLDERNAME**: Changes directories. For example: `cd templates` 18 | * **cd ../**: Goes back a directory to the parent folder. 19 | * **mkdir FOLDERNAME**: Creates a directory in the current folder. For example: 20 | `mkdir templates` 21 | * **touch FILENAME.EXT**: Creates a blank file in the format indicated. For 22 | example: `touch index.html` or `touch views.py` 23 | 24 | More here: [https://hellowebbooks.com/learn-command-line](https://hellowebbooks.com/learn-command-line) 25 | 26 | -------------------------------------------------------------------------------- /installation-instructions/virtualenv-installation.md: -------------------------------------------------------------------------------- 1 | # Installing Virtualenv 2 | 3 | When we start developing our Django apps, we want to make sure our projects are enclosed in "bubbles" known as virtual environments. 4 | 5 | For example, as of this writing, Django's current version is 1.9. When new versions of Django are released, they may not be backwards compatible with previous versions of Django. 6 | 7 | Without a virtual environment, we'd have Django 1.9.2 installed *globally* on our computer, and every Django project you build would use that version. If you wanted to upgrade your version of Django, you'd have to go through every one of your projects to make sure they don't break. 8 | 9 | **With a virtual environment, every project can have a separate version of Django and other plugins that you install.** You can install Django 1.9 on one project, and down the line, start another project with Django 1.10. Every project can work off of whatever version of whatever you install, keeping them separate from each other. This is very important when you're programming. 10 | 11 | We should already have pip, so we'll use it to install virtualenv *(don't paste 12 | in the* `$` *- it's an indicator that the command below is meant to be run on 13 | your command line utility.)*: 14 | 15 | ``` 16 | $ pip install virtualenv 17 | ``` 18 | -------------------------------------------------------------------------------- /pycon-tutorial/README.md: -------------------------------------------------------------------------------- 1 | # PyCon tutorial 2 | 3 | ## Outline 4 | 5 | Here's the tentative outline for the course, which is pretty much the exact 6 | outline of the upcoming Hello Web App book. We probably won't cover all topics 7 | but they're here just in case: 8 | 9 | * Introductions 10 | * Best practices for planning your web app. 11 | * MVPs 12 | * How to narrow down your scope. 13 | * How launch quickly and why. 14 | * What we're going to build in the tutorial. 15 | * "Collection of objects" 16 | * Review of pre-requisites and making sure everyone is ready. 17 | * Very basic knowledge of Python and logic. 18 | * [Resources to learn](https://github.com/limedaring/HelloWebApp/tree/master/python-tips) 19 | * Python must already be installed. 20 | * [Use this guide to install](https://github.com/limedaring/HelloWebApp/tree/master/installation-instructions). 21 | * Django installed 22 | * [Guide](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/starting-your-project.md) 23 | * Rest of the book! 24 | 25 | ## After the tutorial 26 | 27 | Check out [this document for more resources and other tutorials to continue your 28 | programming 29 | education](https://github.com/limedaring/HelloWebApp/blob/master/pycon-tutorial/additional-resources.md) 30 | (big thanks for the folks at [Django Hack & 31 | Learn](https://www.eventbrite.com/e/django-hack-learn-tickets-9900931954) for 32 | helping compile this document.) 33 | -------------------------------------------------------------------------------- /installation-instructions/README.md: -------------------------------------------------------------------------------- 1 | ## Python and Django installation instructions 2 | 3 | We'll need to install Python, Django, and a few other utilities to your computer 4 | before being able to build our web app! 5 | 6 | ### Installing Python 7 | 8 | Unfortunately, unlike making web pages with HTML, we need to install some things before our computers can run the files that we're building. 9 | 10 | * [Mac OS X](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/python-installation-mac.md) 11 | * [Windows](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/python-installation-windows.md) 12 | * Linux (coming soon - [in the meanwhile, use this guide](http://docs.python-guide.org/en/latest/starting/install/linux/).) 13 | * [Using a Virtual Machine (Juice Box)](https://jpadilla.github.io/juicebox/#get-started) 14 | 15 | ### Installing Virtualenv 16 | 17 | This allows us to create a "bubble" around our projects so our various installs 18 | won't conflict. 19 | 20 | * [Virtualenv installation instructions](https://github.com/hellowebapp/hellowebapp/blob/master/installation-instructions/virtualenv-installation.md) 21 | 22 | ### Installing Django 23 | 24 | Last but not least, let's install Django so we can start building web apps! 25 | 26 | * [Install Django and start your project](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/starting-your-project.md) 27 | 28 | - - - 29 | 30 | Any problems with installation or have any questions? Feel free to email me at 31 | [hi@limedaring.com](mailto:hi@limedaring.com) any time. 32 | -------------------------------------------------------------------------------- /python-tips/README.md: -------------------------------------------------------------------------------- 1 | ## Python requirements 2 | 3 | It seems a bit backwards to require Python knowledge for a beginner web app 4 | tutorial, but the amount you'll need to know is actually very little. 5 | 6 | Python is the programming language this course is based on, and Django is the 7 | Python framework which we'll be learning in this tutorial. 8 | 9 | I learned the basics of Python and programming logic from Learn Python the Hard 10 | Way (which is a very misleading title) and encourage you to do the same: 11 | 12 | [http://learnpythonthehardway.org/](http://learnpythonthehardway.org/) 13 | 14 | The HTML is free online and is more than sufficient, but if you wish, you can 15 | purchase the course for $29.59 and get PDFs and videos as well. 16 | 17 | Try to get through at least exercise 40 which'll give you the basic knowledge of 18 | the concepts we need. Don't worry if you're not 100% confident (or even 50%), 19 | the more you work on your web app using this tutorial, the more you'll get. 20 | 21 | ### Python concepts 22 | 23 | Basically, you need to know enough Python to grasp these concepts: 24 | 25 | ```python 26 | # 1. Comments (this is an example of one.) 27 | 28 | # 2. Variables 29 | thing = "" 30 | 31 | # 3. Loops 32 | for thing in list_of_things: 33 | # Do something to thing 34 | do_something(thing) 35 | 36 | # 4. Conditional statements 37 | if thing == orange_thing: 38 | # Do something orangy 39 | squeeze(thing) 40 | elif thing == potato_thing: 41 | # Do something potatoey 42 | slice(thing) 43 | else: 44 | # Do something else altogether 45 | refrigerate(thing) 46 | ``` 47 | 48 | Again, try to get through at least exercise 40 of [Learn Python the Hard 49 | Way](http://learnpythonthehardway.org/) before picking up Hello Web App. 50 | -------------------------------------------------------------------------------- /irc-tips/README.md: -------------------------------------------------------------------------------- 1 | # Getting started with IRC 2 | 3 | New to IRC? IRC is basically an online chat room containing many rooms for 4 | people to chat about topics, including programming. 5 | 6 | This is a great resource to help you get started: 7 | [Getting Started with Freenode IRC](http://richard.esplins.org/siwi/2011/07/08/getting-started-freenode-irc/) 8 | 9 | ## What is IRC, anyway? 10 | 11 | Internet Relay Chat (IRC) is an oldie-but-goodie chat protocol that is popular with developers in the open source community. There are many great channels where you can find help, offer up help to people asking simple questions you might know the answer to, or just lurk to absorb knowledge. 12 | 13 | First, you'll need an IRC client. [There are many clients](https://en.wikipedia.org/wiki/Comparison_of_Internet_Relay_Chat_clients) suited for various kinds of users, most of them are free. If you feel up for it, you can try out a bunch of different and see what you like best. If you use an instant messaging tool like Pidgin or Adium, it's fairly easy to get started with IRC inside of it also. Otherwise, you can install a stand-alone IRC client like [mIRC](http://www.mirc.com/) for Windows or [LimeChat](http://limechat.net/mac/) for Mac. 14 | 15 | There are many IRC servers, but most of the open source community lives in `chat.freenode.net`. Django users hang out in a channel called `#django`. Questions are more than welcome, no matter how silly or stupid you might fear they are. 16 | 17 | For best results, don't ask to ask ("can I ask a question?") but rather politely dive into what you're trying to achieve and the problem you're facing. Example: "hi, I'm trying to setup template inheritence but it seems Django is not finding my base template, can somebody please point me to some resources/tips for debugging this?" 18 | 19 | Even better, when you have a specific error stack trace you're having trouble figuring out, you can upload it to a pastebin service like [dpaste](http://dpaste.com/) and share the link within the IRC channel. Avoid pasting more than one line into the IRC channel, as it becomes very noisy and people get annoyed. Always use a pastebin service when you need to paste something. Be careful with sharing sensitive information like usernames and passwords—sometimes your stack trace will contain them. Triple-check that your paste content is safe to share before submitting it. 20 | 21 | We hope to hear from you on #django @ freenode. Come by soon! 22 | -------------------------------------------------------------------------------- /installation-instructions/python-installation-windows.md: -------------------------------------------------------------------------------- 1 | # Installing Python 2.7 on Windows 2 | 3 | First off, a disclaimer - development on Windows will be harder than if you were 4 | on Linux or Mac. If you can, I'd recommend installing Linux your systerm or in a 5 | [virtual machine like VirtualBox](https://help.ubuntu.com/community/VirtualBox) 6 | and using that instead. 7 | 8 | ## Using the command line 9 | 10 | First, are you comfortable with the command line? It's infinitely simpler to 11 | download and install utilities using the command line, so if you 12 | haven't used the command line before, try out [The Command Line Crash 13 | Course](http://cli.learncodethehardway.org/book/) by the same author who wrote 14 | [Learn Python the Hard Way](learnpythonthehardway.org). Should only take a day 15 | or so to go through all the lessons. 16 | 17 | ## Installing Python 18 | 19 | This tutorial will be more fully fleshed out soon - in the meanwhile, [use this 20 | tutorial for installing Python on 21 | Windows](http://docs.python-guide.org/en/latest/starting/install/win/). This 22 | tutorial will also install *pip* on your computer, which is also needed by Hello 23 | Web App. 24 | 25 | *(Thanks to Kenneth Reitz for these instructions.)* 26 | 27 | ## Installing Virtualenv 28 | 29 | [Head over to this page which'll tell you about virtual environments and how to 30 | install 31 | Virtualenv.](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/virtualenv-installation.md) 32 | 33 | ## Installing Git for Windows 34 | 35 | Hello Web App uses unix commands like *touch* to create files from the command 36 | line, which doesn't exist on Windows. We need git anyways for our project, so 37 | install [Git for Windows](https://git-for-windows.github.io/) which'll install 38 | git on your computer as well as allow you to use unix commands like *touch*. 39 | 40 | (If you need more here, [this is another tutorial with pretty detailed 41 | instructions on installing 42 | Git for Windows](http://lostechies.com/jasonmeridth/2009/06/01/git-for-windows-developers-git-series-part-1/).) 43 | 44 | - - - 45 | 46 | You're finished setting up your system! 47 | 48 | But wait, you may be thinking - what about installing Django? We're going to 49 | install Django on a project-by-project basis (within the virtual environment 50 | provided by virtualenv). [Follow those instructions 51 | here.](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/starting-your-project.md) 52 | -------------------------------------------------------------------------------- /additional-resources/README.md: -------------------------------------------------------------------------------- 1 | # Additional Resources 2 | 3 | Finished with Hello Web App? I list some of my favorite resources to continue 4 | your education in the book, but for the sake of brevity, the list is rather 5 | short. Here's a more complete list. 6 | 7 | *More coming soon.* 8 | 9 | ## Python 10 | 11 | ### Books 12 | 13 | ***Two Scoops of Django* by Audrey Roy Greenfield and Daniel Greenfield**: 14 | [http://amzn.to/13sLUh6](http://amzn.to/13sLUh6) 15 | This book pretty much should be required reading after Hello Web App. Two Scoops is a resource book for Django best practices and expands on pretty much everything mentioned here. Definitely recommend adding this to your reading list. 16 | 17 | ***Test-Driven Development with Python* by Harry J. W. Percival**: 18 | [http://amzn.to/1GrwlUF](http://amzn.to/1GrwlUF) 19 | Interested in learning more about tests? The ones we did back in Chapter 13 are pretty much the very bare minimum — here, you’ll learn how to build tests first before writing your main code. 20 | 21 | ***Lightweight Django* by Julia Elman and Mark Lavin**: 22 | [http://amzn.to/1M1kXl6](http://amzn.to/1M1kXl6) 23 | More of an intermediate-to-advanced text with great information on how to integrate complex client-side interactions and real-time features into your web applications. 24 | 25 | ### Online coding classes 26 | 27 | **Codecademy**: [http://hellowebapp.com/45](http://hellowebapp.com/45) 28 | Courses on HTML, CSS, Javascript, jQuery, Python, Ruby, and PHP, all interactive and free. 29 | 30 | **Coursera**: [http://coursera.com](http://coursera.com) 31 | Coursera lists a lot of great programming courses — Python, Django, programming in general, marketing, and more. 32 | 33 | **Treehouse**: [http://teamtreehouse.com/](http://teamtreehouse.com/) 34 | Another great learning site with tutorials from Python, HTML and CSS, and more. Not free - $25/month after a free one month trial. 35 | 36 | Other options: 37 | [http://thenextweb.com/dd/2012/10/21/so-you-want-to-be-a-programmer-huh-heres-25-ways-to-learn-online/](http://thenextweb.com/dd/2012/10/21/so-you-want-to-be-a-programmer-huh-heres-25-ways-to-learn-online/) 38 | 39 | ## HTML and CSS 40 | 41 | ### Books 42 | 43 | **HTML and CSS: Design and Build Websites**: 44 | [http://amzn.to/1qUIE8o](http://amzn.to/1qUIE8o) 45 | 46 | ### Websites 47 | 48 | **Learn to Code HTML & CSS**: 49 | [http://learn.shayhowe.com/html-css/](http://learn.shayhowe.com/html-css/) 50 | 51 | **Don't Fear the Internet: Basic HTML & CSS for Non-Web Designers**: 52 | [http://www.dontfeartheinternet.com/](http://www.dontfeartheinternet.com/) 53 | -------------------------------------------------------------------------------- /git-tips/README.md: -------------------------------------------------------------------------------- 1 | # Git Tips 2 | 3 | Git is crucial to any programming project since it'll allow you to save versions 4 | of your work. Commit your work at crucial junctures, and if you get in over your 5 | head with a new feature, you can easily go back in time to the last working 6 | version of your project (among many other awesome features). 7 | 8 | ## Install git 9 | 10 | If you've followed the [Python installation instructions 11 | here](https://github.com/limedaring/HelloWebApp/tree/master/installation-instructions), 12 | you should have brew, so you can easily run `brew install git` in your terminal. 13 | Not on a Mac or don't have brew? [Check out these 14 | instructions.](http://git-scm.com/book/en/Getting-Started-Installing-Git) 15 | 16 | ## The very basic, important commands 17 | 18 | * **git init**: Starts a git repository in your current folder. Essentially, 19 | starts tracking changes in your project. Make sure you're at the top level 20 | folder for your project (and only track individual projects, don't init your 21 | entire computer. :P) 22 | * **git status**: Shows the current state of your project - which files have 23 | changes, which have been added, and which branch you're on. 24 | * **git add [FILE]**: Adds files to be tracked - new files aren't tracked by 25 | default. You can add all new files using `git add .` rather than naming the 26 | individual files as well. 27 | * **git commit [FILE]**: Commits the changed files - use when you've hit a good 28 | state. Generally, you'll want to commit all files and add a message, so you 29 | can use `git commit -a -m "Message!"` to do that (-a commits all files, -m 30 | indicates that you're adding a message.) 31 | 32 | ## Your .gitignore file! 33 | 34 | Git will track everything that is in your project, even things you don't really 35 | need (like the stuff you install via pip). 36 | 37 | You can add a ".gitignore" file to your project, which tells git to ignore 38 | certain files. I created one here that works for the project that is built with 39 | Hello Web App: 40 | 41 | [https://raw.githubusercontent.com/hellowebapp/hellowebapp/master/git-tips/.gitignore](https://raw.githubusercontent.com/hellowebapp/hellowebapp/master/git-tips/.gitignore) 42 | 43 | Add this file to your top level directory like so: 44 | 45 | ``` 46 | hellowebapp/ 47 | .gitignore 48 | manage.py 49 | collection/ 50 | __init__.py 51 | admin.py 52 | models.py 53 | tests.py 54 | views.py 55 | hellowebapp/ 56 | __init__.py 57 | settings.py 58 | urls.py 59 | wsgi.py 60 | ``` 61 | 62 | (Make sure to keep the dot in front!) 63 | 64 | FYI, if you look at your project in Finder or by using something like `ls` 65 | (Mac/Linux) or `dir` (Windows) in your terminal, you might not see this new 66 | file. It's because files with a "." in front are, by default, hidden. 67 | 68 | Use `ls -lah` (Mac/Linux) or `dir /a` (Windows) in your terminal to see your 69 | directory including those hidden files. 70 | 71 | Now, when you track your files, you won't track unnecessary files. 72 | 73 | 74 | ## More! 75 | 76 | There are pretty much a billion other awesome commands, [check them out 77 | here](http://gitref.org/). 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Hello Web App: Intro to Web App Development Using Python and Django 2 | 3 | This is the GitHub repository for [Hello Web 4 | App](http://hellowebbook.com/learn-django)'s files. 5 | 6 | Hello Web App is a book series dedicated to teaching beginner web app 7 | development. Written by a designer, it focuses on teaching the websites and 8 | templates first, slowly adding programming concepts over time -- perfect for 9 | anyone who is new to programming or has a background in web design. 10 | 11 | See [HelloWebBooks.com](http://hellowebbooks.com) for how to order (starts at $14.95 12 | for eBook files), a blog with additional tutorials, and more information. 13 | 14 | ### Contents 15 | 16 | Starting your project: 17 | 18 | * [How to install Python](https://github.com/hellowebbooks/HelloWebApp/tree/master/installation-instructions) 19 | * [Installing Virtualenv](https://github.com/hellowebbooks/hellowebapp/blob/master/installation-instructions/virtualenv-installation.md) 20 | * [Starting your Django project](https://github.com/hellowebbooks/HelloWebApp/blob/master/installation-instructions/starting-your-project.md) 21 | 22 | Learning Python (You should have very basic Python and logic knowledge before jumping into Hello Web App): 23 | * [Python tips and resources](https://github.com/hellowebbooks/HelloWebApp/tree/master/python-tips) 24 | 25 | Walk through the code in Hello Web App's chapters here (Intermediate Concepts 26 | coming soon): 27 | 28 | * [Hello Web App Code](https://github.com/hellowebbooks/HelloWebApp-Code) 29 | 30 | Miscellaneous help: 31 | 32 | * [Discussion forum](http://discuss.hellowebapp.com/) 33 | * [Command line tips](https://github.com/limedaring/HelloWebApp/tree/master/command-line-tips) 34 | * [Using Git](https://github.com/limedaring/HelloWebApp/tree/master/git-tips) 35 | * [IRC tips](https://github.com/limedaring/HelloWebApp/tree/master/irc-tips) 36 | * [Windows help](https://github.com/limedaring/HelloWebApp/tree/master/windows-help) 37 | 38 | After the book: 39 | 40 | * [Additional resources](https://github.com/limedaring/HelloWebApp/tree/master/additional-resources) 41 | 42 | ### Background on Hello Web App 43 | 44 | In January 2011, [I taught myself Python and Django and launched my first web app in six weeks](http://www.limedaring.com/im-a-designer-who-learned-django-and-launched-her-first-webapp-in-6-weeks/). 45 | 46 | Three years later, this web app has evolved into my startup, [WeddingLovely](http://weddinglovely.com) (a part of [500 Startups](http://500.co) and the [Designer Fund](http://designerfund.com)) - I've designed and built the entire company and LOVE web app development! 47 | 48 | Learning to code was so frustrating, especially as a right-brained designer with no back-end programming experience. Tutorials assumed I was comfortable with the command line, knew what a model-view-template architecture was, and already had a grasp on programming tools and resources. 49 | 50 | I want to build a introduction to web app programming using Django and Python 51 | which assumes absolutely no programming knowledge - down-to-earth explanations 52 | of programming terms and basic walkthroughs of using important programming 53 | utilities like git (for version control), GitHub (for backups), virtualenv (for 54 | virtual environments), and others. I also wanted to emphasize templates first - 55 | getting to the visual, web-app view first to see results rather than using the 56 | command line. 57 | 58 | [Hello Web App](http://hellowebbooks.com/learn-django) launched in May 2015 59 | after a successful Kickstarter campaign. The book walks readers through creating 60 | a basic web app, from ideation to deployment. 61 | 62 | [Hello Web App: Intermediate 63 | Concepts](http://hellowebbooks.com/django-intermediate-concepts) launched December 2015 64 | after another successful Kickstarter campaign (thanks again!) HWA:IC is for 65 | anyone who has a basic web app and would like to build more advanced features 66 | like adding payments with Stripe, user-uploaded images, an API, and more. 67 | 68 | Follow and ask me questions on Twitter 69 | ([@limedaring](http://twitter.com/limedaring)) or on the [Hello Web App 70 | discussion forums](http://discuss.hellowebapp.com), or follow the project directly at [HelloWebApp.com](http://hellowebapp.com). 71 | 72 | ### License 73 | 74 | The information in this repository is licensed under the terms of the MIT 75 | license. This does not apply to the information in the Hello Web App books, which 76 | are copyrighted. :) 77 | -------------------------------------------------------------------------------- /installation-instructions/python-installation-linux.md: -------------------------------------------------------------------------------- 1 | # Installing Python on Linux 2 | 3 | ## Using the command line 4 | 5 | First, are you comfortable with the command line? It's infinitely simpler to 6 | download and install utilities for your Mac using the command line, so if you 7 | haven't used the command line before, try out [The Command Line Crash 8 | Course](http://cli.learncodethehardway.org/book/) by the same author who wrote 9 | [Learn Python the Hard Way](learnpythonthehardway.org). Should only take a day 10 | or so to go through all the lessons. 11 | 12 | ## About Linux Distributions 13 | 14 | There are quite a number of different flavors of Linux. The two most common types are Debian-Based, and Fedora. Be sure to find out what type of distribution you have before proceeding. If you have Ubuntu or Mint, follow the instructions for Debian-based distributions. If you have Fedora, follow the instructions for Fedora. 15 | 16 | ## Making sure everything is up to date 17 | 18 | First, we should make sure that everything in our system is up to date before we install any packages. 19 | 20 | On Debian-based distributions: 21 | 22 | ``` 23 | sudo apt-get update 24 | ``` 25 | 26 | On Fedora: 27 | ``` 28 | yum check-update 29 | ``` 30 | 31 | You'll have to use sudo (super user do) when you install the packages listed on this page. Be careful when using sudo, as you're calling super-user rights which can land you in hot water if you're not sure what you're doing. 32 | 33 | ## Installing Setuptools 34 | 35 | Debian-based and Fedora distributions come with Python pre-installed, which means you don't need to install Python at all. However, [Setuptools](https://pypi.python.org/pypi/setuptools#unix-wget) is a fairly important Python package, which you should install before you do anything else. 36 | 37 | On Debian-based distributions: 38 | 39 | ``` 40 | sudo apt-get install python-setuptools 41 | ``` 42 | 43 | On Fedora: 44 | ``` 45 | sudo yum install python-setuptools 46 | ``` 47 | 48 | ## Installing git 49 | 50 | The next thing we need to have installed is [git](http://git-scm.com/), which is 51 | a version control system. You can work on your programming projects while 52 | committing versions, allowing you to roll back easily if something you do 53 | breaks. git also works with GitHub, so you can save your project to the 54 | "cloud", backing it up as well as allowing others to work on the same project 55 | with you. 56 | 57 | On Debian-based distributions: 58 | 59 | ``` 60 | sudo apt-get install git 61 | ``` 62 | 63 | On Fedora: 64 | ``` 65 | sudo yum install git 66 | ``` 67 | 68 | We'll go over some of these basics in the book, but if you'd like to do some 69 | advanced reading on git basics, [check out this 70 | guide](http://git-scm.com/book/en/Git-Basics). 71 | 72 | ## Installing pip 73 | 74 | [pip](http://www.pip-installer.org/en/latest/) is essentially a package manager for Python packages. 75 | 76 | On Debian-based distributions: 77 | ``` 78 | sudo apt-get install python-pip 79 | ``` 80 | 81 | On Fedora: 82 | ``` 83 | sudo yum install python-pip 84 | ``` 85 | 86 | ## Installing virtualenv 87 | 88 | Another thing we need installed is 89 | [virtualenv](http://www.virtualenv.org/en/latest/virtualenv.html). virtualenv 90 | allows you to set up virtual environments for all of your programming projects - 91 | essentially, a bubble which wraps around projects and their package installs, 92 | preventing them from interfering with each other. 93 | 94 | For example, if you install Django 1.6 globally on your computer, every project 95 | will be using Django 1.6 - and when you upgrade to 1.7, you'll upgrade every 96 | project as well, potentially breaking them due to deprecated features. 97 | virtualenv keeps projects separate - you can have one project on Django 1.6 and 98 | another on 1.7, and they won't interfere with eachother. 99 | 100 | We already have pip, so we'll use it to install virtualenv: 101 | 102 | ``` 103 | sudo pip install virtualenv 104 | ``` 105 | 106 | We'll go over this again when we officially start our Hello Web App project, but 107 | to use virtualenv, you'll move into the directory where your project lies and 108 | run `virtualenv --distribute venv`, which'll create the virtual environment. To 109 | activate the environment, you'll run `source venv/bin/activate`, and 110 | `deactivate` to deactivate. While in the environment, we can use pip to install 111 | and uninstall everything we need without worrying about it conflicting with any 112 | other project. 113 | 114 | - - - 115 | 116 | You're finished setting up your system! 117 | 118 | But wait, you may be thinking - what about installing Django? We're going to 119 | install Django on a project-by-project basis (within the virtual environment 120 | provided by virtualenv). [Follow those instructions 121 | here.](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/starting-your-project.md) 122 | -------------------------------------------------------------------------------- /installation-instructions/python-installation-mac.md: -------------------------------------------------------------------------------- 1 | # Installing Python 2.7 on Mac 2 | 3 | ## Using the command line 4 | 5 | First, are you comfortable with the command line? It's infinitely simpler to 6 | download and install utilities for your Mac using the command line, so if you 7 | haven't used the command line before, try out [The Command Line Crash 8 | Course](http://cli.learncodethehardway.org/book/) by the same author who wrote 9 | [Learn Python the Hard Way](http://learnpythonthehardway.org). Should only take a day 10 | or so to go through all the lessons. 11 | 12 | If using the command line feels a bit scary, one thing to keep in mind is that 13 | this is how computer programmers back in the day used to interface with computer 14 | elements. All our modern interfaces and GUIs ("Graphical User Interfaces", a 15 | common abbreviation in programmer worlds) are built on top of computer commands 16 | like we'll be typing in. We're just moving back to an earlier time, typing our 17 | commands rather than clicking buttons. 18 | 19 | ## Installing XCode 20 | 21 | Unfortunately the native Python that comes on Macs isn't great for development, 22 | so we'll need to install GCC, which'll set your computer up to be able to 23 | download Python. 24 | 25 | *Do you have XCode installed already? If so, skip this section. Don't know what 26 | I mean? You likely don't have it installed.* 27 | 28 | * Mac OS X 10.9 / Mavericks: [Follow this super simple guide to install Command 29 | Line Tools from the command line](http://www.computersnyou.com/2025/2013/06/install-command-line-tools-in-osx-10-9-mavericks-how-to/). 30 | * Mac OS X 10.6-10.8 / Mountain Lion, Lion, and Snow Leopard: 31 | [Follow this guide to install OSX GCC.](https://github.com/kennethreitz/osx-gcc-installer#readme) 32 | 33 | ## Installing Homebrew 34 | 35 | [Homebrew](http://brew.sh/) is a *package manager*, which'll allow you to download and install 36 | packages like Python directly from the command line. 37 | 38 | Open up your terminal and paste this in: 39 | 40 | ``` 41 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 42 | ``` 43 | 44 | The script should walk you through the rest of installing Homebrew. 45 | 46 | There might be some warnings as it's installing, particularly around the command 47 | "sudo". Sudo (meaning "superuser do") is an "admin" command that'll require 48 | your computer's password. It's the equivlant of saying, "I am the admin and I 49 | want to run this command" and then the computer requires your password in order 50 | to ensure that you're indeed the admin. Homebrew needs access to the admin bits 51 | of your computer in order to install programs on your behalf, which is why the 52 | computer requires you to be the admin in order to install. 53 | 54 | Note the warning about improperly using the sudo command because you shouldn't 55 | use it willy-nilly (never paste in random sudo commands that you find in the 56 | internet without understanding what they do). 57 | 58 | The last thing we need to do is insert the Homebrew directory at the top your 59 | `PATH` environment variable. The `$PATH` environment variable is essentially a 60 | list of locations your terminal looks for commands in, and we want Homebrew to 61 | be at the top. 62 | 63 | Run this command in your terminal, which'll do the above for you: 64 | 65 | ``` 66 | echo 'export PATH=/usr/local/bin:/usr/local/sbin:$PATH' >> ~/.bashrc 67 | ``` 68 | 69 | ## Installing Python 70 | 71 | Now that we have Homebrew, we'll use it to download **Python 2.7**, which is the 72 | default Python version installed by Homebrew. 73 | 74 | ``` 75 | brew install python 76 | ``` 77 | 78 | ## Installing git 79 | 80 | The last thing we need to have installed is [git](http://git-scm.com/), which is 81 | a version control system. You can work on your programming projects while 82 | committing versions, allowing you to roll back easily if something you do 83 | breaks. git also works with GitHub, so you can save your project to the 84 | "cloud", backing it up as well as allowing others to work on the same project 85 | with you. 86 | 87 | Since we have Homebrew installed, it's easy to install git: 88 | 89 | ``` 90 | brew install git 91 | ``` 92 | 93 | We'll go over some of these basics in the book, but if you'd like to do some 94 | advanced reading on git basics, [check out this 95 | guide](http://git-scm.com/book/en/Git-Basics). 96 | 97 | ## Installing pip 98 | 99 | [pip](http://www.pip-installer.org/en/latest/) is essentially Homebrew for 100 | Python packages, which was already installed when Homebrew installed Python. 101 | Yay! 102 | 103 | ## Installing Virtualenv 104 | 105 | [Head over to this page which'll tell you about virtual environments and how to 106 | install 107 | Virtualenv.](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/virtualenv-installation.md) 108 | 109 | - - - 110 | 111 | You're finished setting up your system! 112 | 113 | But wait, you may be thinking - what about installing Django? We're going to 114 | install Django on a project-by-project basis (within the virtual environment 115 | provided by virtualenv). [Follow those instructions 116 | here.](https://github.com/limedaring/HelloWebApp/blob/master/installation-instructions/starting-your-project.md) 117 | -------------------------------------------------------------------------------- /installation-instructions/starting-your-project.md: -------------------------------------------------------------------------------- 1 | # Starting your Django project 2 | 3 | You've installed Python and the other utilities (pip, virtualenv, and git) on 4 | your computer, right? If not, [head here to 5 | install](https://github.com/limedaring/HelloWebApp/tree/master/installation-instructions). 6 | 7 | First thing we need to do is create a folder for your project. I personally use 8 | a "projects" folder in my top level user folder on my computer, which contains 9 | all my programming projects. If you'd like to do this as well, follow these 10 | commands in your terminal to create the projects folder, and a folder within for 11 | this individual project: 12 | 13 | ``` 14 | $ mkdir projects 15 | $ cd projects 16 | projects $ mkdir myhellowebapp 17 | projects $ cd myhellowebapp 18 | ``` 19 | 20 | If you need a command line review, `mkdir` creates folders, and `cd` changes 21 | directories into that folder. If you ever get lost, your terminal should show 22 | which directory you're in, and running `ls` (on Mac or Linux, `dir` on Windows), 23 | will list out the contents of the folder you're in. Use `cd ..` to back up out 24 | of a folder. 25 | 26 | ### Start your virtual environment 27 | 28 | Now that you're within your empty project folder, create your virtual 29 | environment. We'll be using virtualenv, [which we installed after we installed 30 | Python](https://github.com/hellowebapp/hellowebapp/tree/master/installation-instructions). 31 | (With Conda [the instructions](https://github.com/hellowebapp/hellowebapp/tree/master/installation-instructions/conda-virtualenv.md) 32 | are a little different.) 33 | 34 | ``` 35 | projects/myhellowebapp $ virtualenv venv 36 | ``` 37 | 38 | And then activate the environment: 39 | 40 | ``` 41 | projects/myhellowebapp $ source venv/bin/activate 42 | ``` 43 | 44 | You should see something like this in your command line before the folder 45 | structure - the (venv) indicates you're in the virtual environment: 46 | 47 | ``` 48 | (venv)limedaring@Orion ~/projects/myhellowebapp $ 49 | ``` 50 | 51 | (Orion is my computer's name and limedaring is my username - your exact setup 52 | will be different.) 53 | 54 | Now you're in your bubble, so we can start installing project-specific utilities. 55 | If you ever need to deactivate your environment, run `deactivate`. 56 | 57 | ### Install Django 58 | 59 | Finally, it's Django time! We'll use pip to install Django, so run this in your 60 | command line, making sure you're in your project folder and the virtual 61 | environment is activated: 62 | 63 | ``` 64 | $ pip install Django==1.9.6 65 | ``` 66 | 67 | We're telling pip to install a specific version of Django, in case Django 68 | releases a new version that this tutorial doesn't cover. 69 | 70 | ### Start git 71 | 72 | We also want to start our version control system. Now that we're in our project 73 | folder, run this command to start git: 74 | 75 | ``` 76 | $ git init 77 | ``` 78 | 79 | Running this command in your project folder will make the entire folder and its 80 | contents part of a new Git repository. For more about git and why we should use 81 | it (spoiler: version control is very important *and* it's needed for deployment 82 | to Heroku), see the [Git tips page 83 | here](https://github.com/limedaring/HelloWebApp/tree/master/git-tips). 84 | 85 | ### Start your Django project 86 | 87 | We installed Django, now we can use Django to build all the starting files we 88 | need for our web app. In your command line (again, in your project folder with 89 | your environment activated): 90 | 91 | ``` 92 | $ django-admin.py startproject hellowebapp . 93 | ``` 94 | 95 | This is going to start a Django project in your currect directory. 96 | 97 | * django-admin.py: The script we'll be running. 98 | * startproject: The specific utility we're using. 99 | * hellowebapp: The name we're giving the project. 100 | * . : The location where we're starting the project, with `.` denoting the 101 | current directory. 102 | 103 | `startproject` will create these files and folders: 104 | 105 | ``` 106 | myhellowebapp/ 107 | manage.py 108 | hellowebapp/ 109 | __init__.py 110 | settings.py 111 | urls.py 112 | wsgi.py 113 | ``` 114 | 115 | The myhellowebapp folder is your top level folder. 116 | 117 | * `manage.py`: We won't edit this file, but will use this file in the command line 118 | to interact with your project. You'll see it in action soon. 119 | * The inner `hellowebapp` folder holds your project. 120 | * `__init__.py`: Ignorable - tells Python that this is a Python package. 121 | * `settings.py`: Aptly named - contains your settings. 122 | * `urls.py`: URL declarations for the project. Important and we'll go over this 123 | soon. 124 | * `wsgi.py`: Not needed at this point until you deploy your project. 125 | 126 | ### Create a Django app 127 | 128 | A project can run many apps (all doing something distinct), but we're just going 129 | to focus on having one for now, which is all you'll need for a very long 130 | time. 131 | 132 | In your top level folder (the one with *manage.py* in it), run this command: 133 | 134 | ``` 135 | $ django-admin.py startapp collection 136 | ``` 137 | 138 | Like before, `django-admin.py` is the script, `startapp` is the command, and 139 | `collection` is the name we're giving the app, which you can change if you wish. 140 | 141 | `startapp` will create an additional folder and a few files: 142 | 143 | ``` 144 | myhellowebapp/ 145 | manage.py 146 | collection/ 147 | __init__.py 148 | admin.py 149 | migrations/ 150 | models.py 151 | tests.py 152 | views.py 153 | hellowebapp/ 154 | __init__.py 155 | settings.py 156 | urls.py 157 | wsgi.py 158 | ``` 159 | 160 | Note the additional "collection" folder in your project. 161 | 162 | * `__init__.py`: Ignorable. 163 | * `admin.py`: Contains admin codebits. 164 | * `models.py`: Where you'll define the dynamic data that'll go in your database. 165 | * `tests.py`: Tests you'll create to run to test your app automatically. 166 | * `views.py`: Where the logic goes that powers your website. 167 | 168 | If that's a bit complicated, don't worry about it yet because we'll review it 169 | all later when we specifically start working with all those files. 170 | 171 | ### Add your new app to your settings file 172 | 173 | We need to tell the project that we've added an app to it. Open up your 174 | `settings.py` file (which is under your `hellowebapp` folder, see the directory 175 | tree above). 176 | 177 | Find the `INSTALLED_APPS` and add the name of your app to the beginning of the list 178 | (don't forget the trailing comma): 179 | 180 | ``` python 181 | INSTALLED_APPS = ( 182 | 'collection', # this is the app we added 183 | 'django.contrib.admin', 184 | 'django.contrib.auth', 185 | 'django.contrib.contenttypes', 186 | 'django.contrib.sessions', 187 | 'django.contrib.messages', 188 | 'django.contrib.staticfiles', 189 | ) 190 | ``` 191 | 192 | ## Set up your database 193 | 194 | Django has some fancypants utilities built in to keep your database (where 195 | all your dynamic information is stored) managable. We need to run the initial 196 | migration before we start the app, so in your top level folder (the one with 197 | *manage.py* in it), type this in: 198 | 199 | ``` 200 | $ python manage.py migrate 201 | ``` 202 | 203 | It's going to create your database automatically for you and port over some 204 | information. Don't worry about understanding this just yet - we'll go over 205 | databases and migrations a bit more in the "Adding Dynamic Data" chapter of 206 | Hello Web App. 207 | 208 | ## Start your Django web app 209 | 210 | Want to see if everything worked? In your terminal, head over to your top level 211 | myhellowebapp folder (make sure you're in the folder with *manage.py*) and run 212 | this command: 213 | 214 | ``` 215 | $ python manage.py runserver 216 | ``` 217 | 218 | ...and you'll see the local Django development server starting, which'll serve 219 | your project to your computer. 220 | 221 | ``` 222 | Validating models... 223 | 224 | 0 errors found 225 | March 26, 2014 - 15:50:53 226 | Django version 1.7.8, using settings 'mysite.settings' 227 | Starting development server at http://127.0.0.1:8000/ 228 | Quit the server with CONTROL-C. 229 | ``` 230 | 231 | Now just head to your favorite web browser and visit 232 | [http://127.0.0.1:8000](http://127.0.0.1:8000), where you'll see a "Welcome to 233 | Django" page. Congrats on starting Django! 234 | -------------------------------------------------------------------------------- /pycon-tutorial/additional-resources.md: -------------------------------------------------------------------------------- 1 | # After the tutorial resources 2 | 3 | Congrats on making it through the tutorial! This document contains some fun 4 | things that you might want to poke at after the tutorial - additional Django 5 | tutorials, information on databases, and more. 6 | 7 | If you'd like to add anything to this list, just send a pull-request or email me 8 | at tracy@limedaring.com! 9 | 10 | ## Django references: 11 | 12 | * **[Django built-in template tags](https://docs.djangoproject.com/en/dev/ref/templates/builtins/)** 13 | * **[Django model fields](https://docs.djangoproject.com/en/dev/ref/models/fields/)** 14 | * **[Django querysets](https://docs.djangoproject.com/en/dev/ref/models/querysets/)** 15 | 16 | ## Front-end Design Resources: 17 | 18 | * **CSS Frameworks** — helps you with a framework for your website, with widgets 19 | like drop-downs and grids already built. 20 | * [http://getbootstrap.com/](http://getbootstrap.com/) - more designed and 21 | easy to get started with, should probably edit the design a bit on your 22 | own from the default. 23 | * [http://foundation.zurb.com/](http://foundation.zurb.com/) - more powerful 24 | and easier to extend but not as easy to get started with. 25 | * **CSS Processors**: Allows you to make functions with CSS and more 26 | * LESS CSS: [http://lesscss.org/](http://lesscss.org/) 27 | * Compass (which uses Sass) 28 | [http://compass-style.org/](http://compass-style.org/) 29 | * Sass: [http://sass-lang.com/](http://sass-lang.com/) 30 | * Both are great. Bootstrap above uses LESS, some people say that Sass 31 | is easier to use. 32 | * **HTML5 Bootstrap:** Userful to generate HTML templates so you don’t have to 33 | write them entirely from scratch[. 34 | ](http://www.initializr.com/)[http://www.initializr.com](http://www.initializr.com/) 35 | * **Design resources:** 36 | * Book: Design for Hackers: 37 | http://www.amazon.com/Design-Hackers-Reverse-Engineering-Beauty/dp/1119998956 38 | * [https://hackdesign.org/](https://hackdesign.org/) — online design courses 39 | * **Design inspiration:** 40 | * [http://www.cssmania.com/](http://www.cssmania.com/) 41 | * [http://www.siteinspire.com/](http://www.siteinspire.com/) 42 | * [http://www.thebestdesigns.com/](http://www.thebestdesigns.com/) 43 | * [http://unmatchedstyle.com/](http://unmatchedstyle.com/) 44 | * **Front end testing:** 45 | * [http://silverbackapp.com/](http://silverbackapp.com/) 46 | * Keep in mind that your app’s design can be really, really basic — just keep it 47 | clean and make sure it works well, and you can always improve the interface 48 | later! 49 | 50 | ## Front-end Javascript Packages: 51 | 52 | * **Javascript Frameworks:** jQuery (recommended), Google Closure (very 53 | advanced, should only be considered for huge applications) 54 | * **MVC frameworks:** Angular.js, Ember.js, backbone + underscore.js 55 | * **Frontend templating:** Mustache.js, Handlebars.js 56 | 57 | ## Picking your DB: 58 | 59 | * **SQL:** PostgreSQL (most reliable), MySQL (available on most shared hosting), 60 | SQLite (convenient for development but do not use for production, will fail 61 | with more than 1 user) 62 | * **NoSQL:** MongoDB, Riak, CouchDB, Redis, Cassandra (Probably a good idea to 63 | avoid these unless you know what you’re doing) 64 | 65 | ## Cool Django Plugins: 66 | 67 | * **South:** useful for dealing with django migrations (built into Django since 68 | 1.7) - data migration, so you can add new info to your models and have your 69 | databases smoothly add extra columns without breaking extra data. 70 | * **Celery:** Useful for creating tasks that can be scheduled or creating 71 | methods that can be launched asynchronously (not blocking) 72 | * **Haystack:** Text search for Django (need to supply your own search backend) 73 | * **Django-Registration:** 74 | [https://pypi.python.org/pypi/django-registration](https://pypi.python.org/pypi/django-registration) 75 | * Working with images? Use **Pillow**: 76 | [https://pypi.python.org/pypi/Pillow/2.3.0](https://pypi.python.org/pypi/Pillow/2.3.0) 77 | * **Tastypie:** API creation. https://django-tastypie.readthedocs.org/en/latest/ 78 | * Find more at 79 | [https://www.djangopackages.com/](https://www.djangopackages.com/) ! 80 | 81 | ## Django resources: 82 | 83 | * Django best practices book, **Two Scoops of Django**: [http://www.amazon.com/Two-Scoops-Django-Best-Practices/dp/1481879707](http://www.amazon.com/Two-Scoops-Django-Best-Practices/dp/1481879707) 84 | * **[DjangoPackages.com](http://DjangoPackages.com)** 85 | 86 | ## Ask questions and make friends on IRC: 87 | 88 | * Use IRC and want to ask someone a python/django question? 89 | * **#positivepython** on freenode is great. 90 | * **#pyladies** 91 | * Want to use IRC? [http://freenode.net/using_the_network.shtml](http://freenode.net/using_the_network.shtml) 92 | * Clients: 93 | * Mac: [http://limechat.net/mac/](http://limechat.net/mac/) 94 | * Mac: [http://colloquy.info/](http://colloquy.info/) 95 | * PC/Linux: [http://xchat.org/](http://xchat.org/) 96 | * PC: [http://www.mirc.com/](http://www.mirc.com/) 97 | 98 | ## Want more Django tutorials? 99 | 100 | * [http://gettingstartedwithdjango.com/](http://gettingstartedwithdjango.com/) — video/screencast tutorial 101 | * Older videos by same author: [http://gettingstartedwithdjango.com/pages/gigantuan/](http://gettingstartedwithdjango.com/pages/gigantuan/) 102 | * [http://www.tangowithdjango.com/](http://www.tangowithdjango.com/) 103 | * [http://effectivedjango.com/tutorial/](http://effectivedjango.com/tutorial/) 104 | * [http://hellowebapp.com](http://hellowebapp.com) (launching in June, Tracy’s shameless plug) 105 | 106 | ## Launching your project: 107 | 108 | * **Heroku**, hosting platform 109 | * [http://devcenter.heroku.com/articles/django](http://devcenter.heroku.com/articles/django) 110 | * [https://mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/](https://mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/) 111 | * **AWS,** Amazon Webservices 112 | * Google AppEngine 113 | 114 | ## Tools: 115 | 116 | * **Version Control:** Git (e.g. github, bitbucket) 117 | * **Text Editors:** [Sublime Text 2](http://www.sublimetext.com/2) (Mac), [TextMate 2](http://macromates.com/) (Mac, rumoured to be deadware [maintained by the open source community](https://github.com/textmate/textmate)), Vim, Emacs, Notepad++ 118 | * MacVim (Vim for Mac) is great and free: [https://code.google.com/p/macvim/](https://code.google.com/p/macvim/) 119 | * Vim and Emacs are hard to learn (can take weeks to get proficient) but very powerful. Probably better to start with something else unless you love learning complex new tools. 120 | * **Vim tutorials:** (MacVim allows you to do regular commands like ctrl-v and using your mouse along with vim commands, which makes vim easier to use for beginners) 121 | * [http://www.danielmiessler.com/study/vim/](http://www.danielmiessler.com/study/vim/) 122 | * http://www.openvim.com/tutorial.html 123 | * **Python IDEs:** Pycharm, xcode, eclipse, anaconda 124 | * **Handing development environments:** virtualenvwrapper 125 | * Note: there’s a lot of configuration if you’re using a non standard filepath and not particularly recommended with Anaconda 126 | * **Handling python requirements:** pip, easy_install 127 | * **Database inspection:** SequelPro, Mongohub 128 | * **Python Shells:** ipython, bpython 129 | * **Editing on a remote server:** Macfusion, ssh 130 | * **PEP8:** Not quite a tool, but make sure your Python code is pretty and usable by using the Python Style Guide: http://legacy.python.org/dev/peps/pep-0008/ 131 | 132 | ## Starting a new project? Some general advice: 133 | 134 | * **Launch Quickly!** 135 | * **Figure out your MVP** (minimum viable product) — the very smallest set of features you’d need to have a workable app, and launch. 136 | * Likely, your future features will change/update once you work with real customers. 137 | * Don’t fall in the trap of not launching out of fear, feeling like you don’t have enough features, etc etc. :) 138 | * Learn to strike a balance between doing things the right way vs. doing things quickly because they need to get done. 139 | * Unit tests are great! But if your code is changing too quickly, tests may not be useful. 140 | * **Be careful about database calls** — can severely slow down your web app if you do too many. Database calls are any time you’re pulling info from the database — doing a filter() or model.objects.all(), etc. 141 | * Check out select_related and prefetch_related when you’re making your QuerySets: [https://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related](https://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related) 142 | * Still too slow? Consider [caching](https://docs.djangoproject.com/en/dev/topics/cache/) 143 | * **Break it down into the tiniest pieces possible and tackle each piece one-by-one.** 144 | * Figure out the easiest way to tackle each piece (and if any pieces you can do without any coding at all. Keep it simple.) 145 | * For example, building a site where you list your favorite jams: 146 | * You’ll need a model to hold the jam information (name of jam, description of jam, perhaps an image). 147 | * You’ll need a page that shows all the jams added to the database, with a view powering that page. Make sure to add this URL to urls.py. 148 | * You’ll need a page for each individual jam, with a url.py entry pointing to it and a view powering it. 149 | * You can add new jams using the admin, but maybe you’ll want to make a page on your website with a form to add new jams. 150 | * Which might need a confirmation/success page. 151 | * Etc. etc. etc. Break it down into pieces, tackle individual pieces, ask for help and google madly if needed. :) 152 | --------------------------------------------------------------------------------