can use this form if you want to specify a version pip install django==1.10 .After the installation is complete as shown:If you see this tutorial, the Django version has changed a lot, then you may need to pay attention to the differences between some versions, the best way is to specify the same version of the installation and tutorial 1.11.6 .In the Linux operating system, as well, use the PIP Toolkit to
BaseCommand, CommandErrorfrom django.db import models#from placeholders import *import os class Command(BaseCommand): def handle(self, *args, **options): print 'hello, django!'
You can use the hello command:
$ python manage.py hellohello, django!
Articles you may be interested in:
How to perform unit tests on projects in the Python Django
VIRTUALENV to manage multiple development environments, Virtualenvwrapper makes virtualenv more usable# Install: (sudo) pip install virtualenv VirtualenvwrapperLinux/mac OSX below:Modify ~/.bash_profile or other environment variable related files (such as. bashrc or. ZSHRC after ZSH), add the following statement
export Workon_home= $HOME/. Virtualenvsexport project_home= $HOME//usr/local/bin/ virtualenvwrapper.shMake it effective immediately (or you can restart
talented programmer, has launched a Web development framework to contend with in the face of Ruby on Rails's increasingly popular propaganda and fiery momentum. After comparing the development framework of Python, the author chooses the Python framework Django as the first choice of the Web development
, provides common Web components such as internationalization, file upload and download, cache, and page static, to meet the needs of most web applications.
★Highly scalable:The plug-in mechanism used by portal-Basic can be flexibly expanded, the portal-Basic-ext-rest and portal-Basic-ext-spring in the portal-Basic release package are provided in the form of plug-ins. you can load or uninstall these plug-ins as needed. Application developers can also
and displayed on the page.
At this point, a complete element, the main framework to show a clear Django project completed, is actually very simple is not it?
Iii. Summary of Django
As Python must be the web framework of Django, it's powerful, comprehensive content, but also
campaign, more mature and lack of good programmers of the Python community has launched to contend with the Web development framework. After a comparison of the development framework of Python, I chose Python framework as the first choice of WEB development framework, the reason is that the new and concise
clear Django project completed, is actually very simple is not it?
Iii. Summary of Django
As Python must be the web framework of Django, it's powerful, comprehensive content, but also means that there are a lot of restrictions, flexibility and poor modification, this is the fish and bear cake can not be combined. We l
Rest is a popular concept now, rest has become a more and more popular application on the web, more and more rest-based Web services, including Twitter, micro-blog is a rest as an external API, previously I have described the "Rest architecture based Web Service Design ", an
effectively organize various resources and effectively control them.
2. Implement the rest Architecture
1. Framework Design
2. Interface Definition
Irestrequest: used to represent rest requests
Irestresponse: used to indicate the rest response
Irestinterceptor: used to represent the
This section describes the static resource manager Django-pipeline and pythondjango in Python's django framework.
Django-pipeline is a very convenient static resource management app in Django. Especially after version 1.2, It is very convenient to use the collectstatic comma
server in any similar production environment. It applies only to the development environment. (We're providing a web-framework business, not a Web server.) )Now that the server is running, please visit http://127.0.0.1:8000/in your Web browser. You will see a delightful, soft light blue "Welcome to Django" page. It works fine!By default, the development server started by the Runserver command listens only
There is no time to clean up, first give the data, how to implement a custom exception handling framework, the purpose is to throw out the definition exception in the rest request, and return the response of the abnormal JSON data.
has been using the predecessor in the Apache CXF framework encapsulated code to write the rest
development process. These web development environments are collectively referred to as Web frameworks, and the goal is to help developers streamline their work, such as providing functionality to accomplish some common tasks, or providing resources to reduce the effort to create, update, execute, or scale applications. 9 The Python Web framework can be a single or multiple sub-component, or it can be a full-stack system. The term "full stack" means
Python Web development framework-Django (2), python-django
Next, I will introduce some practical skills and notes. The first time I used MarkDown for editing, I felt that the gap was too large and not so nice.GET/POST
Data Interaction between the front and back ends. JQuery is used to implement get/post requests.GET Method 1: Use a regular expression to match ur
spoofing submission requests. The POST method submits a table that must have this label.② Create a new search2.py file and use the Search_post function to process the POST request:[Python] View plain copyFrom django.shortcuts Import RenderFrom django.views.decorators import csrf# Receive POST request datadef search_post (Request):CTX ={}If request. POST:ctx[' RLT ' = Request. post[' Q ']return render (Request, "post.html", CTX)③ Modifying urls.py:[Python] View plain copyFrom Django.conf.urls im
A brief introduction to the Django FrameworkThis address: http://blog.csdn.net/caroline_wendy/article/details/291722711. IntroductionDjango is an open-source Web application framework, written by Python.Using the MVC software design pattern, i.e. model M, view V and Controller C.It was originally developed to manage some of the news content-based sites of the Lawrence Publishing Group and was published in J
This article mainly introduces how to deploy and compile the Django framework environment of Python in Windows. Django is a heavyweight MVC Framework in the Python framework, this article describes how to write a hellowworldweb application from the perspective of program dep
\ http/1.1 The body content Hello Ok\r\ n\r\n Hello uses the specific URL of the request header to determine the return of different content URL DNS resolution---IP port Web default port is======================================================================A complete web framework1 Socket Service side2 different functions are implemented according to different URLs .3 Returning content to the client Template Render String substitutionPython framework
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.