django-nonrel

How to use static files with django nonrel

a 夏天 提交于 2020-01-22 11:23:27
问题 I'm trying to use the Django nonrel project for google app engine. I setup the test project as described here. I added a new folder to the project named "static" for my static files. And for the app.yaml file i added the lines; - url: /static static_dir: static I can't reach my static files. Do i have to do additional configuration? Thx in advance. 回答1: app.yaml have nothing to do with Django, but it does configures App Engine front-end. The answer depends on whether you want to serve static

How to convert django ManyToManyField into Django-nonrel Field?

回眸只為那壹抹淺笑 提交于 2020-01-14 02:16:07
问题 I build an app in django, but since I found out that google app engine doesn't support Django out of the box (free,cloud sql can't be used for free right?). I decided to move to Django-nonrel, so there are few datebase Field that need converting, and I don't know how: class Cate(models.Model): name = models.CharField(max_length = 100) description = models.TextField() create_by = models.ForeignKey(User) create_date = models.DateTimeField('cate created date') def __unicode__(self): return self

Django App Engine: AttributeError: 'AnonymousUser' object has no attribute 'backend'

瘦欲@ 提交于 2020-01-13 09:09:34
问题 I am using djangoappengine. When I try create a new user, authenticate that user, and log them in, I get the following error AttributeError: 'AnonymousUser' object has no attribute 'backend' . My code is simple and looks like: user = User.objects.create_user(username, username, password) user.set_password(password) user.save() user = django.contrib.auth.authenticate(username=username, password=password) django.contrib.auth.login(request, user) I only get the following error on production and

Google App Engine bulkloader issue when using yaml autogenerated configuration and entities with numeric ID

坚强是说给别人听的谎言 提交于 2020-01-12 23:43:59
问题 My application uses Django non-rel. I don't have access to model. I have my bulkloader.yaml file autogenerated by appcfg.py create_bulkloader_config . Problem is entities numeric ID's are being imported as string key names. So if I export entity with int ID of, for example, '62' , it gets imported as entity with string key name of '61' which screws up Django. Revelant bulkloader.yaml Fragment: property_map: - property: __key__ external_name: key export_transform: transform.key_id_or_name_as

How can I loaddata from a fixture remotely

橙三吉。 提交于 2020-01-03 19:30:34
问题 With Django-nonrel on GAE, how do I do I load in a fixture to the server after deploying? I'm able to do it locallay via python manage.py loaddata fixturename But how can I do it on a deployed app that is already on appspot.com? 回答1: I believe the answer is python manage.py remote loaddata fixturename with an additional 'remote' word. I've tested that (about five minute before I type this). It will prompt for your gmail account and password. You also need to enable remote_api in app.yaml (if

Django nonrel Query confusion

可紊 提交于 2020-01-03 04:29:06
问题 I'm creating a practice django-nonrel project hosted on Google AppEngine to get some familiarity with Django and the AppEngine Platform, but am running into a perplexing query issue. Here is my models.py: class Character(models.Model): name = models.CharField(max_length=200) url_name = models.CharField(max_length=200) def save(self, *args, **kwargs): self.url_name = self.name.replace(" ", "-").lower() super(Character, self).save(*args, **kwargs) # Call the "real" save() method. def __unicode_

appengine improperly configured database error when trying to send mail (using django_bootstrap)

心不动则不痛 提交于 2019-12-25 05:15:00
问题 I am using django_bootstrap.py there are similar errors but i could not find solution to it. I am using django helper(please do not suggest non-rel) What i was trying to do was, inside a static html js website attaching a feature of sending mail, through a contact form. The form would take the data, and jQuery would validate and make a POST AJAX request to the url "/sendmail/" the views.py i have the following code: def sendmail(request): logging.info("here1") msg = request.POST['comment'];

django-nonrel 500 server error on Google App deployment

梦想与她 提交于 2019-12-24 16:19:42
问题 I am a newbie with a problem working with Django-nonrel on Google App Engine. I created a new app called "helloapp". 1) I have created a view in views.py called hello world: from django.http import HttpResponse def hello(request): return HttpResponse("Hello world") 2) I have then linked to it in the urls.py using: from django.conf.urls.defaults import * from helloapp.views import hello urlpatterns = patterns('', (r'^hello/$',hello), ) This works fine locally, but on live I am getting 500

Django-nonrel: Syntax to Reset an App

☆樱花仙子☆ 提交于 2019-12-24 11:16:34
问题 To reset my app, I ran this: ./manage.py reset node It is giving me this error output: WARNING:root:The rdbms API is not available because the MySQLdb library could not be loaded. Traceback (most recent call last): File "./manage.py", line 11, in <module> execute_manager(settings) File "/home/a/mywebsites/django/seperolinux/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/home/a/mywebsites/django/seperolinux/django/core/management/__init__.py", line

Data gets corrupted on form send, =\r\n introduced in the data every 75 characters?

扶醉桌前 提交于 2019-12-23 23:01:17
问题 I'm working on a project in Django nonrel, on Google App Engine, though I have a feeling my problem has nothing to do with either of these directly . I have a hidden field in one of the models that is defined like so: models.CharField(max_length=400, null=True, blank=True,default="{}") The field is meant to receive JSON data from a widget in my admin, and in the client its value changes properly. (Which data is being sent is irrelevant to my problem - whatever string is in the field value is