• Complain

Samuli Natri - Django - The Easy Way: A Step-by-Step Guide on Building Django Websites

Here you can read online Samuli Natri - Django - The Easy Way: A Step-by-Step Guide on Building Django Websites full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2015, publisher: Samuli Natri, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Django - The Easy Way: A Step-by-Step Guide on Building Django Websites
  • Author:
  • Publisher:
    Samuli Natri
  • Genre:
  • Year:
    2015
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Django - The Easy Way: A Step-by-Step Guide on Building Django Websites: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Django - The Easy Way: A Step-by-Step Guide on Building Django Websites" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Django is a very powerful Python Web Framework. You can use it to build everything from simple websites to big high traffic systems.
But starting with Django can be a daunting experience for beginners. The purpose of this book is to guide you through the essential concepts with pragmatic step-by-step examples. You will learn how to build a complete website and deploy it in a real world production environment.
The focus is on Django basic concepts so covering other technologies is kept at minimum. Its helpful to know some Python, HTML, and CSS but you dont need to have any previous experience with those or web development in general to be able to follow the book.
You will learn things like:
How to setup PyCharm for Django (you can use any editor).
How to organize the project and add a base app to hold common assets.
How template inheritance works.
How to reuse common template items like grids and pagination.
How to work with models, views and urls.
How to use GIT and Bitbucket to version control and deploy your code.
How to style all features with SASS (or CSS) and Gulp.
How to create a responsive design.
How to generate thumbnails.
How to use relationships (ManyToMany, OneToMany and Foreignkey) in practical contexts.
How to create custom forms to add and edit content.
How to create and extend class based views.
How to create a custom search.
How to create an authentication system (sign-in, login, logout and reset password).
How to restrict access with groups, permissions and decorators.
How to add a user profile page.
How to add inline fields to the admin area.
How to do test driven development (TDD).
How to translate the website.
How to create custom error pages.
How to setup a production environment with Digitalocean, PostgreSQL, Nginx and Gunicorn.
How to use fixtures to apply initial data.
How to setup domain, HTTPS, Email and Caching with Memcached.
... and a lot more.

Samuli Natri: author's other books


Who wrote Django - The Easy Way: A Step-by-Step Guide on Building Django Websites? Find out the surname, the name of the author of the book and a list of all author's works by series.

Django - The Easy Way: A Step-by-Step Guide on Building Django Websites — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Django - The Easy Way: A Step-by-Step Guide on Building Django Websites" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Django - The Easy Way
A step-by-step guide on building Django websites
Samuli Natri
2017 - 2018 Samuli Natri
Table of Contents
Guide
Foreword
About This Book

This book is a practical guide on how to build Django applications. We will build a blog from start to finnish. Each new feature that we add introduces a new concept.

We cover topics from basic concepts like Models and Views all the way to test - photo 1

We cover topics from basic concepts like Models and Views all the way to test driven development and deployment. By the end of this book you will have deployed a responsive, cached website to a production server and learned how to update it.

The focus is on Django topics. This is not a Python, HTML, CSS or JavaScript book. Those will be covered minimally.

Code Blocks

Sometimes long lines have extra backslashes (\) that have been added automatically. Make sure not to include those.

New inserts and changes in code are marked with bold text:

INSTALLED_APPS = [... 'django.contrib.staticfiles', 'base', 'blog',]
Editors, Code Hosting & Operating System

I would recommend starting with an editor that is easy to get into like Atom (https://atom.io/) so you dont have to fight the tool while learning Django. Check also PyCharm Community Edition (https://www.jetbrains.com/pycharm/). Its a free tool for Python development.

My alltime favourite is Emacs (https://www.gnu.org/software/emacs/) but it requires some work for it to be comfortable to use.

With server operations I usually use Vim (https://www.vim.org/) but Nano (https://www.nano-editor.org/) might be more suitable for beginners. You can install it like this:

sudo apt-get updatesudo apt-get install nano

You can use BitBucket (https://bitbucket.org/) to host your code repository for free. Checkout also GitHub (https://github.com/) and GitLab (https://about.gitlab.com/).

Im using macOS but the development process is pretty much the same with all operating systems. The differences are mainly manifesting in terminal operations. For example in macOS you would activate virtual environment like this source venv/bin/activate but in Windows you run the .bat executable venv\Scripts\activate.bat.

About The Author

Samuli Natri has been doing software development since the 90s. He attended Helsinki University Of Technology (Computer Science) and Helsinki University (Social Sciences).

New Project

Install Python 3: https://www.python.org/downloads/.

Im going to call this project QuarkBlob. Lets organize the files like this:

quarkblob project base blog feedback manage.py project search venv assets (optional)

project folder contains the Django web application. These are the files we will deploy to the production environment in the Deployment chapter.

venv is the virtual environment folder.

VIRTUAL ENVIRONMENTS | Django is like any other Python package and will be installed inside the venv folder. Also the Python executable will be installed in the same folder. This way you can isolate Python and package versions from the system and other projects. We dont copy this folder to the production environment. Instead we install the dependencies (Django and other packets) using pip and requirements.txt file. Read more about venv: https://docs.python.org/3/tutorial/venv.html.

assets is an optional folder where you can store for example mockups or other related documents.

Inside the Django project folder we have app folders and other relevant files.

APPS are Python packages that live inside the project folder and provides features. You can reuse apps in multiple projects. Apps contain views, models and templates among many things. You usually add new apps to the INSTALLED_APPS list in the settings.py file.

  • base app is where we store common reusable items like the base layout.
  • blog app provides the blogging functionality for the site.
  • We also create apps for feedback and search functionality.
  • Inside the project folder we have anotherproject folder (quarkblob/project/project/). This is also considered an app. In here we put files like settings.py that contains site wide configuration data.

Create the project folder somewhere in your system:

mkdir quarkblob &&cd quarkblob

Create a virtual environment and activate it:

python3 -m venv venv &&source venv/bin/activate

You might have multiple Python versions installed in your system. Thats why we specify the version with python3.

In Windowsactivate the virtual environment by running venv\Scripts\activate.bat.

Install Django package and create a new Django project:

pip install django && django-admin startproject project &&cd project

PIP is a Python package manager. Read more: https://pip.pypa.io/en/stable/. You can upgrade it with pip install upgrade pip.

DJANGO-ADMIN is a command line tool for administrative tasks. After we have installed the Django project with it we will use manage.py from the project folder. It does mostly the same thing as django-admin but its easier to use when working with a specific project.

Run the development server. We can now use python instead of python3 when the virtual environment is activated:

python manage.py runserver

RUNSERVER starts a development web server. Dont use this with live sites. In the Deployment chapter we will use Nginx and Gunicorn to serve the pages from the production server.

You can ignore the notice about unapplied migrations for now.

Visit http://127.0.0.1:8000/ and you should see the welcome screen:

Base App PyCharm And Homepage Lets create a base app to hold common reusable - photo 2
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Django - The Easy Way: A Step-by-Step Guide on Building Django Websites»

Look at similar books to Django - The Easy Way: A Step-by-Step Guide on Building Django Websites. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Django - The Easy Way: A Step-by-Step Guide on Building Django Websites»

Discussion, reviews of the book Django - The Easy Way: A Step-by-Step Guide on Building Django Websites and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.