2014-06-24 2 views
1

2 년 전에 시작된 프로젝트에서 시작하여 현재 실행중인 django 버전을 파악하는 데 어려움을 겪고 있습니다. 프로젝트를 만든 사람은 알지 못합니다. 프로젝트를 컴파일한다는 사실을 실제로 알지 못하기 때문에 추측하고 확인할 수 있는지 확신 할 수 없습니다. 나는 this 답변을 찾았지만, 버전이 1.0 이전임을 암시합니다. 그리고 거기서 어디로 가야할 지 잘 모르겠습니다. 추측하고 확인하는 것 외에 버전이 무엇인지 말하는 좋은 방법이 있습니까? 내 manage.py가이전 프로젝트에 대한 django 버전 번호 찾기

import os 
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) 

DEBUG = True 
TEMPLATE_DEBUG = DEBUG 

ADMINS = (
    # ('Your Name', '[email protected]'), 
) 

MANAGERS = ADMINS 

DATABASE_ENGINE = 'sqlite3'   # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
DATABASE_NAME = os.path.join(PROJECT_PATH, 'site.db') # Or path to database file if using sqlite3. 
DATABASE_USER = ''    # Not used with sqlite3. 
DATABASE_PASSWORD = ''   # Not used with sqlite3. 
DATABASE_HOST = ''    # Set to empty string for localhost. Not used with sqlite3. 
DATABASE_PORT = ''    # Set to empty string for default. Not used with sqlite3. 

# Local time zone for this installation. Choices can be found here: 
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
# although not all choices may be available on all operating systems. 
# If running in a Windows environment this must be set to the same as your 
# system time zone. 
TIME_ZONE = 'America/Chicago' 

# Language code for this installation. All choices can be found here: 
# http://www.i18nguy.com/unicode/language-identifiers.html 
LANGUAGE_CODE = 'en-us' 

SITE_ID = 1 

# If you set this to False, Django will make some optimizations so as not 
# to load the internationalization machinery. 
USE_I18N = True 

# Absolute path to the directory that holds media. 
# Example: "/home/media/media.lawrence.com/" 
MEDIA_ROOT = '' 

# URL that handles the media served from MEDIA_ROOT. Make sure to use a 
# trailing slash if there is a path component (optional in other cases). 
# Examples: "http://media.lawrence.com", "http://example.com/media/" 
MEDIA_URL = '' 

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 
# trailing slash. 
# Examples: "http://foo.com/media/", "/media/". 
ADMIN_MEDIA_PREFIX = '/media/admin/' 

# Make this unique, and don't share it with anybody. 
SECRET_KEY = some gibberish 

# List of callables that know how to import templates from various sources. 
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source', 
    'django.template.loaders.app_directories.load_template_source', 
#  'django.template.loaders.eggs.load_template_source', 
) 

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware', 
    'django.contrib.sessions.middleware.SessionMiddleware', 
    'django.contrib.auth.middleware.AuthenticationMiddleware', 
) 

#ROOT_URLCONF = 'site.urls' 
ROOT_URLCONF = 'project.urls' 

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". 
    # Always use forward slashes, even on Windows. 
    # Don't forget to use absolute paths, not relative paths. 
) 

INSTALLED_APPS = (
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.sites', 
    'django.contrib.admin', 
    'project.site', 
) 

#TD_SERVER_PORT = 'tcp:8080:interface=192.168.1.43' 
#TD_BIN_DIR = '/Users/me/django/project/bin' 
TD_WORK_DIR = '/Users/me/td_work' 
TD_COMPACT_MODE = False 
TD_MAX_UPLOAD_RATE = 20 * 1024 
TD_MAX_DOWNLOAD_RATE = 80 * 1024 
#TD_LISTEN_PORT_MIN = 59543 
#TD_LISTEN_PORT_MAX = 59553 
TD_LISTEN_PORT_MIN = 6881 
TD_LISTEN_PORT_MAX = 6891 

# Icecast stream upload settings. 
TD_STREAM_NAME = '[o_o] site.net' 
TD_STREAM_PORT = 8000 
#TD_STREAM_HOST = 'thingie.com' 
#TD_STREAM_PASSWORD = 'poiuyt' 
TD_STREAM_HOST = 'localhost' 
TD_STREAM_PASSWORD = 'qwerty' 
#TD_STREAM_HOST = 'otherthingie.com' 
#TD_STREAM_PASSWORD = 'wopwopwop' 

# CD Ripper 
TD_CD_DIR = '/home/me/td_work/cds' 

입니다

내 settings.py입니다

#!/usr/bin/env python 
from django.core.management import execute_manager 
try: 
    import settings # Assumed to be in the same directory. 
except ImportError: 
    import sys 
    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) 
    sys.exit(1) 

if __name__ == "__main__": 
    execute_manager(settings) 

내 urls.py는 나는 그것이 문제 모르겠어요

from django.conf.urls.defaults import * 
from project.site.models import Syndicator, Torrent 

torrent = { 
    'queryset': Torrent.objects.all(), 
    'extra_context': {'syndicators': Syndicator.objects.all()}, 
} 

torrents = { 
    'queryset': Torrent.objects.all().order_by('-pub_date'), 
    'paginate_by': 25, 
    'allow_empty': True, 
    'extra_context': {'syndicators': Syndicator.objects.all()}, 
} 

urlpatterns = patterns('', 
    (r'^$', 'django.views.generic.list_detail.object_list', torrents, 'home-page'), 

    (r'^feeds/$', 'django.views.generic.list_detail.object_list', torrents, 'feed-list'), 
    (r'^feeds/page(?P<page>[0-9]+)/$', 'django.views.generic.list_detail.object_list', torrents, 'feed-list-page'), 
    (r'^feeds/post/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', torrent, 'feed-post'), 
    (and a lot more patterns), 
) 
+1

더 많은 정보가 필요합니다. 'settings.py','manage.py','urls.py'를 보여주세요. – alecxe

+0

모델을 살펴보십시오. 모델은 내부에'Admin' 클래스를 정의합니까? – pancakes

+0

아니요, 그렇지 않습니다. – BetePersei

답변

1
(virtualenv)~$ python 

>>> import django 
>>> print django.get_version() 
'1.4.1' 
+1

이것은 프로젝트의 버전이 아니라 내 컴퓨터가 실행되는 버전을 알려줍니다. – BetePersei

+0

흠, 간단한 대답은 없습니다. 나는 (장고와 프로젝트 모두) 설정 파일을 보길 권한다 - 장고 개발 중에 많은 변화가 있었다. 예제 URL, 데이터베이스 선언 등으로 표시 – pancakes

0

입니다 정확하게. 데이터베이스 설정은 1.2 이전을 암시하므로 1.1이 정상적으로 작동해야합니다. Django는 이전 버전과의 호환성을 거의 사용하지 않는 경우가 거의 없으므로 (데이터베이스 1은 드문 예외 임) 점 버전 간의 차이가 큰 영향을주지 않아야합니다.

관련 문제