django-nonrel

ListField with ForeignField in django-nonrel

我的梦境 提交于 2019-12-13 02:18:57
问题 It seems hard to find a complete example of using ListField with ForeignField in django-mongo-engine.. my logic looks like below, class GameSession(models.Model): # id => token, is global unique random code id = models.CharField(max_length=45, primary_key=True) def save(self, *args, **kwargs): if not self.pk: self.pk = util.get_random_string(32) super(GameSession, self).save(*args, **kwargs) class GameUser(models.Model): ... game_session = fields.ListField(models.ForeignKey(GameSession)) in

import error using djangorestframework with django-nonrel

怎甘沉沦 提交于 2019-12-13 02:11:29
问题 I'm working on a Django-nonrel project using Django-rest-framework and I've run into the following error after following the instructions in the Token Authorization section of their Authorization API Guide: ImportError: No module named rest_framework.authtoken Normally I would just assume that this is something to do with my PYTHONPATH but I don't think that's exactly what the problem is because I can import this framework from both IDLE and the project's shell run using manage.py, the latter

Django-nonrel using ListField containing EmbeddedObjects in the admin

我的梦境 提交于 2019-12-12 17:14:21
问题 I've been trying hopelessly to get this to work. I have a model that contains a ListField of EmbeddedObjects, basically it's an Item in an auction that contains a list of bids within it. Typycal MongoDB approach. I understand that ListField doesn't show up in the admin since it doesn't know what Widget to display, it could be a list of anything. That makes sense. I've created a fields.py in my app folder and subclassed ListField and I'm now using this in my models.py My question is: How do I

Django signals on GAE with django-nonrel

↘锁芯ラ 提交于 2019-12-12 01:26:38
问题 I am using django-nonrel for my project on GAE. My requirement is that in my application at a time only one user should login with the given username. I tried to implement the following suggested approaches: Allow only one concurrent login per user in django app and How can I detect multiple logins into a Django web application from different locations? But the problem is that both of the approaches working on the development server but didn't work on google app engine. So I switched to

Unable to save django-toolbox ListField to database using django admin view

核能气质少年 提交于 2019-12-11 15:04:43
问题 I am writing a django-nonrel based app and using admin view functionality provided by Django. I want a Many-to-many relationship between two models and for this, I am using ListField found inside djangotoolbox.fields To provide a custom form field, I have overridden ListField with another class ModelListField as described in this question which overrides formfield function to return a MultipleChoiceField form widget. The view part works fine but I am unable to save the model using sqlite3

Django App Engine can't find antlr3 module

我们两清 提交于 2019-12-11 09:12:00
问题 I'm trying to set up a Django app to run on GAE, and am using the on_production_server test to choose between dev vs. production settings in settings.py. However, when I run python manage.py runserver I get: Traceback (most recent call last): File "manage.py", line 11, in <module> import settings File "/home/guillaume/myproject/settings.py", line 10, in <module> from djangoappengine.utils import on_production_server, have_appserver File "/home/guillaume/myproject/djangoappengine/utils.py",

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

柔情痞子 提交于 2019-12-11 07:22:31
问题 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? 回答1: UPDATE - turn off the server, run python2.5 manage.py

AppConfigNotFoundError for dev_appserver.py on Django-nonrel and Google App Engine

本小妞迷上赌 提交于 2019-12-11 03:52:14
问题 I'm trying to clear my local db like explained in the docs But when I try and run the dev_appserver.py --clear_datastore command I get google.appengine.tools.dev_appserver.AppConfigNotFoundError dev_appserver.py --clear_datastore dennys Traceback (most recent call last): File "/usr/local/bin/dev_appserver.py", line 76, in <module> run_file(__file__, globals()) File "/usr/local/bin/dev_appserver.py", line 72, in run_file execfile(script_path, globals_) File "/Applications

Handle Form Failure when uploading to Appengine Blobstore

限于喜欢 提交于 2019-12-11 02:13:19
问题 I'm using @wkornewald 's django-nonrel and django-filetransfer on Google App Engine. I'm able to upload files just fine, but only when the entire form is valid. If the form fails validation for any field, it completely blows up instead of returning to the user to fix the changes. error message is: INFO 2011-03-10 20:27:09,496 dev_appserver.py:535] Internal redirection to /admin/rr/member/add/ INFO 2011-03-10 20:27:09,662 dev_appserver_blobstore.py:328] Upload handler returned 200 ERROR 2011

Django-nonrel can't login as super user

久未见 提交于 2019-12-08 06:39:49
问题 I"ve done such commands python manage.py createsuperuser If I do python manage.py runserver In this case I can login, and I can see the user I created. While if I use GAE's SDK to start the server, I canNOT log in. Why? 回答1: This might be the problem: You have setup a database for a normal django project. So manage.py createsuperuser will create a superuser in that database. In case of GAE SKD, it uses the GAE Datastore , so the superuser you created is not present there. This is what you