且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Django Nonrel - 无法登录到开发服务器上的管理面板

更新时间:2021-08-04 21:23:44

我有一个在Windows中工作的解决方法vista

I have a workaround that is working in windows vista

#change the manage.py code to:
if __name__ == "__main__":

 print "lets go...."

    execute_manager(settings)


    import os

    from google.appengine.tools import dev_appserver
    #from view.PresetsPage import DuplicatePresetGroup
    print "flushing database ..."
    dev_appserver.TearDownStubs()

并运行

python manage.py syncdb

毕竟您应该可以在磁盘上找到数据存储文件。

after all you should be able to find the 'datastore' file on your disk.

在views.py add:

in views.py add:

def stopAll (request):
    import os
    if os.environ.get('SERVER_SOFTWARE','').startswith('Development'):
        from google.appengine.tools import dev_appserver

        dev_appserver.TearDownStubs()
    return HttpResponse("completed !")

和urls.py文件中的相应条目。

and and the corresponding entry in urls.py file.

(r'^stop/$', stopAll),

输入

localhost:8080/stop/ 

时间您要刷新数据存储到文件

each time you want to flush the datastore to file