1

Bit of a strange one. I've created a super user for django admin for my app, which is just a new django nonrel project with admin enabled. I try and access the /admin whilst running the development server, but when I type in the (correct) username and password it tells me they are not correct.

Deploying the project to Google App Engine, the login works fine. Why would it work fine on Googles servers, but not on the development server?

DizzyDoo
  • 1,489
  • 6
  • 21
  • 32

2 Answers2

1

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()

and run

python manage.py syncdb

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


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 !")

and and the corresponding entry in urls.py file.

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

enter the

localhost:8080/stop/ 

each time you want to flush the datastore to file

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
au1
  • 11
  • 1
1

UPDATE - turn off the server, run python2.5 manage.py syncdb, and add a fresh superuser. Must already have included django.contrib.admin to INSTALLED_APPS

This is not at all the answer. Completely different symptoms. I will try to remember to post here when I figure it out.