I am going to develop a auto text summarization tool as my FYP. I am going to use Python and it's going to be a web application. Since, there would be no database involved in my tool is it a good idea to use Django? Can anyone recommend any other framework? Thanks.
If there's no database in your application then you presumably won't be using Django's ORM, which is one main reason to use it rather than something lighter.
Having said that, if you're familiar with Django, use Django. If you're not and are looking for a Python web framework, how about something like Flask? The templating module (Jinja2, I think) is a bit more powerful than Django's templates.
It doesn't matter if database is involved or not, but for overall web development, it's an easy to use framework.
Related
I am currently developing my first more complex Web Application and want to ask for directions from more experienced Developers.
First I want to explain the most important requirements.
I want to develop a Web App (no mobile apps or desktop apps) and want to use as much django as possible. Because I am comfortable with the ecosystem right now and don't have that much time to learn something new that is too complex. I am inexperienced in the Javascript World, but I am able to do a little bit of jQuery.
The idea is to have one database and many different Frontends that are branded differently and have different users and administrators. So my current approach is to develop a Backend with Django and use Django Rest Framework to give the specific data to the Frontends via REST. Because I have not that much time to learn a Frontend-Framework I wanted to use another Django instance to use as a Frontend, as I really like the Django Template language. This would mean one Django instance one Frontend, where there would be mainly TemplateViews. The Frontends will be served on different subdomains, while the backend exposes the API Endpoints on the top level domain.
It is not necessary to have a Single Page App. A Normal Website with mainly the normal request/response-cycle is fine.
Do you think this is a possible approach to do things? I am currently thinking about how to use the data in the frontend sites in the best way. As I am familiar with the Django template language I thought about writing a middleware that asks about the user details in every request cycle from the backend. The thought is to use a request.user as normally as possible while getting the data from the backend.
Or is ist better to ask these details via jQuery and Ajax Calls and don't use the django template language very much?
Maybe there is also a way to make different Frontends for the same database without using REST?
Or what would you think about using a database with each frontend, which changes everytime I make a change in the main database in the backend? Although I don't really like this approach due to the possibility of differences in data if I make a mistake.
Hopefully this is not to confusing for you. If there are questions I will answer them happily. Maybe I am also totally on the wrong track. Please don't hesitate to point that out, too.
I thank you very much in advance for your guiding and wish you a nice day.
as per my experience and knowledge, you are almost going towards correct direction.
my recommendation is for making backend rest api Django and django rest framework is the best option however for consuming those api you can look for the angular or react both works very well in terms of consuming API.
Thank you for your input om tripathi.
I think it really does make sense to use the modern js frameworks for consuming a REST API.
I looked a little further into my problem and found multitenancy to fit my requirements perfectly. There are also great plugins and good reads for that use case. Just for others some informations I stumbled upon:
https://djangopackages.org/grids/g/multi-tenancy/
https://www.vinta.com.br/blog/2017/multitenancy-juggling-customer-data-django/
Especially the second link gave me information about different design approaches. For myself I chose to go the way with one database for every Client and then using the site framework from django to seperate data. For the Subdomain resolving I use django-hosts.
Thank you again and have a nice day.
I wanna build a simple social network use python. Just like twitter but smaller than twitter.I just wanna make a few features like follow,BE followed,view others profile,etc.
My question is that i should use web.py or Tornado?
BTW, is there any tutorial about Tornado? I feel it hard to understand when i read the documenations on the offical.
(Oops,my english is week. :P )
these two are different things.
Tornado is web server while web.py is a framework.
therefore you can use both of them.
Answer to your Q:
write your app with web.py ! I'm sure we can build a twitter copy based web.py very soon .
And then , you'd better to know these:
web.py is a small but charp python web framework
tornado is a web server, but also can do more things .
The document of tornado http://www.tornadoweb.org/documentation/index.html is good,and I guess you want some examples ? Click here https://github.com/facebook/tornado/tree/master/demos
You might consider using Pinax. When I used it, it had the self-concept of 'django with an opinion.' I'm not sure where it's at now, but my experience was that it was best suited for exactly what you want to do. One of the base projects is actually a fully functional social network site. You could then customize from there.
I'm a C/C++ developer and I also have experience developing web apps with C#, ASP.NET MVC and fluent nhibernate. I'm looking for non-MS alternatives for web development and I'm really interested in python so I went out after Django but I've been told that Django makes it difficult for me to personalize my HTML (not sure if this is accurate).
What I'm looking for is a Python web development framework that is integrated with an ORM, is able to generate the interfaces BUT provides an easy way for me to customize the interface to create an AJAX intensive app
go for django.
does all you wanted,
has perfect docs and even free book,
partially runs on appengine,
has really large user base,
it is mature:
db sharding, (With model router)
xss protection in forms
memcache,
localisation,
well tested support for unicode,
really easy to learn because of level of it documentation.
I'm using Flask (a very minimal web framework) and SQLAlchemy as my ORM. I'm exceedingly happy with it. Disclaimer: I'm only using this for personal projects at the moment, though I do plan to launch a web app in the next 6 months using this setup.
Various options in Python you can look at -
Django (obviously!)
Pylons
Nagare
Flask
Django is really good. And no your info is not correct, HTML templates are real easy to edit them.
Also this is from a developer of Nagare -
Ajax without to write any Javascript
code or the use of continuations makes
a Web application looks like a desktop
one. In fact we have often found that
developers like you, without prior Web
experiences, can be quicker to get
Nagare because they have nothing to
"unlearn".
I am going deeper into this framework Since you said that your app is AJAX intensive. From what I have heard, Nagare makes it easy to do so...
All these frameworks are really good. Some are really good in some areas, others not. So may be explore them all & see which best suits your purpose.
For Web applications development, we're using Nagare, coming with YUI for AJAX communications.
Having a look to Nagare might be an option.
I'm in agreement with the rest of the answers and think that Django is by-far the best choice as a "complete framework" and I think their template system is second-to-none.
If you are looking to create an ajax intensive application, I'd suggestion checking out django-piston (http://bitbucket.org/jespern/django-piston/wiki/Home). Piston is a REST API framework built on top of Django. I've used it for a number of ajax intensive applications and have found it's workflow to be incredibly clean, quick and flexible.
If you are wanting to go a bit slimmer and lighter-weight though, I'd suggest checking out web.py (http://webpy.org/) or Tornado (http://www.tornadoweb.org/).
I would definitely look into Pylons which is very thoroughly documented and has sql alchemy (one of the best python ORM's) baked in. Plus it's easy to setup and learn.
I currently am working with a framework called restish which is flavor of pylons that (surprise, surprise) puts the focus on sticking to RESTful web design. I don't think it's exactly what you're looking for in that it lacks good documentation and any form of an ORM.
Just A side note I'm pretty sure that Django uses Mako templating which gives you excellent control over the HTML.
This may seem like a subjective question. But it is not (that's not the idea, at least).
I'm developing an Advertising software (like AdWords, AdBrite, etc) and i've decide to use Python. And would like to use one of those well known web frameworks (Django, Cherrypy, pylons, etc).
The question is:
Given that it will have just a few Models (seven or eight), which has the best cache support? and What is the most efficient retrieving data from a MySQL database?
Thanks!
check out Flask. Its easy, its fast, works on top of Werkzeug, uses Jinja2 templating and SQLAlchemy for the model domain. http://flask.pocoo.org/
Performance should be more or less equal. If you want to keep it simple look at cherrypy, pylons and other lightweight frameworks.
-> http://wiki.python.org/moin/WebFrameworks gives a nice overview.
If you want to use Python to do complex SQL queries on your database, e.g. eagerloading or filtering on the fly you might be wanting SQLAlchemy.
TurboGears 2 is a framework which comes with SQLAlchemy as standard, check out their caching page for more info on the second part of your answer.
CherryPy is the only framework I'm aware of that does real HTTP caching out of the box (but look at "beaker" for a WSGI component solution). Many of the others give you tools to store arbitrary objects in Memcached or other storage.
I am only familiar with Django, and can tell you that it has a very robust middleware handler and very straightforward cache management. Also, the ORM (object-relational mapper; connect objects to databases) can have Postgre or MySQL as the engine, so you are free to choose the fastest one (I think that other frameworks use SQLAlchemy's ORM, which is also super cool and fast)
Check:
Middleware
Cache
I'm building my first python app on app-engine and wondering if I should use Django or not.
What are the strong points of each? If you have references that support your answer, please post them. Maybe we can make a wiki out of this question.
Aral Balkan wrote a really nice piece addressing this very question. Its a year or so old, so take it with a grain of salt - I think that a lot more emphasis should be put on the awesomeness of django's Object-Relational-Model. Basically, IMHO, it all comes down to whether or not you have a preference for using DJango's object model (which I happen to).
If it's not a small project, I try to use Django. You can use the App Engine Patch (http://code.google.com/p/app-engine-patch/). However, the ORM cannot use Django's meaning your models.py will still be using GAE's Datastore.
One of the advantages of using Django on GAE is session management. GAE does not have a built-in session.
You won't be able to using most Django 3rd-party apps though especially those with model changes. I had to build my own tagging app for GAE.