DizzyDoo
DizzyDoo

Reputation: 1489

Django Nonrel - Can't log into Admin Panel on development server

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?

Upvotes: 1

Views: 1419

Answers (2)

au1
au1

Reputation: 11

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

Upvotes: 1

Neil McCarthy
Neil McCarthy

Reputation: 11

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.

Upvotes: 1

Related Questions