Wanting to learn python but confused by frameworks (Django)

A forum for general discussion of the Python programming language.

Wanting to learn python but confused by frameworks (Django)

Postby stevenmw » Fri Oct 04, 2013 1:26 pm

This is my first post. A lot of my questions might annoy certain people. Please don't let that cause you to split hairs, insult me, or make asking my question hard on me. There are going to be a lot of misconceptions if my post and I ask you correct them to help point me in the right direct.

I taught myself html, css, and a large amount of php in high school. I joined the Navy and for four years I didn't do any real development. I got out and a lot of things had changed. We had html5, css3, and php was deprecating the mysql library. I learned mysqli and pdo. i switched all of my stuff to pdo and didn't look back. (This background may help you see where I am skill wise.)

One thing about php is that is it set up to be easily used with web development. It has templating built in, and html can be inter-mixed with it. When writing php you can simply write a script and upload it. You don't need some extra tempting system like in Python.

My major piece of confusion had to do with frameworks regarding Python. 'Framework' has become a generic term. There are many different types of frameworks. So when people tell me Django is a framework I assume it has a bunch of pre-written code to help developers from writing basic things from scratch over and over. But apparently Django is a lot more than that. When I ask if Django is simply pre-written code I get demeaned and simply told, "You must not know what a framework is." But I do know what a framework is. Django is just a different type of framework than I'm used to.

From what I've read about Django is that it provides a templating system. In order to build a website in Python there must be some kind of templating system in order to use html with Python because you don't intermix Python and html like you do php and html.

So now I'm sitting at the conclusion that Dhango is pre-written code to help developers from writing everything from scratch and it has a templating language built in to make building websites easier. This doesn't sit right with me. i have a voice in the back of my head telling me, "But wait! There's more!" i know I am missing something.

So my main question is what does Django provide exactly? What makes it so powerful besides the tamplating language and the ability to not have to write basic things from scratch every time?

Another big question I have is, Do we need a framework to build a Python based website? If we do not need one wouldn't we still need a templating system? Are there simply templating systems out there that come by themselves without a framework like Django?

And another big one is how different are the different templating languages really? Django does things like

Code: Select all
{% extends "base_generic.html" %}

{% block title %}{{ section.title }}{% endblock %}

{% block content %}
<h1>{{ section.title }}</h1>

{% for story in story_list %}
  <a href="{{ story.get_absolute_url }}">
    {{ story.headline|upper }}
<p>{{ story.tease|truncatewords:"100" }}</p>
{% endfor %}
{% endblock %}

Are different frameworks hugely different when it comes to the templating?

If I start to learn python and I do so learning Django are there large parts of Python I'm not going to learn because I'm depending so much on Python to do so much for me?

I've got more questions, but this has turned into a big long ramble. If you can clear up my confusion and elaborate a little more on Django i'd appreciate it.

This is sort of related, but sort of not. After looking into Python it looks like a beautiful language, but needing a framework makes it look overwhelming at first glance. Wouldn't low level web development be almost pointless in Python because of all of the necessary steps and things needed just to get a Python based site running and built? And how hard is it to get Python running in a non-prduction environment when all you're doing is using a simple shared web host and do not have a server you fully control?

Thansk so much for reading. I aplogize these are such basic question, but i need to ask them.
Last edited by Yoriz on Fri Oct 04, 2013 2:03 pm, edited 1 time in total.
Reason: First post lock
Posts: 2
Joined: Fri Oct 04, 2013 12:42 pm

Re: Wanting to learn python but confused by frameworks (Djan

Postby stevenmw » Fri Oct 04, 2013 2:12 pm

I'm not trying to bump my thread. I forgot to add that I do have Django installed on my Debian LAMP stack. I installed it yesterday, but haven't done anything with it yet. I meant to write production environment not non-production.
Posts: 2
Joined: Fri Oct 04, 2013 12:42 pm

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 3 guests