Previous post: Windows installation Diango frame Create a project, start the serverCreate a project with the django-admin.py of the installed Django package, command python django-admin.py startproject mysite (note django-admin.py
-packages/django_tokenapi-1.0-py3.6.egg ', '/usr/local/python3/lib/python3.6/ Site-packages/xlrd-1.0.0-py3.6.egg ', '/usr/local/python3/lib/python3.6/site-packages/python_ Dateutil-2.6.1-py3.6.egg ', '/usr/local/python3/lib/python3.6/site-packages/six-1.10.0-py3.6.egg ']
Server Time:
Tue, 2017 09:56:31 +0000
When you run the project, enter command #Python manage.py runserver 192.168.1.111:8000, enter HTTP///192.168.1.111:80
Django permissions: GRANT all on django.* to ' agu ' @ ' localhost ';1.5 exit: Exit;2) Modify the databases in settings.py 3) Sync to databasePython manage.py makemigrationsPython manage.py Migrate#注 (Django1.71 version: Django python manage.py syncdb)55.1 removedindjango110warningWorkaround: Modify the urls.py:In django1.9, the configuration of URLs no longe
After creating a new Django project, four files are created by default:
_ Init _. py
Manage. py
Settings. py
URLs. py
The following describes the functions of these files:
_ Init _. py
The Django Project is a python package, which is used to tell the python folder as a package. In Python terminology, a package i
First you have to install Python and Django, then configure the environment variables, install Python, and start with the configuration environment variable.1. Configure Environment variablesRight-click on my Computer, or open Control Panel \ System and Security \ SystemLeft navigation bar, advanced system settings, environment variables--and then you'll see the following interface Click this path and click EditThen find the C:\Python27 folder and ad
Import the Django project to Eclipse for debugging, djangoeclipseI cannot stand the feeling of no debugging. The premise is that the Eclipse plug-in has been installed and runs successfully. Reference: http://blog.csdn.net/jerome_s/article/details/463400791. Create a "Pydev Project" Project
2. Select the path of the
12.34.56.78:80Listen 80#域名 + port to identify the server, no domain name with IP can also#ServerName www.example.com:80#不许访问根目录allowoverride None Require all denied#Document DirectoryDocumentRoot"/var/www/html"#restrictions on/var/www directory Access"/var/www">allowoverride None#Allow open access:Require All granted#restrictions on/var/www/html directory Access"/var/www/html"> Options Indexes followsymlinks allowoverride NoneRequire All granted#default encodingAdddefaultcharset UTF-8#Enable
.2. Apache + Mod_wsgi + DjangoFirst install Apache:sudo apt-get install apache2You need to make some changes to the configuration file, in/etc/apache2/apache2.conf, the last line is added:ServerName localhostThen install WSGI:sudo apt-get instal libapace2-mod-wsgiThen restart the server:Apachectl restartThe next step is to write the Django project to the configuration file. Add at the end of apache2.conf:Ws
Operation can refer to http://www.linuxyw.com/353.html (Nginx+uwsgi+django+python Environment Deployment documentation)Here are just a few of my configurationEnvironment:Nginx Version: 1.7.9Django Version: 1.6.8Python version: 2.7.5Uwsgi version: 2.0.9Install Mysql-python:Best source installation, Yum install-y Mysql-python may fail due to path issue import MySQLdb:http://sourceforge.net/projects/mysql-python/files/mysql-python/Tar zxvf mysql-python-1
The path of the Django Apache deployment static file Note pointStatic files are placed in the static folder under the corresponding app or in a folder in Staticfiles_dirs.When DEBUG = True, Django can automatically find the static files that are placed inside. (Django uses the "finder" in Staticfiles_finders to find a match and then stops, looking for a process s
1. Create a project on the Windows side using the tool (either Pythonide or pycharm, etc.)Django-admin Startproject website2. Configure the wsgi.py file:Project_dir = DirName (dirname (Abspath (__file__))) Sys.path.insert (0,project_dir) from django.core.wsgi Import Get_wsgi_application os.environ.setdefault ("Django_settings_module", "website.settings") application = get_ Wsgi_applica
First, install Pycharm and Django not detailed said, self-BaiduSecond, the new Django project also did not sayThird, configure Django to connect to MySQL1.models.py write a class that inherits Models.modelclass Book (models. Model): name=models. Charfield (max_length=) Price =models. Integerfield () pub_date=m
be accessed by:650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/5B/wKioL1V6ULTyayy9AAHtjFNr5pQ451.jpg "title=" Qq20150611133651.jpg "alt=" wkiol1v6ultyayy9aahtjfnr5pq451.jpg "/>650" this.width=650; "src=" http://s3.51cto.com /wyfs02/m01/6e/5f/wkiom1v6txjxcrjhaaengvsuc9o246.jpg "title=" qq20150611133706.jpg "alt=" Wkiom1v6txjxcrjhaaengvsuc9o246.jpg "/>This article is from the "boiled frog with boiling water" blog, please make sure to keep this source http://tanxw.blog.51cto.com/4309
Reference Video Tutorial Http://study.163.com/course/http://www.bilibili.com/video/av8915600/First create a new folder on the desktop test, and then in the terminal to cut into the directoryC:\USERS\AMAZING>CD Desktop\testConnect to input commandC:\users\amazing\desktop\test>django-admin Startproject FaceIf you look at a video tutorial of the Linux environment, you'll find that the commands are a little different. Linux for
background and hits the log to the specified log file or UDP server (daemonize uwsgi). In fact, the most common thing is to output the running record to a local file.pidfile : Specifies the location of the PID file and records the PID number of the main process.Vacuum : Automatically cleans up the environment when the server exits, removes UNIX socket files and PID files (try to remove all of the generated file/sockets)second, Install Nginx
sudoapt-get installnginx #安装
[Django] project packaging and Construction
The structure of the django project is basically similar. The main function of packaging is to remove unnecessary files and compress and package the files to be deployed. Here, you also want to integrate a configuration file template to generate a configuration file, or wri
The template can be completely replaced with a partial code after the new project is created.Create a app01 python startapp app01Create a static subdirectorysettings.py"" "Django Settings for User_manager project. Generated by ' Django-admin startproject ' using Django 2.0.1
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.