-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manage.py error in SDK 1.9.17, old_dev_appserver removed #95
Comments
Me too. |
I commented out most of setup_local_stubs() function, and somehow it seems to work fine. Admittedly, I don't really understand all the details. |
I'm having the same problem. Is it possible to downgrade our development server? Will this cause any issues when we deploy to the cloud? |
I've downgraded the SDK for my current developments. I don't think you'd get issues deploying on GAE, I haven't tried, but you can safely deploy a new version, while your default (prod) version won't be affected. |
Like I said, I'm using the latest version of the SDK with the djangoappengine devappserver2 branch, and it works fine as long as I comment out some lines of code in db/stubs.py as follows:
|
Great thank you both. For some reason I wasn't able to get |
I updated the devappserver2 branch to fix this issue. Please give it a try and let me know if it works. You can find it in this pull request: #77. I'll merge it once I get a couple of confirmations that its working. Its becoming more difficult to support older versions of the SDK. So I may remove support for the old dev_appserver, now that its out of the SDK. If you still use an old SDK for some reason, let me know. |
@aburgel - I just tested the devappserver2 branch and the startup errors were gone and my app seemed to function correctly. Unfortunately, Thanks for all your work! |
@aburgel : almost same thing here. The small things I noticed :
Thanks for all too :) |
the new devappserver changes how the database is managed. previously, you could startup django, open the database and make some changes, and then when django launched the appserver it would reuse the same database connection. now the new devappserver manages its own database connection, so you need to ensure that django is talking to the same db file, which is a bit complicated because devappserver will sometimes store the database in a temp directory. i'm still trying to wrap my head around it, so i don't know what the best way to approach the problem is yet. |
When I run manage.py tests, I get this exception: NeedIndexError: This query requires a composite index that is not defined. The suggested index for this query is: - kind: django_content_type
I did not get this error before. Is something in the latest update not ᐧ On Tue, Dec 16, 2014 at 10:42 AM, Alex Burgel [email protected]
|
So in stubs.activate_test_stubs, if I add root_path=PROJECT_DIR to self.testbed.init_datastore_v3_stub(datastore_file=datastore_path, Should root_path be added back? On Wed, Dec 17, 2014 at 9:18 AM, Jacob Gur [email protected] wrote:
|
I have another issue when running
It then prints the result :
But nothing is written in the local database. |
@aburgel : I'm trying a GAE multiple-modules architecture (with multiple Django), maybe the simpler would be to add a DATABASES = {
'default': {
'ENGINE': 'djangoappengine.db',
'DEV_APPSERVER_OPTIONS': {
'use_sqlite': True,
'datastore_path': '[path]'
},
}
} I tried to manually set |
(sorry, closed accidentally) |
Another thing, I don't know if I did a mistake but when my app's entry point is : # main.py
from djangoappengine.main import application I get this error :
I fix it this way : # main.py
from django import conf # tmp debug
from djangoappengine.main import application but I don't really understand why. |
@jacobg |
@Philoozushi does this mean you can't run your app in production? because i think djangoappengine.main is the entry point is used in production |
@aburgel root_path is one of the named parameters of datastore_file_stub.DatastoreFileStub, which is called by init_datastore_v3_stub. Adding it fixed the NeedIndexError I was getting. You don't get that error when running a unit test? Try require_indexes to True. |
@jacobg I've been using sqlite which uses |
I'm also using datastore_path, but it's set to outside my project directory. root_path is for index.yaml. Are you saying that if datastore_path is where index.yaml is, then GAE derives that as well? |
Yeah, I don't think the local stubs has been updated to work with the latest SDK version which removed the old devappserver. @aburgel Can you help us here please? Thanks! |
Regarding my last two comments, see the following new issue I created to address it. It includes patch fix: |
Hi everyone, After switching to devappserver2 the app(s) works fine again, but it is slower. It looks like models are validated on each request (Even many times per request).
|
Hi @interpegasus, |
Sorry @aburgel, I missed your last mention. But I just tried to remove it, and now it works well too, locally, and on production! |
@Philoozushi Thanks for confirming the same configuration, works fine for you.
Thanks again! |
Hey guys, after updated appengine sdk to 1.9.18(or 17), and applying all the fixes and patches here, I can't seem to get syncdb to create a superuser and access the admin section Regarding @jacobg's #97, I realized that the datastore_path is I'm now wondering if there are issues with syncdb or any other datastore related devappserver operations since this problem only occurs on a fresh project. Using a pre-existing .gaedata/datastore with the initial admin and auth models built did not throw any errors. Haven't played around enough to identify any issues, but having the I recognize this as low priority if this only impacts the dev environment, not production...but I hope to get some feedback on this hack-y patch. Are all the imports in db/stubs.py for dev_appserver_*.py all related to the old_dev_appserver? |
@GxelA from the logs it seems you have not migrated over to using devappserver2.py since the new SDK, old_dev_appserver.py has been removed. I would recommend pulling from the devappserver2 branch and following the patches above to see if that fixes things |
With the new SDK 1.9.17, manage.py now raises an error : (on branch
master
)With branch
devappserver2
, it says :The text was updated successfully, but these errors were encountered: