djangoproject本地部署
2024-08-29 05:55:01
1. 下载源码:https://codeload.github.com/django/djangoproject.com/zip/master
2. 本地解压
3. 下载python2.7 install https://www.python.org/downloads/
3.1 yum安装zlib-devel-1.2.3-29.el6.x86_64,修改Modules/Setup,开启zlib支持
464 # Andrew Kuchling's zlib module.
465 # This require zlib 1.1.3 (or later).
466 # See http://www.gzip.org/zlib/
467 zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
4. 下载pip工具,安装pip:https://bootstrap.pypa.io/get-pip.py
5. 安装postgresql https://ftp.postgresql.org/pub/source/v9.0.2/postgresql-9.0.2.tar.gz
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
6. 按照readme.rst安装
#. Create a virtualenv #. Install dependencies:: pip install -r requirements/dev.txt Alternatively use the make task:: make install #. Create a 'secrets.json' file in the directory above the checkout, containing
something like:: { "secret_key": "xyz",
"superfeedr_creds": ["any@email.com", "some_string"] } #. Create databases:: createuser -d djangoproject
createdb -O djangoproject djangoproject
createuser -d code.djangoproject
createdb -O code.djangoproject code.djangoproject #. Create tables:: psql -d code.djangoproject < tracdb/trac.sql ./manage.py migrate #. Create a superuser:: ./manage.py createsuperuser #. Populate the www and docs hostnames in the django.contrib.sites app:: ./manage.py loaddata dev_sites #. For docs:: ./manage.py loaddata doc_releases
./manage.py update_docs #. For dashboard:: ./manage.py loaddata dashboard_example_data
./manage.py update_metrics #. Point the ``www.djangoproject.dev``, ``docs.djangoproject.dev`` and ``dashboard.djangoproject.dev``
hostnames with your ``/etc/hosts`` file to ``localhost``/``127.0.0.1``.
Here's how it could look like:: 127.0.0.1 docs.djangoproject.dev www.djangoproject.dev dashboard.djangoproject.dev If you're on Mac OS and don't feel like editing the ``/etc/hosts`` file
manually, there is a great preference pane called `Hosts.prefpane`_. On
Ubuntu there is a `built-in network admin`_ GUI to do the same. Remember
both require admin priviledges, just like you'd need when editing
``/etc/hosts`` with your favorite editor. .. _`Hosts.prefpane`: https://github.com/specialunderwear/Hosts.prefpane
.. _`built-in network admin`: https://help.ubuntu.com/community/NetworkAdmin #. Finally run the server:: make run
8. Windows本地host文件修改:C:\Windows\System32\drivers\etc\hosts 中添加如下:
192.168.31.123 docs.djangoproject.dev
192.168.31.123 www.djangoproject.dev
192.168.31.123 dashboard.djangoproject.dev
9. 本地访问,幸福的码农生活才刚刚开始 ^_^
最新文章
- Java虚拟机详解01----初识JVM
- Radius session
- thinkphp 一个页面使用2次分页的方法
- 去掉影响效率的where 1=1
- canvas 俄罗斯方块
- Java反射学习(java reflect)(一)
- redis运行状态图形化监控工具 — RedisLive
- js中关于一个数组中最大、最小值以及它们的下标的输出的一种解决办法
- nginx 搭建rtmp流媒体所用资源
- 选择Blobs (Evision)
- 【前端】react and redux教程学习实践,浅显易懂的实践学习方法。
- HTML required
- xcode10关于clang -lstdc++.6.0.9报错问题
- Linux rpm包安装不了
- Linux下clock计时函数学习【转】
- django 视图函数返回queryset对象或日期对象至浏览器ajax接收的写法
- mongo 删除内嵌数组元素
- java-信息安全(十二)-数字签名【Java证书体系实现】
- BAT-显示桌面图标
- 在UNITY中按钮的高亮用POINT灯实现,效果别具一番风味