How to install Django
Downloading these software and then installing them as follow:
python: http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
PIL for py2.4: http://www.pythonware.com/products/pil/
Django: http://media.djangoproject.com/releases/0.95/Django-0.95.4.tar.gz
apache: http://apache.justdn.org/httpd/binaries/win32/apache_2.0.58-win32-x86-no_ssl.msi
mod_python: http://apache.justdn.org/httpd/modpython/win/3.2.8/mod_python-3.2.8.win32-py2.4.exe
you can also find them as attachments in this page.
Entering Django-0.95.4 directory
Using 'python ez_setup.py' command to check whether 'setuptool' is existent or not, if it is not existent, then it will download automatically from internet.
Then installing Django
Using 'python setup.py install' command to install Django to site-package directory and configure the sys.path file.
You can also check it out in terminal using:
import sys
print sys.path
Checking 'mod_python.so' out in 'D:\Program Files\Apache Group\Apache2\modules' directory
Modifying appach conf/httpd.conf file
Adding following things:
'LoadModule python_module modules/mod_python.so'
<Directory "D:/Program Files/Apache Group/Apache2/htdocs/test">
AddHandler mod_python .py
PythonHandler pythonTest
PythonDebug On
</Directory>
Creating a ‘pythonTest.py’ file in the test directory, like this(paying more attention on code formatting):
from mod_python import apache
def handler(req):
req.content_type = 'text/plain'
req.write("Hello World!\n")
return apache.OK
Restart appach
Using following address:
http://127.0.0.1/test/pythonTest.py
'Hello World!' appears on the page.
Next, creating a django project.
Entering D:\Program Files\Python24\Scripts directory
Using 'django-admin.py startproject newtest' command to create a new django project.
Cutting the newtest directory and then pasting in D:\Program Files\Python24\Lib\site-packages directory
Modifying appach conf/httpd.conf file
<Location "/newtest/">
SetHandler python-program
PythonPath "sys.path+['D:/Program Files/Python24/Lib/site-packages/newtest']"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE newtest.settings
PythonDebug On
</Location>
Restart appach
Using following address:
http://127.0.0.1/newtest/
It works!
LOL
分享到:
相关推荐
Beginning Django CMS shows you how to simply and easily write a dynamic website with a full content management system in the backend. It is written for Internet developers who are sick and tired of ...
Beginning Django CMS shows you how to simply and easily write a dynamic website with a full content management system in the backend. It is written for Internet developers who are sick and tired of ...
pip install django-dramatiq 在任何自定义应用程序之前,将django_dramatiq添加到已安装的应用程序: import os INSTALLED_APPS = [ "django_dramatiq" , "myprojectapp1" , "myprojectapp2" , # etc... ] 在...
pip install django-filepicker 将文件选择器api密钥添加到settings.py文件中。 您可以在找到api密钥。 FILEPICKER_API_KEY = 配置您的媒体根目录。 CWD = os.getcwd() MEDIA_ROOT = os.path.join(CWD, 'media')...
Chapter 1, Package Installation and Management, explains how to install and manage the code libraries used in the book. Chapter 2, Introduction to Geospatial Code Libraries, covers the major code ...
You will also learn how to install and configure Flask-Click extension. Style and approach This book covers how to effectively use the Flask micro-framework to develop a series of web applications. ...
there are many extensions available to Flask which helps it to function at the same level as other large frameworks such as Django and Ruby on Rails., This book will demonstrate how to develop a ...
https://docs.djangoproject.com/en/4.0/howto/initial-data/ ```bash > python3 manage.py loaddata fixtures/* ``` ## 开始 1. 启动服务 ```bash > python3 manage.py runserver localhost:8001 ``` > 若启动以 ...
启动make install *name of your application* 第三步 使用应用程序名称更改 makefile APP 值 第四步 玩得开心 生成文件规则 help => display how use makefile rules (actually in french) module => create new ...
# https://stackoverflow.com/questions/57449169/how-to-install-deprecated-unsupported-python-3-4-on-conda-environment conda config --set restore_free_channel True conda create -n django-env python=3.4 ...
如何在Django中注册用户并发送确认电子邮件 ... 我们将通过添加验证并在用户的电子邮件上发送确认链接来添加... 运行requirements.txt- pip3 install -r requirements.txt 运行应用程序python3 manage.py runserver 转到
Moving on, you will discover distributed computing with Python, and learn how to install a broker, use Celery Python Module, and create a worker. You will also understand the StarCluster framework, ...
相关性: NGINX: ://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04 码头工人: : Docker Compose: : Certbot: ://certbot.eff.org/lets-encrypt/ubuntubionic-nginx....
安装所有python依赖项: pip3 install -r requirements.txt 进入stockhelper目录: cd stockhelper 创建SQLite数据库: python3 manage.py migrate 运行Django服务器: python3 manage.py runserver 在浏览器中...