Installing Django
Download the Django package and unzip it.
CMD into the decompression path.
Execute: Python setup.py install
Add Environment variables:
C:\Python27\Scripts
Test if Django is installed successfully
Shell
Import Django
Django. VERSION
Import Django into the project
CMD into the project path
Execute django-admin.py Startproject project name
Run the development server
Project Django path under Python manage.py runserver
Or
Python manage.py Runserver 8000
Or
By specifying an IP address, you can tell the server – Allow non-local connection access. This feature is especially useful if you want to share the same development site with other developers. The ' 0.0.0.0 ' IP address tells the server to listen on any network interface.
Python manage.py runserver 0.0.0.0:8000
The above is the Django server running at CMD Terminal next to run on the server side on Pycharm:If you run the manage.py program directly, you will be prompted with a lot of things, that is, the hint is not passed parameters. So on the pycharm on the parameters to run: Operate as follows open the manage.py file in the upper right corner of the Pycharm click Edit Configurations Editing configuration parameter points Open after the following dialog box, in scrip parameters In the corresponding dialog box, enter the configuration parameters Runserver 0.0.0.0:8000. When the configuration is complete, click OK to finish. After configuring the above information, press CTRL+SHIFT+F10 to run the manage.py file: The following results appear D:\Python27\python.exe d:/djangotext01/manage.py runserver 0.0.0.0:8000
Performing system checks ...
System Check identified no issues (0 silenced).
You have unapplied migrations; Your app properly until they is applied.
Run ' python manage.py migrate ' to apply them.
July 26, 2015-22:10:52
Django version 1.8.2, using Settings ' djangotext01.settings '
Starting development Server at Http://0.0.0.0:8000/
Quit the server with Ctrl-break.
d:\python27\lib\site-packages\django-1.8.2-py2.7.egg\django\utils\translation\__init__.py:146: Removedindjango19warning:the use of the language code ' ZH-CN ' is deprecated. Please use the ' Zh-hans ' translation instead.
The return _trans.activate (language) configuration is complete and will default to the above configuration parameters when it is started later. After configuring the above information, enter http://127.0.0.1:8000 in the browser to return the following results: Remarks: Adding in setting Configuration: Parametersallowed_hosts=[' 192.168.2.52 ']
Pycharm running the Django server side, IP address access