3

我试图安装在 github 上找到的 django_quiz 应用程序。

https://github.com/tomwalker/django_quiz

正如您在下面看到的,我已经安装了所有要求。但是没有manage.py。我如何启动和运行项目?

Things I did >

Cloned the repo with git clone https://github.com/tomwalker/django_quiz.git.

Run --> pip install -r requirements.txt. 

Run --> python setup.py install

Added 'quiz', 'multichoice', 'true_false', 'essay' to INSTALLED_APPS setting.

Added url(r'^q/', include('quiz.urls')),  to urls.py.

注意:我是 Django 的初学者。请帮我。我有点卡在这里。

Django 版本:1.6.5

Installed c:\python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg
Processing dependencies for django-quiz-app==0.5.1
Searching for Pillow==2.5.0
Best match: Pillow 2.5.0
Adding Pillow 2.5.0 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for Django==1.6.5
Best match: Django 1.6.5
Adding Django 1.6.5 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for django-model-utils==2.0.3
Best match: django-model-utils 2.0.3
Adding django-model-utils 2.0.3 to easy-install.pth file

Using c:\python27\lib\site-packages
Finished processing dependencies for django-quiz-app==0.5.1

C:\Users\Vaisakhan\django_quiz>python manage.py runserver
python: can't open file 'manage.py': [Errno 2] No such file or directory
4

2 回答 2

0

创建一个 manage.py 文件并将其存储在文件结构的顶部文件夹中。将 mysite 替换为包含 django 测验代码的文件夹。

import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)
于 2016-02-28T09:22:18.733 回答
0

我认为这个 repo 遗漏了一些步骤。我认为步骤应该如下:

  1. pip install virtualenv (如果你确定不会出现任何依赖错误,可以跳过这一步和下一步。)
  2. virtualenv ~/quiz_env
    源 ~/quiz_env/bin/activate
  3. 点安装 Django==1.6.5
  4. django-admin startproject quiz_project
  5. navigate to quiz_project/quiz_project, edit setting files
  6. navigate to quiz_project/ and copy all the apps directory ('quiz', 'multichoice',....etc) inside quiz_project along with requirement.txt file
  7. pip install -r requirements.txt
  8. python manage.py syncdb
  9. python manage.py makemigrations
  10. python manage.py migrate
  11. python manage.py runserver
于 2016-02-28T09:37:28.160 回答