0

我正在尝试为需要 Django 的项目编写安装脚本。我正在使用 pip 安装应用程序列表,但是当它到达 Django 时,它说

    You just installed Django's auth system, which means you don't have any superusers defined.  
    Would you like to create one now?

我需要这个脚本是自主的。

是否可以自动回答这个问题或忽略它并稍后设置超级用户?

我的基本 bash 脚本看起来像这样

    #!/bin/bash

    set -eux

    #==================================================#
    # These should be just the server requirements only 
    # !! Exception being scipy for now. pip install not 
    # working
    #==================================================#

    apt-get install -y python postgresql-9.1 apache2 python-setuptools postgresql-server-dev-9.1 postgresql-9.1-postgis postgis python-scipy binutils libproj-dev gdal-bin git

    #==================================================#
    # setup the posgis template for postgresql
    #==================================================#
    GEOGRAPHY=0
    POSTGIS_SQL=postgis.sql

    BLAH BLAH !!!
    Lots of database set up code here

   #==================================================#
   # Setup the python environment
   #==================================================#
   easy_install virtualenv
   easy_install virtualenvwrapper
   easy_install pip

   #==================================================#
   # Pull the catami code from git and install 
   #==================================================#

   mkdir -p /home/catami
   mkdir -p /home/catami/catamiportal
   cd /home/catami/catamiportal
   git clone https://github.com/catami/catami.git
   cd catami

   pip install -r requirements.txt

   python manage.py syncdb

   manage.py runserver 0.0.0.0:8000

我从需求文件中安装 django 感到悲痛。

4

1 回答 1

1

我的错。询问问题的是 syncdb 命令而不是安装。

解决方案是

    python manage.py syncdb --noinput
于 2012-11-06T03:39:20.927 回答