Django development is required

Source: Internet
Author: User

Copyright description

I have recently found many articles reposted by the author without explaining the author and the source, so I have made some special statements.

All content in this blog is allowed by Creative Commons licenses. When referencing this content, keep itZhu Tao,SourceAndNon-commercial.

Summary

As the most fluent Web framework in the python community, Django emphasizesQuick Development,Reuse,ReadableThis article mainly introduces the knowledge required to use Django for development. It also includes some guiding principles and some experiences from the author.

Contents

Basic knowledge familiar with Python and Django

Django is based on python, so you need to be familiar with related technologies before development.

Python recommends several good books, including:

  1. Learning Python
  2. Python cookbook

Familiar with Django official documents and related books, these are required. Good books include:

  1. Django book
  2. Pro Django
  3. Practical Django Projects

For more information, see Django related resources.

Other related technologies

As a web development programmer, you also need to understand other related technologies, including:

  • Html
  • CSS
  • JavaScript (jquery, etc)
  • Ajax
  • Network Knowledge and standards, such as HTTP protocol and TCP/IP network architecture.
Available resources

After mastering the Basic Knowledge mentioned above, we are familiar with python, Django, and web development technologies, and have a certain understanding of the philosophy of Python and Django, suchDon't repeat yourself,Keep it simple, stupid,Don't reinvent wheelsAnd so on.

Therefore, before starting a project, we need to know which resources are available.

Among the available resources, pinax is the most important project to be tracked. It provides some common functions required by the site, and the method used is to provide someReusable appsSo that we can easily integrate into our environment, or perform secondary development based on pinax.

In addition, you also need to know resources in specific fields, such:

  • Store Satchmo
  • Geodjango
  • Openid Django-openid
  • And so on.

After obtaining resources in a specific field, it will greatly improve the development efficiency and reduce the cost.

Advanced knowledge

Mastering the technology mentioned above is basically a qualified Django programmer, but you also need to know some advanced knowledge.

Use virtualenv + Pip to build an independent development environment

Virtualenv is used to create an independent virtual environment (similar to other modules), so that programs in different virtual environments can depend on different versions of modules, for example, a Django project is based on 0.96, and another project is based on 1.1. Therefore, different virtual environments must be created. For more information, see Pip and virtualenv.

Use PipCopyExisting dependencies. Pip is used to replace easy_install. In addition, we can also easily use PipCopyOur current work environment. For exampleRequirements.txtFile to record the relevant dependencies in our current work environment, and then enterPIP install-r/path/to/requirements.txtThe dependent software is automatically installed. The premise is that your system has installed Pip.

In addition, when you need to deploy a Django project, you can use wsgi for convenient deployment. For details, see virtualenv and wsgi.

Deploy with fabric

Refer to deploying Python web applications

In addition, we can also use the powerful functions of python to implement path self-adaptation of configuration files, and use the debugging status to set specific attributes.

Recommended Development Process

You can use the following development process to develop Django (assuming that a new project is started ):

  1. Use virtualenv to create an independent environment
  2. Install the corresponding dependency modules using easy_install and Pip
  3. When multiple developers develop, all the current modules can beCopyTo colleagues (PipYesFeezeCommand to output all the dependent modules and versions in the current environment to ensure that all developers use the same code library)
  4. Create an independent environment for the server and use fabric for automatic deployment.
  5. Finally, we use wsgi and web servers to publish products.
Conclusion

Using Django'sReuse,Quick DevelopmentIn addition to some development knowledge (skills) described above, if you find a process cumbersome during development, at this time, you should consider whether there are related solutions. instead of simply taking time to complete.

References
  1. Notes on using Pip and virtualenv with Django
  2. Woodpecker community
  3. Django-related resources

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.