开发者

Python/GAE social network / cms?

开发者 https://www.devze.com 2023-01-16 02:09 出处:网络
After much research, I\'ve come up with a list of what I think might be the best way of putting together a Python based social network/cms, but have some questions about how some of these components f

After much research, I've come up with a list of what I think might be the best way of putting together a Python based social network/cms, but have some questions about how some of these components fit together.

Before I ask about the particular components, here are some of the key features of the site to be built:

  • a modern almost desktop-like gui
  • future ability to host an advanced html5 sub-application (ex.http://www.lucidchart.com)
  • high scalability both for functionality and user load
  • user ability to password protect and permission manage content on per item/group basis
  • typical social network features
  • ability to build a scaled down mobile version in the future

Here's the list of tools I'm considering using:

Google App Engine

Python Django Pinax Pyjamas wxPython

And the questions:

  1. Google App Engine -- this is an attempt to cut to the chase as many pieces of the puzzle seem to be in place. Question: Am I limiting my options with this choice? Example: datastore not being relational? Should I wait for SQL support under the Business version?

  2. Python -- I considered 'drupal' at first, but in the end decided that being dependent on modules that may or may not exist tomorrow + limitations of its templating system are a no-no. Learning its API, too, would be useless elsewhere whereas Python seems like a swiss army knife of languages -- good for almost anything. Question: v.2.5.2 is required by GAE, but python.org recommends 2.5.5. Which do I install?

  3. Django -- v.0.96 is built into GAE. You seem to be able to upgrade it. Questions: Any reason not to upgr开发者_如何转开发ade to the latest version? Ways to get around the lack of HTML5 support?

  4. Pinax (http://pinaxproject.com) Rides on top of Django and appears to provide most of the social network functionality anyone would want. Question: Reasons NOT to use it? Alternatives?

  5. Pyjamas and wxPython -- this is the part that gets a little confusing. The basic idea behind these is the ability to build a GUI. I've considered Silverlight and Flash, before the GAE/Python route, but a few working versions of HTML5 apps convinced me that enough of it ALREADY runs on the latest batch of browsers to chose the HTML5/Javascript route instead. Question: How do I extend/supplement Python/Django to build an app-like HTML5 interface? Are Pyjamas and wxPython the way to go? Or should I change my thinking completely?

Answers to some/any of these questions would be of great help. Please excuse my ignorance if any of this doesn't make much sense. My last venture into web programming was a decent sized LAMP website some 5-6 years ago. On the desktop side of things, my programming experience boils down to very high level scripting languages that I keep on learning to accomplish very specific tasks :)


As someone who has deployed a Django site to GAE, I can tell you that you are not going to reach the ideal solution. Django on GAE misses some of the best aspects of Django because the ORM doesn't work right. The best compromise may be to use Django-nonrel to add the features back in.

This introduces it's own problems though: because of the large number of files and memory used by a Django app you're code will be unloaded from memory quickly after the app becomes idle. That means that visitors will frequently hit an approximately 6 second delay on the first page view after the site's code has been unloaded from memory while GAE uncompresses the zipped modules. Once your site is busy this won't be a problem, but while your site is still young and unknown it will cause the appearance of performance problems. :-(

Second, I've also worked for a company that built a custom CMS and can tell you that the first 80% is pretty easy, especially with modern frameworks. However, the rest can be quite challenging. For example, user roles and custom content types are two challenging aspects. Therefore strongly consider standing on the backs of giants and finding a CMS or CMS framework that almost perfectly meets your needs and then extend it to do that extra bit you need.

So, that said, answering your points:

  1. Yes, you're limiting your options but that may be OK. Most developers are more comfortable with the relational model than the nosql model. Therefore more open source software is built with it in mind. Also, GAE is a closed source platform which is also a deterrent to open source developers. App Engine Oil is a CMS framework that may suit you well and is optimized for App Engine. Also look at web2py which has support for GAE.

  2. I've found myself to be extremely productive with Python. I used to write a lot of PHP now I find it ugly. That said, think about the total line count of code you'll have to write. If you can make Drupal work with high quality pre-made modules you may find yourself only needing 1/10th of the code. By the way, the trick with Drupal is to mainly use only high quality modules. Look at the history, make sure not to use development versions. Try to contact the authors on IRC. I'm not saying you should use Drupal but it is possible to have a reliable site with it (for example, whitehouse.gov)

  3. You're in the classic GAE/Django problem. If you use 0.96 you get great performance but you miss a lot of the great 1.0+ features and you don't get the ORM and all of it's benefits. If you use a newer version of Django you get the performance/memory problems mentioned above.

  4. I'm about to investigate pinax for my company. I've done a very cursor glance at it. I don't know if it has good support for non relational model backends. You'll probably need to look at django-nonrel. However know that you're going to be investing in relatively untried solutions here. A small percentage of Django users use Pinax and an even smaller percentage, if any, use it on a nonrelational backend. Therefore you're going to be in the highly experimental scenario you mentioned in point 2 above.

  5. I can't offer personal experience on it. I've investigated pyjamas a few times. However I like writing HTML CSS and JS. I like to have control. I like progressive enhancement and knowing what users will see if they don't have the full capabilities. Also, I think any new app that doesn't explicitly address mobile clients is implicitly shooting themself in the foot. As many as 15% of Internet users only use the Internet via their smart phone. What kind of experience will they get with pyjamas?

  6. You didn't mention this, but one thing I consider when choosing a platform is vendor lockin and portability. If you develop your solution for GAE and find that you're not able to do what you want, will you be able to port it to another solution elsewhere? How much work will it take? If you code heavily for GAE or make commitments to its architecture, you're stuck with it or with rewriting to move. Using Django or Web2py can help mitigate this.

That said, the big benefit of Python GAE is that you get to be very productive, see your results instantly, get hosting for free while your site is small and get excellent scalability. These are not small things. There is great value there.

0

精彩评论

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