简体   繁体   中英

Problems with django deployment

Im trying to deploy my django and I always get one of these erros: (they alternate as I refresh the page)

  • The model Page has already been registered ( its from feincms, but i dont get this on my computer )

  • unable to open database file (the database is sqlite3 and was successfully created with syncdb on the server )

Any ideas on what might be the problem ?

First one is probably because on your local computer you run Django as CGI, or some other "new request - different process" way. So if you registering Page model in every request, it's works because you have single request. But on web server your app is loaded as FCGI or some other way like this, so only first request can be served well (when second request is send, your app tries to register Page model again).

Second one is probably because you have relative path to db file. So if you type

./manage syncdb

in your project dir '/my/project/dir'. Django searches for file in '/my/projec/dir/mydb.sqlite'.

But if you run it in web server, you have different path '/some/http/server/path', so your program is confused.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM