Try Django 1.8 Tutorial - 1 of 42 - Introduction - Learn Django

preview_player
Показать описание
Try Django 1.8 - 1 of 42 - Introduction - Learn Django



Topics include:
- Django Project Setup
- Models, Model Forms, Forms, Form Validation
- Function Based Views
- Integrate Bootstrap front-end framework.
- Django Registration Redux for Authentication/Registration
- Launch on a live server
- And More

Post any/all questions in the comments area -- we try to answer all. If you know the answer someone else's question(s), please share!

We are Coding For Entrepreneurs [CFE] and have built an entire library of content to help you master Django and other web technologies launch real projects faster. Enroll today for as low as $20/month.

What Technology you'll learn in the Try Django 1.8 series:
-- Bootstrap (version 3.3): a powerful front-end framework used by thousands of sites around the world. Bootstrap makes it easier to have a responsive web application so it looks awesome on any mobile device and any desktop computer.

All of our tutorials have a simple goal in mind: get you building something real and quickly.

Рекомендации по теме
Комментарии
Автор

Justin, first let me start off by thanking you for taking the time and sharing this class with all of us (for free nonetheless). Having recorded online classes before myself, I truly appreciate your initiative and effort. Having said all that, I find myself between a rock and a hard place. I don’t want to quit your videos half way but the content organization (lack thereof) and, needless tangents are absolutely driving me insane. I suggest spending additional time planning out each lecture and not just showing off functionality impromptu while providing obscure scenarios. I know this sounds harsh, but I am assuming you want to get better, which is why I decided to share. Truly, great effort, lots of good information…but needs cleanup.

AlbinBajramovic
Автор

As an old web hound who's watched the internet grow from the good old days of the BBS systems and CompuServe, Django and similar technologies always seemed so overly complex and unnecessarily convoluted, that I could never really get my head around them. PHP was good enough for me, but after following your 1.9 series, I think I'm starting to see the benefits. I have a bad habit of reinventing the wheel. It's time I learned what all these newfangled gadgets do. Thanks for these tutorials!

thetruth
Автор

Outstanding tutorial. I like the way you explain things, getting into the needed detail, in the right pace. Thank you

codingstrong
Автор

This is really an all-in-one django series, well explained. Thanks very much!

AwaMelvine
Автор

I'm thinking of switching from a PHP-based web application environment to a Python-based development environment - this is JUST what I was looking for to get a taste. Thanks!

BrandonOsborn
Автор

cannot wait to begin coding my startup with django.Thanks a lot for the videos.

vincentmbogo
Автор

Great stuff, I have gone through your previous tutorials too. Very helpful for new bees. Keep it up...

SivaMulagala
Автор

Love this playlist.!! Very well explained

TheOnlyDeepakBaliga
Автор

Well done! A lot of energy and enthusiasm.

bov
Автор

Excelent intro, looking forward to start watching the full playlist :D

luispinto
Автор

Learned a lot! Thanks for this tutorial!!

xinghaozhou
Автор

Great! Looking forward to your indepth database tutorial.

ThomasPaulsen
Автор

Awesome Tutorial Just starting to venture away from PHP..Good tutorials Videos...

BobbyVempati
Автор

Now you're speaking my language...version lol


Thanks for this! Deciphering Django 1.8 from code in 1.6 was tough haha

Mojoman
Автор

Great video's great tutorial, would be a bit nicer if you slowed down a bit as you are flying though a bit to quick at some points for beginner training videos :)

Keep up the great work !

jamescowden
Автор

Hi Justin! Thanks a lot for your hard work and effort. Video quality is awesome. Can you please tell whether I should start from django 1.8 or django 1.9 series ?

solorankerone
Автор

Hi everyone,

I really loved this tutorial. It's the newest Django version, but with python 2.7 which is the older version--but still advantageous if you are just starting out due to more learning materials (codeacademy for example, is still 2.7).

However, I wanted a way to follow along with this tutorial on my windows machine without living inside of a linux virtual machine, but I wanted bash and a linux file structure. Additionally, I wanted to use PyCharm as my editor so I could go ahead and start getting familiar with a fully featured IDE, which also allows you to create the project/virtual environment from within the IDE itself. I took notes on my setup below using windows, PyCharm, and MobaXterm.

It was honestly a bit distracting and convoluted to set up, and I'd definitely recommend a simpler configuration for most people who are learning. However, if being comfortable in your environment is overly-important to you (as it is to me), feel free to use my notes below to replicate my setup on your own machine. In short, I run PyCharm on an xubuntu virtual machine, and I use ssh + x11 forwarding to run the application semi-natively on windows.

Since mobaxterm is portable, I can also access my IDE remotely as well.

Convoluted--yes. Pointless--absolutely. But it works for me.


---

I. Setup Environment:
A. Pycharm (linux VMWare) - Pycharm is a fully-featured IDE for Python & Django, as well as many other frameworks.

Though pycharm has many mechanisms for working on remote servers, it's project setup features
do not seem to be useable for remote servers if you are wanting to setup a virtual environment. My preferred method
for setting up on a windows machine then was to run a virtual machine with xubuntu 15.04 on a vmware server, and
use mobaxterm to ssh into the server and run pycharm through x11. It provides a responsive, nearly native experience,
and allows you to take full advantage of everything that PyCharm has to offer in terms of project setup. It also
offers remote access to your IDE with a native, desktop application feel.

Note that this setup requires a relatively powerful computer (at least 2 cores and 4 GB of RAM should be allocated to the
virtual machine.)

1. Install VMWare Player or Workstation for Windows.
2. Install linux distrobution of choice (xubuntu 15.04 in this case) into the VMWare environment
3. Use your router to create static (or "assigned") IP address for the virtual machine.
4. Open the terminal in the linux guest,
5. Python 2.7.x and python 3.4.x should already be installed. To verify, run command:

$ python --version

and/or

$ python3 --version


6. Install Java OpenJDK (required by PyCharm)

$ sudo apt-get install openjdk-8-jre ##replace "8" with version number if 8 is no longer most current.

7. Download PyCharm:


-or-

b. Terminal Only: Run command:


c. Open terminal in /home/[user name]. Run command:

$ cd /home/[user name]

d. Inside the downloaded directory, unpack using command line by using the command below. GUI extraction is okay too,
but would require you to follow up by changing permissions accordingly. Main thing is you need to make it executable.

$ sudo tar xfz pycharm-educational-*.tar.gz

8. If you started with a server version of linux, make sure xorg is installed:

$ sudo apt-get install xorg

9. Launch PyCharm on virtual machine:

a. GUI: If you have a GUI running, you can click on pycharm.sh located in /home/[user
b. Terminal: ./home/[user
c. Register PyCharm Professional. There are torrents for the windows version with the cracked key that can be used on linux as well, but please buy it if you like it.

d. Assuming it launches correctly, close Pycharm and minimize the virtual machine.

B. MobaXterm - MobaXterm is a very versatile and portable networking tool. It can host it's own servers, and can connect
to all different kinds of servers in a variety of ways. For our purposes, we are going to save three new
sessions to the side bar to make accessing your linux environment in a relatively native/seamless way possible.

1.SSH -
a. Enter the virtual machine's IP address and user name under "Bassic SSH Settings". Default Port is 22.
If you decide later that you need to access this remotely over the internet, you can forward to a new port,
and change the IP address to that of your external internet connection (google "what's my IP")
b. Be sure the following are all CHECKED under "Advanced SSH Settings"
-X11-Forwarding
-Compression
-Display SFTP browser
-Follow SSH Path - keeps a visual representation of the directory structure going in the side bar, making
the terminal easier and faster to navigate.
c. Under Bookmark Settings, enter the name you want to save the terminal session under.

2. PyCharm (X11) -
a. Right-click on the SSH session you just created in the sidebar and click "duplicate". All of the basic information is going to be the same.
b. Right click on the duplicated session, and select "Edit Session"
c. Under "Advanced SSH settings", enter the pycharm launch command in the "Execute command" field:

/home/[user
##replacing [user name] and x's as is appropriate for your
specific environment.
d. Under bookmark settings, change the name ofthe bookmark to something like "Pycharm (X11)", and select OK.

You should now be able to launch PyCharm and an SSH terminal using MobaXterm. You'll be able to work on your Windows
machine, but with the comfortable linux file structure and bash commands that are so useful when working working
with servers, databases, and Python.

C. Project Setup (Using PyCharm)

These setup instructions are based on MVC Landing's 42-part Django Tutorial "Try Django 1.8". They recommend putting
the source code for your Django project *inside* the directory of your VirtualEnv. This seems like a very logical
and generally good idea, as it allows your environment and source code to be stored together on a code repository
later on, and also because it encourages you to keep VirtualEnv's entirely separate for each project--which is of
course the entire point of using it.

However, it is not how PyCharm seems to be inclined to setup your project. Rather, it's interface seems to encourage
separate directories for the virtualenv and the source code. Steps show how to correct this to keep you in line with
the structure recommended by the Try Django 1.8 tutorial.

1. Choose the directory you wish to work in. I chose /home/[user name]/PycharmProjects
2. Open PyCharm through MobaXterm
3. Select "Create New Project"
4. On the side menu, select Django as the framework.
5. Select a local interpreter if none exists. PyCharm should look in /usr/bin/python2.7 (or /usr/bin/python3)
by default, which is correct for ubuntu.
6. Create your VirtualEnv using PyCharm.
a. Select the settings cog icon to the right of the interpreter field.
b. Select Create VirtualEnv
c. Before entering the name of the virtualenv, select the project directory. In my case:

/home/[user name]/PycharmProjects

d. Now type the name of your project in first field (ex: trydjango18), and select OK. PyCharm goes ahead and
creates the virtualenv structure for you, so you can navigate to it in your SSH or virtual machine GUI to check
it out.

7. You should be back at the project setup page. For the project directory, make it the same as the directory used
for your virtualenv, but append "src" to the end, such as this:

/home/[user

8. Under "More Settings", leave everything default except "Application Name", which is blank. This is the name of
single app/module, not your overall project. Your project may ultimately consist of many such applications. Therefore,
it is reasonable to name the application "example_app" until further notice.

9. Press "Create". Django generates your basic project file structure for you. This is equivalent to running the
following terminal command:

$ django-admin.py startproject src

10. Once PyCharm finishes creating the file structure, use the navigator pane in the top left and corner of PyCharm.
11. Change "Project" to "Project Files" so that you can see the directory structure inside the source code folder.
12. You should see the following files/folders under the project folder, "src":
.idea
example_app
src
manage.py
13. As the Try Django 1.8 tutorial points out, the repeating of the folder "src" can be confusing. Rename the child
folder "src" to your actual project name. In this case, "trydjango18"

At this point, you are up-to-speed with Try Django 1.8, part 2 of 42, and you are ready to follow along with the remainder
of the lessons on your windows computer by connecting remotely via MobaXterm and your virtual machine.

neurasyna
Автор

U have been using the sublime text through out this edition, how did you manage to add the plugins for the django support. What plugin for django do you support for autocompletion of the code.

rhcesan
Автор

is there an updated set of videos, for 2.1.5 ?

randmwheeler
Автор

I am new to django, but can you please explain how mySQL is used with django, if at all? Also, is there any mySQL in this series?

rishubk