Anyone have it running on GAE?

358 views
Skip to first unread message

Tom Brander

unread,
Mar 7, 2012, 9:07:00 AM3/7/12
to mezzani...@googlegroups.com
A while back there was some activity to get Mezzanine running on GAE, did it happen?

Josh Cartmell

unread,
Mar 7, 2012, 1:00:17 PM3/7/12
to mezzani...@googlegroups.com
I don't know of anyone that is doing it, but between this:
http://www.allbuttonspressed.com/projects/django-nonrel
and this:
http://code.google.com/appengine/articles/django-nonrel.html
it may be possible.  I would guess that you would run into snags, but if you want to give it a try and see what happens I know we would appreciate it.

Stephen McDonald

unread,
Mar 7, 2012, 2:58:23 PM3/7/12
to mezzani...@googlegroups.com
A guy from App Engine recently got in touch with me offering to help make sure it deploys cleanly. I told him it probably wouldn't work as Mezzanine's highly relational in its data model, but he told me Django is now first class on App Engine thanks to their "Cloud SQL" (which is just their MySQL offerring).

https://developers.google.com/cloud-sql/docs/django

So I'm planning to try it out as soon as I have some time, but it shouldn't be far off working if it doesn't work yet.

--
Stephen McDonald
http://jupo.org

Matt Cooper

unread,
Mar 12, 2012, 6:33:33 PM3/12/12
to Mezzanine Users
Hi Stephen.

First up just found Mezzanine and like the look of it. I am very
interested in whether it runs on App Engine.
As your contact from Google pointed out the Google cloud SQL service
means you can run Django natively which works fine.

So I'm guessing as long as you include all the necessary files in your
app it should work as long as the project is all pure python.. You
don't need to include the Django files as you include it in the
libraries section of app.yaml

As I said I'm new this so am unsure which files to include, will give
it a go.

Only slight cloud on the horizon (no pun intended) is that we don't
know how much the Google SQL offering will be as it's still in beta.
Good news is that it's vanilla mysql and it's also replicated
automatically.

Matt

On Mar 7, 7:58 pm, Stephen McDonald <st...@jupo.org> wrote:
> A guy from App Engine recently got in touch with me offering to help make
> sure it deploys cleanly. I told him it probably wouldn't work as
> Mezzanine's highly relational in its data model, but he told me Django is
> now first class on App Engine thanks to their "Cloud SQL" (which is just
> their MySQL offerring).
>
> https://developers.google.com/cloud-sql/docs/django
>
> So I'm planning to try it out as soon as I have some time, but it shouldn't
> be far off working if it doesn't work yet.
>
>
>
>
>
> On Thu, Mar 8, 2012 at 5:00 AM, Josh Cartmell <joshcar...@gmail.com> wrote:
> > I don't know of anyone that is doing it, but between this:
> >http://www.allbuttonspressed.com/projects/django-nonrel
> > and this:
> >http://code.google.com/appengine/articles/django-nonrel.html
> > it may be possible.  I would guess that you would run into snags, but if
> > you want to give it a try and see what happens I know we would appreciate
> > it.
>

Stephen McDonald

unread,
Mar 12, 2012, 6:38:58 PM3/12/12
to mezzani...@googlegroups.com

From what I've been told it should work out of the box. I'm sure there will be some minor issues, in which case I'm very keen to resolve. Trying this out is very high on my todo list, just need to find the time :-)

Matt Cooper

unread,
Mar 12, 2012, 6:58:33 PM3/12/12
to mezzani...@googlegroups.com
Hi Stephen

Yes should just be a case of making sure things like local storage, all other databases etc are not being called, things that GAE won't like.
SQL wise it should be fine I'm guessing.

I will start learning about Mezzanine and have a go but am guessing it will be done by the time I get there. 
Looking forward to testing it out.

Matt

Stephen McDonald

unread,
Mar 12, 2012, 7:11:31 PM3/12/12
to mezzani...@googlegroups.com
Cool Matt. 

I'm currently working on upgrading filebrowser-safe (and after that will be Mezzanine/Cartridge) to make sure they use Django's storages API wherever applicable, the end goal being to have Amazon S3 work out of the box.

Matt Cooper

unread,
Mar 18, 2012, 4:24:03 AM3/18/12
to mezzani...@googlegroups.com
Hi Stephen

This sounds great. Maybe a provider for Google Storage would be an idea as well if thinking of GAE?

Great FAQs by the way, I'm still learning about both Django and Mezzanine so really helps.


Matt

Stephen McDonald

unread,
Mar 18, 2012, 4:26:49 AM3/18/12
to mezzani...@googlegroups.com
Sure.

By the way everything's using storages now:


Last step will be moving Cartridge's product images over to FileBrowserFields

Matt Cooper

unread,
Mar 20, 2012, 3:50:03 AM3/20/12
to mezzani...@googlegroups.com
Hi Stephen

Is your new 1.0.5 release ready to go on GAE do you think? Sounds like it is...

Very cool!

Matt

Stephen McDonald

unread,
Mar 20, 2012, 4:45:06 AM3/20/12
to mezzani...@googlegroups.com

Haven't tried it yet but the storages work was aimed at this type of thing.

Miki

unread,
Mar 27, 2012, 9:13:07 AM3/27/12
to Mezzanine Users
OK - I have it working. This is what you have to do:

1) Create a /lib directory under your project root. Create an empty
__init__.py file and copy it under /lib. Copy all libraries required
by your project in /lib (excluding django - referenced in your
app.yaml). This is the content of my /lib:
/lib
/apiclient
/grapelli_safe
/httplib2
/mezzanine
/oauth2client
/PIL
/__init__.py
/base.py
/gflags.py
/gflags_validators.py

2) Create the file fix_path.py and copy it to the root directory of
your project. Content of the file:

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))


3) Change the content of the file settings.py located in your project
root directory. You have to reference fix_path.py. Add:

import fix_path

4) In addition, change the ROOT_URLCONF located in settings.py:

#ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME
ROOT_URLCONF = "urls"


5) Follow the steps described here:

https://developers.google.com/cloud-sql/docs/django


I had terrible problems authenticating my local machine for accessing
my Google Cloud instance remotely. I end up copying my database schema
directly into Google Cloud.

You'll have to spend some time re-arranging all the static files and
directories accessed by your application.


Miguel




On Mar 20, 4:45 am, Stephen McDonald <st...@jupo.org> wrote:
> Haven't tried it yet but the storages work was aimed at this type of thing.

Tom Brander

unread,
Mar 27, 2012, 1:15:38 PM3/27/12
to mezzani...@googlegroups.com
Nice work... Can you be more precise on the static issues/Placement?


Stephen McDonald

unread,
Mar 27, 2012, 4:06:22 PM3/27/12
to mezzani...@googlegroups.com
Fantastic. Thanks so much for posting the howto, I will definitely give it a spin soon.

Miki

unread,
Mar 27, 2012, 4:29:04 PM3/27/12
to Mezzanine Users
I have a /static folder where I copied over all the static files
required by my application.

I reference /static in my app.yaml file:

handlers:
- url: /static
static_dir: static

My /static folder structure:

/static
/admin
/css
/base.css
/changelist.css
/changelists.css
/dashboard.css
/documentation.css
/forms.css
/login.css
/modules.css
/reset.css
/rtl.css
/tables.css
/typography.css
/webkit-gradients.css
/widgets.css
/img
/admin
(...)
/icons
(...)
/grapelli-icon.png
/icon_calendar.gif
/icon_clock.gif
/js
/admin
/relatedObjectLookups.js
/actions.min.js
/core.js
/jquery.init.js
/jquery.min.js
/widget.css
/css
/bootstrap.css
/dashboard.css
/mezzanine.css
/grappelli
(... all grapelli static goes here)
/js
/bootstrap.js
/bootstrap.min.js
/jquery1.7.1.js
/media
/products
/uploads
/mezzanine
/css
/admin
/dashboard.css
/global.css
/editable.css
/img
/loadingAnimation.gif
/js
/admin
/collapse_backport.js
/dynamic_inline.js
/keywords_field.js
/login.js
/navigation.js
/editable.js
/jquery.form.js
/jquery.tools.js
/jquery-1.7.1.min.js
/jquery-ui-1.8.14.custom.min.js
/tinymce_setup.js

It is not very elegant I know. There's probably a way of referencing
all static directories of the project, probably setting several
entries in the app.yaml file, but I didn't have the time to
investigate how to do it. If somebody has a better way of doing this,
please post it here - I'm very interested.

Miguel

Adam S

unread,
Sep 23, 2015, 2:37:27 PM9/23/15
to Mezzanine Users

its been awhile - are there any updates on this issue?

I am thinking about django-nonrel and using the google datastore and google colud sql  at same time ...

Any thoughts?

Thanks!

Tom Brander

unread,
Sep 25, 2015, 10:39:28 AM9/25/15
to Mezzanine Users
I'm looking t it again.. GAE has changed somewhat and seems to like git push for deploy.. and it seems to me that the Cloud SQL is the way to go. 
So the issues are setting up a virtual env, git repo and using the local dev server (there are some hints on the internet for this) and then deploying, roughly.. direct use of  the Google datastore (except for static/media..) could probably be a bit of additional complication.

Not sure how fast I'll get going, been thinking about it more than doing it....on the other hand the reason I saw this, was looking up the current state before starting...

All in all the current Google docs are not too helpful, but it "should" be doable...

Tom Brander

unread,
Sep 25, 2015, 11:24:43 AM9/25/15
to Mezzanine Users
My notes so far (may help some)

Using Vitrual env

with env active:

pip install mysql-python


use:

http://ze.phyr.us/appengine-virtualenv/

(gaemezz)tom@tom-sam:~/gaemezz1$ linkenv

Note the path to find the env site packages

~/.virtualenvs/gaemezz/lib/python2.7/site-packages gaenv


On each virtual env activation

export PATH=$PATH:~/google_appengine


dev_appserver.py



Adam S

unread,
Sep 25, 2015, 11:57:16 AM9/25/15
to Mezzanine Users

Hi Tom,

I have decided to give it a try - we really need the full CMS features, and I would like them to be integrated, and i don't want to give up on app engine yet.

Cloud SQL seems to be necessary - there is a free trial, as you probably know.

I am using djangoappengine and am going to try to setup two databases - the Datastore and CSQL with the sql setup per the google instructions, which includes setting up a local sql server for dev.

One question for you: Not sure why you need to use the virtual environment. As far as I can tell, the third party libraries all need to be uploaded with the app? It would save a lot of trouble if that was not the case.

Here goes nothing - I will report back.

Thanks,

Adam


Tom Brander

unread,
Sep 25, 2015, 1:55:37 PM9/25/15
to Mezzanine Users
The virtual env will ensure that you only upload the requirements within  the env, not all your installed libs... (as far as I know) I did not see the free trial of cloud sql, I have a WordPress install using the cloud SQL and it only runs about $4.50 a month it also uses cloud storage for assets and uploaded files.

Don't think you will get anywhere with Django appengine there should be no need for it if you use the cloud sql..

Adam Simon

unread,
Oct 5, 2015, 3:03:10 PM10/5/15
to Mezzanine Users

If you can use the Datastore along with SQL on app engine, you will save a lot of money on projects with lots of data.

A virtualenv has no effect on third party apps in app engine.

Adam Simon

unread,
Oct 12, 2015, 6:20:41 PM10/12/15
to Mezzanine Users

After some investigation, I have concluded that you cannot use Mezzanine 4 on GAE.

The problem is that it depends on future, which has C code in it.  GAE will not run any third party packages with C code.

Please correct if wrong.

Tom Brander

unread,
Oct 20, 2015, 1:30:08 PM10/20/15
to Mezzanine Users
I'm assuming you are right. It is a shame that Google supports Python so poorly.
 
That means that putting it in a container on Google (still using cloud sql) is the way to go, ughh now need to figure that out!
Reply all
Reply to author
Forward
0 new messages