1177<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1177> def runserver(addr, port, use_reloader=True, admin_media_dir=''): 1178<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1178> "Starts a lightweight Web server for development." 1179<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1179> from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException 1180<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1180> from django.core.handlers.wsgi import WSGIHandler 1181<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1181> if not addr: 1182<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1182> addr = '127.0.0.1' 1183<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1183> if not port.isdigit(): 1184<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1184> sys.stderr.write(style.ERROR("Error: %r is not a valid port number.\n" % port)) 1185<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1185> sys.exit(1) 1186<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1186> quit_command = sys.platform == 'win32' and 'CTRL-BREAK' or 'CONTROL-C' 1187<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1187> def inner_run(): 1188<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1188> from django.conf import settings 1189<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1189> print "Validating models..." 1190<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1190> validate() 1191<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1191> print "\nDjango version %s, using settings %r" % (get_version(), settings.SETTINGS_MODULE) 1192<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1192> print "Development server is running at http://%s:%s/" % (addr, port) 1193<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1193> print "Quit the server with %s." % quit_command 1194<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1194> try: 1195<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1195> handler = AdminMediaHandler(WSGIHandler(), admin_media_path) 1196<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1196> run(addr, int(port), handler) 1197<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1197> except WSGIServerException, e: 1198<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1198> # Use helpful error messages instead of ugly tracebacks. 1199<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1199> ERRORS = { 1200<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1200> 13: "You don't have permission to access that port.", 1201<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1201> 98: "That port is already in use.", 1202<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1202> 99: "That IP address can't be assigned-to.", 1203<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1203> } 1204<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1204> try: 1205<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1205> error_text = ERRORS[e.args[0].args[0]] 1206<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1206> except (AttributeError, KeyError): 1207<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1207> error_text = str(e) 1208<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1208> sys.stderr.write(style.ERROR("Error: %s" % error_text) + '\n') 1209<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1209> sys.exit(1) 1210<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1210> except KeyboardInterrupt: 1211<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1211> sys.exit(0) 1212<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1212> if use_reloader: 1213<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1213> from django.utils import autoreload 1214<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1214> autoreload.main(inner_run) 1215<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1215> else: 1216<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1216> inner_run() 1217<http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/core/management.py?rev=11354#L1217> runserver.args = '[--noreload] [--adminmedia=ADMIN_MEDIA_PATH] [optional port number, or ipaddr:port]'
2009/8/12 dongua <dongu...@gmail.com> > after i download ] > http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/utils/_os.py > > and runserver: > > Development server is running at http://127.0.0.1:8000/ > Quit the server with CTRL-BREAK. > Unhandled exception in thread started by <function inner_run at 0x00C1B870> > Traceback (most recent call last): > File "D:\Python25\Lib\site-packages\django\core\management.py", line > 1195, in > inner_run > handler = AdminMediaHandler(WSGIHandler(), admin_media_path) > NameError: global name 'admin_media_path' is not defined > > 2009/8/11 Russell Keith-Magee <freakboy3...@gmail.com> > > >> On Tue, Aug 11, 2009 at 8:37 PM, dongua<dongu...@gmail.com> wrote: >> > >> > /django/core/servers/basehttp.py >> > code: >> > from django.utils._os import safe_join >> > >> > but there does not has any _os.py in pacakge, and after install 0.96.4 >> > will can't runserver >> >> It appears that the security fix that was committed in r11354 was >> missing a file. I have committed the missing file in r11430. >> >> As a temporary workaround, you can download the missing file >> (django/utils/_os.py) from the Django source code browser [1]. If you >> drop this file into the django/utils directory wherever you have >> installed Django, you will be able to run the development server >> again. >> >> A new release that includes this missing file will be made in the near >> future (time permitting, within a few days). >> >> I deeply apologize for any inconvenience this has caused. >> >> [1] >> http://code.djangoproject.com/browser/django/branches/0.96-bugfixes/django/utils/_os.py >> >> Yours, >> Russ Magee %-) >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---