be run. That means that your Python is not installed, or the environment variable is not configured correctly, the simplest way is to install the new version of the Python 2.7.9, which integrates the PIP, the installation to tick the environment variable this oneSee also: Python environment setup2.2. Download the source installationhttps://www.djangoproject.com/
Example of checking box usage in Django development, django example
This example describes how to use the check box in Django development. We will share this with you for your reference. The details are as follows:
1. query check
web server document. This makes it possible for people to see your original code on the Internet.
We can place the code in some directories outside the root directory of the document.Go to the directory you created and run the command Django-Admin. py startproject mysite.
This will create a directory named mysite under your current directory:
Note:If you use the setup. py tool to install Django,
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
Example of a scheduled task using django-crontab, and django-crontab
Today, I plan to add a scheduled task in my Django application to regularly execute some regular check functions. So I thought that using the django-crontab plug-in can satisfy my needs, the following descr
Python Web development framework-Django (1), python-django
In the past, web. py (another lightweight web Development Framework) was used as a monitoring and management platform, so it was hard to pick up without making special records. Recently, a log aggregation system is using dj
with Pydev to achieve the first HelloWorldAfter the Pydev plugin is installed and configured, turn on eclipseFile–new–pydev ProjectEnter project nameCancel the use Default and choose the directory you created for the third step.Add Source code folder:Click on Project, right button, propertiesPydev-pythonpath Source floders tab ADD Source FloderJoin the current project folderCreate a first.py file under SRCThe contents are as followsFromdjango.http ImporthttpresponsedefHello(Request):Returnhttpr
uses the following command to create a App:python manage.py Startapp Testmodel.② Modify the testmodel/models.py file:From django.db import ModelsClass Test (models. Model):Name = models. Charfield (MAX_LENGTH=20)The class name represents the database table name and inherits the models. Model, the field inside the class represents the field (name) in the data table, the data type is Charfield (equivalent to varchar), Datefield (equivalent to DateTime), and the max_length parameter limits the len
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 M
version number.Test Django Installation
Let's take some time to test whether Django is successfully installed and works well. You can also get some clear feedback after installation. In Shell, change to another directory (not including Django directory) and input python to open the
successfully installed and works well. You can also get some clear feedback after installation. In Shell, change to another directory (not including Django directory) and input python to open the Python interactive interpreter. If the installation is successful, you can import the django module:
>>> import
you are unsure, you can enter the following command:
Python-c ' Import sys, pprint; Pprint.pprint (Sys.path) '
The above results will contain the Site-packages directory
In the Site-packages directory, create a file django.pth, edit the file that contains the full path profit for the Djtrunk directory, which contains the following line:
/home/me/code/djtrunk
Add Djtrunk/django/bin to th
(i) DescriptionA brief description of how Django works, with 2 examples.(ii) How Django worksSuppose we have the following files, here in the first 2 articles based on the addition of the templates directory (storing HTML files) and static directory (storage image JS, CSS, etc.)(iii) Implementation of a complete user interface# Suppose you've created a project and an app. The following urlconf and view func
The following describes how to use and extend manage commands in the Python Django framework: pythondjango
[Overview]
Django-admin.py is a command line tool for Django to manage tasks. This article describes its general usage.
In addition, there is a manage. py in each Django
Example of how django restricts access and redirection by anonymous users, while django Anonymous Users
Preface
We should have met that in some pages, we do not want anonymous users to access them, such as personal pages. Such pages can only be accessed by logged-on users. In django, we also have many ways to implement
AllowOverride In the httpd. conf configuration file (for example, AllowOverride = All)
V. Summary
If you follow the installation steps above, we will get the following content:
Apache 2.2.16 directory:
/Opt/Apache
Python 2.7 directory:
/Opt/Python/2.7.
Mod_python.so location:
/Opt/Apache/modules/mod_python.so
Django s
First Django Program:
1. Install python2.x, it is recommended to install 2.6 or 2.7 download address www.python.org
Configure environment variables My Computer-> Properties-> Advanced-> Environment variables-> System variables
Increase Python_home C:\Python27
Modify path to join%python_home%
2. Install Django Download Address https://www.djangoproject.com/
Currently 1.3.1, unzip the downloaded file and put
so that the file can be executed everywhere:
CP/ORIGIN/SVN/Django/trunk/Django/bin/django-admin.py/usr/bin/
Or
CP/source/SVN/Django/bin/django-admin.py/usr/bin/
If you run the django-admin.py, you get the following error message:
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.