Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Thank you, Mr. Quentin Tarantino...
New Posts  All Forums:Forum Nav:

Thank you, Mr. Quentin Tarantino...

post #1 of 14
Thread Starter 
...for completely arse'ing up any chances of a web programming n00b being able to perform a productive Google search on the Django web framework.

Seriously. I hate you. lol
post #2 of 14
LoL laugher.gif
post #3 of 14
Just be glad it wasn't a movie with lots of spiders that have webs tongue.gif.
SUPERPWN
(12 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 4670K Asus z87-Pro MSI GTX 1080 Aero 32GB DDR3 Gskill Ripjaws 
Hard DriveOSMonitorMonitor
4TB Seagate Windows 8 x64 Overlord x270 OC HP ZR27 
MonitorKeyboardPowerAudio
Asus PG279Q G-Tune Topre Realforce 800w Yulong D100 DAC with Denon D7000 headphones 
  hide details  
Reply
SUPERPWN
(12 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 4670K Asus z87-Pro MSI GTX 1080 Aero 32GB DDR3 Gskill Ripjaws 
Hard DriveOSMonitorMonitor
4TB Seagate Windows 8 x64 Overlord x270 OC HP ZR27 
MonitorKeyboardPowerAudio
Asus PG279Q G-Tune Topre Realforce 800w Yulong D100 DAC with Denon D7000 headphones 
  hide details  
Reply
post #4 of 14
lol Good job :-p
post #5 of 14
Quote:
Originally Posted by Quasimojo View Post

...for completely arse'ing up any chances of a web programming n00b being able to perform a productive Google search on the Django web framework.

Seriously. I hate you. lol
Well played sir, well played. applaud.gif
Dark Nova
(20 items)
 
 
New HAF-X Build
(37 photos)
CPUMotherboardGraphicsRAM
FX-8350 Black Edition ASUS 990FX MSI R7950 Twin Frozr III Boost Corsiar XMS 3 
RAMRAMRAMHard Drive
Corsiar XMS 3 corsair xms3 corsair xms3 crucial m4 ssd 
Optical DriveCoolingCoolingCooling
LiteOn DVD Burner antec kuhler 920 yate loon 120mm HS x4 yate loon 120mm MS x3 
CoolingOSMonitorKeyboard
cooler master 200mm windows 8 pro HP 2011x CM storm quick fire 
PowerCaseMouseAudio
thermaltake m smart series 850 watt cooler master HAF-X logitech m705 logitech G930 
CPUMotherboardGraphicsGraphics
Intel I7 3970X MSI Big Bang-XPower II LGA 2011 Intel X79  MSI R7970 TF 3GD5/OC BE Radeon HD 7970  MSI R7970 TF 3GD5/OC BE Radeon HD 7970  
CoolingMonitorMonitorMonitor
custom water cooling from various manufacturers HP 2011x HP 2011x HP 2011x 
PowerCase
PC Power & Cooling MK III 750 BitFenix Colossus Venom 
  hide details  
Reply
Dark Nova
(20 items)
 
 
New HAF-X Build
(37 photos)
CPUMotherboardGraphicsRAM
FX-8350 Black Edition ASUS 990FX MSI R7950 Twin Frozr III Boost Corsiar XMS 3 
RAMRAMRAMHard Drive
Corsiar XMS 3 corsair xms3 corsair xms3 crucial m4 ssd 
Optical DriveCoolingCoolingCooling
LiteOn DVD Burner antec kuhler 920 yate loon 120mm HS x4 yate loon 120mm MS x3 
CoolingOSMonitorKeyboard
cooler master 200mm windows 8 pro HP 2011x CM storm quick fire 
PowerCaseMouseAudio
thermaltake m smart series 850 watt cooler master HAF-X logitech m705 logitech G930 
CPUMotherboardGraphicsGraphics
Intel I7 3970X MSI Big Bang-XPower II LGA 2011 Intel X79  MSI R7970 TF 3GD5/OC BE Radeon HD 7970  MSI R7970 TF 3GD5/OC BE Radeon HD 7970  
CoolingMonitorMonitorMonitor
custom water cooling from various manufacturers HP 2011x HP 2011x HP 2011x 
PowerCase
PC Power & Cooling MK III 750 BitFenix Colossus Venom 
  hide details  
Reply
post #6 of 14

Yeah, I did a search for django spoiler and didn't see anything about python anywhere.

 

Why use django? Give Flask a try instead (though it's even harder to search for).

post #7 of 14
Thread Starter 
Quote:
Originally Posted by hajile View Post

Why use django? Give Flask a try instead (though it's even harder to search for).

Why *not* use Django? Enquiring minds want to know.
post #8 of 14
Quote:
Originally Posted by Quasimojo View Post


Why *not* use Django? Enquiring minds want to know.

Firstly, I don't want to sound like I think Django is horrible. It isn't, but good is enemy to the best.

 

Django was one of the first (if not the first) major web development toolset for python. The problem here is that it has been forced to keep lots of ways of doing things (despite there being better methods) simply because of inertia. A glaring example of this is the Django ORM. SQLALchemy is far more flexible and (in the view of myself and quite a lot of other developers) nicer to use than the Django ORM, but Django can't change as all the old code would break.

 

The next issue is speed, Flask only uses what you want to use reducing total code which impacts both maintenance and performance while an entire layer of abstraction (that isn't any faster for development if you understand a little about how the web works) falls away. In addition, due to the smaller size, security audits of the entire stack are likely to be easier and more thorough. Another major benefit here is that you can choose the libraries you want to work with.

 

The major pitfall I can think of is that there isn't a really good CMS for Flask, but I didn't care for most of the Django ones either. While rolling your own isn't especially hard, it does take time.

 

A final voice on the topic would be Steve Huffman (co-founder of Reddit). I was curious about Udacity a while back and opted to check out their Web Application Engineering course. I started to see how good the courses were compared to a regular university and watched through the entire course simply because I was curious about his perspective on development.

 

When Reddit merged with another startup, the startup had their own web framework called web.py that they were familiar with, so the site was rewritten from lisp to python. Some time later, the site was facing the choice of either extending the capabilities of web.py or rewriting to be able to use the existing features of Django. They chose Django. According to Huffman, when he finally sold the company, they had needed to rewrite almost all of django anyway because Django does 90% of things, but must altered at the core level to be able to accomplish that last 10%. The only thing they couldn't afford to rewrite was the ORM despite their desire for a better fit for their needs.

 

web.py still exists in an almost completely unmaintained state. A very similar, but improved framework (Flask) grew up to offer the same flexibility while offering the missing features and a ton of optional libraries (many of which are bug tested by the Flask maintainers despite not being part of Flask).

 

For the record, I no longer use Python for new web development (though it's great for scripting, numpy, pyQt, etc). I currently use Ruby and the Sinatra framework (which was the inspiration for web.py, Flask, and a ton of other frameworks in over a dozen languages), but I'm working toward a usable Sinatra-alike written in Shen lisp.

 

edit: here's another guy's perspective

http://jokull.calepin.co/my-flask-to-django-experience.html

and here's an entire dev team's view (they seem to have done a lot of homework on this topic)

http://invenio-software.org/wiki/Talk/WebFrameworks

Kenneth Reitz's opinion (FWIW)

https://speakerdeck.com/kennethreitz/flasky-goodness

some basic speed tests (a little too basic IMHO, but it's what I found for you)

http://blog.curiasolutions.com/the-great-web-framework-shootout/#all


Edited by hajile - 5/23/13 at 7:11am
post #9 of 14
Thread Starter 
Very interesting. In my initial foray into Django, one of the first things that struck me was that the Django ORM more or less views the data layer with a very low significance. In other words, it doesn't really strive to employ any level of sound database design principals beyond what is absolutely required to make things work in the framework. Coming from a database developer background, the whole notion of code-first databases has always seemed borderline sacrilegious to me, as they typically produce a database that is simply a mirror representation of the application's data model, with little heed paid to data storage efficiency or query performance much less elegant design. Still, I was willing to consider the possibility that perhaps I should be a bit more open to the idea - it's what the new, cool kids are doing, right? Plus, straying from the Django philosophy appeared to be problematic or kludgy at best.

As an example, if you want an a primary key to use a bigint data type, the least painful way to make it happen is to allow the Django ORM to create the table column as int and go back and change it on the back end to bigint afterward. Additionally, I tried at first to use an existing database for my first app. While I'm sure it's quite possible to do so, there are several issues right up front that are not easily overcome for a new Django user to make it work as well as a syncdb-generated database. Straying from the path on even one point led me to a dizzying maze of documentation in my attempts to get it to work.

I like the idea of a less monolithic framework that caters to a more flexible approach. I'm going to take a good look at Flask. Thanks for the suggestion.
post #10 of 14
Quote:
Originally Posted by Quasimojo View Post

Very interesting. In my initial foray into Django, one of the first things that struck me was that the Django ORM more or less views the data layer with a very low significance. In other words, it doesn't really strive to employ any level of sound database design principals beyond what is absolutely required to make things work in the framework. Coming from a database developer background, the whole notion of code-first databases has always seemed borderline sacrilegious to me, as they typically produce a database that is simply a mirror representation of the application's data model, with little heed paid to data storage efficiency or query performance much less elegant design. Still, I was willing to consider the possibility that perhaps I should be a bit more open to the idea - it's what the new, cool kids are doing, right? Plus, straying from the Django philosophy appeared to be problematic or kludgy at best.

As an example, if you want an a primary key to use a bigint data type, the least painful way to make it happen is to allow the Django ORM to create the table column as int and go back and change it on the back end to bigint afterward. Additionally, I tried at first to use an existing database for my first app. While I'm sure it's quite possible to do so, there are several issues right up front that are not easily overcome for a new Django user to make it work as well as a syncdb-generated database. Straying from the path on even one point led me to a dizzying maze of documentation in my attempts to get it to work.

I like the idea of a less monolithic framework that caters to a more flexible approach. I'm going to take a good look at Flask. Thanks for the suggestion.

ORM's are basically a method to avoid boilerplate for common use cases (and to compensate for lack of expertise). If you're skilled with SQL, a low-level library such as python-sql that wraps the sql server APIs would probably work very well for you. I read a stackoverflow post by the creator of DataMapper (the Ruby ORM that most ORMs --including SQLAlchemy-- emulate) where he very clearly stated that more advanced sql queries shouldn't be used with an ORM and closer to the sql server is the required option.

New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Thank you, Mr. Quentin Tarantino...