开发者

Differences between Django on AppEngine and Django on my Linux Server?

开发者 https://www.devze.com 2023-03-28 07:46 出处:网络
I am a Django beginner, and I want to make this tutorial as exercise: http://www.joeyb.org/blog/2009/05/28/django-based-blog-on-google-app-engine-tutorial-part-1

I am a Django beginner, and I want to make this tutorial as exercise: http://www.joeyb.org/blog/2009/05/28/django-based-blog-on-google-app-engine-tutorial-part-1

The thing is that this tutorial is for AppEngine, but I want to do the tutorial in my Linux Development machine using a common database.

I have noticed that there are few differences:

In the Models:

from appengine_django.models import BaseModel
from google.appengine.ext import db

class BlogPost(BaseModel):
    title = db.StringProperty()
    uri = db.StringProperty()
    date = db.DateTimeProperty(auto_now_add=True)
    teaser = db.TextProperty()
    teaser_html = db.TextProperty()
    content = db.TextProperty()
    content_html = db.TextProperty()
    tags = db.StringProperty()

These imports are di开发者_运维问答fferent:

from appengine_django.models import BaseModel
from google.appengine.ext import db

If I change this by:

from django.db import models

It will work?

Then I noticed one more reference to AppEngine:

from google.appengine.api import users
from google.appengine.ext.db import djangoforms

What imports should I use here to make this compatible with my Django on my Linux development server?

Best Regards,


AppEngine is not Django. There are ways of getting Django to work (more or less) on AppEngine, but that tutorial is specifically for AppEngine, not Django.

If you want to learn Django, do a Django tutorial. There are enough out there on the web.

0

精彩评论

暂无评论...
验证码 换一张
取 消