On Wednesday, October 10, 2012 3:24:26 PM UTC+10, Sarbjit singh wrote:
>
> First of all, I am very sorry for asking this basic question. I am not 
> sure if this is the right place to put this question but I am very confused.
>
>
Hello, Sarbjit.

 

> I am not having much experience with web development, so i don't know 
> where the Django fits in here. I searched a lot on internet, few forums 
> suggested to use Django for websites and few mentioned that Django is not 
> for web development. So i have couple of basic questions and i want to be 
> sure that i am on right track in learning Django.
>
>
Be careful of forums. On some places, it's the "blind leading the blind".

"Where does Django fit in"? It fits in on the server machine. A HTTP server 
program (like Apache or nginx) takes web page requests, and passes them 
onto Django. In turn, Django interprets the requests, generally running 
queries on the database and doing whatever processing is necessary to 
generate a web page. Django then throws the generated web page to the HTTP 
server, which then sends it back to the web browser.

Django has a development server where you can request and receive pages 
without something like Apache or nginx. But this is not recommended in a 
production environment, because it is a lot slower. Django is used for 
generating content dynamically; but there is no gain in using development 
server to fetch static files (like images).
 

> Q: There are simple websites which just serves static contents and other 
> site which deals with forms and data base. I have once used PHP for form 
> processing and using it with DB. If i have to design such websites using 
> Python, Is Django suitable for the following or there are some other 
> modules which needs to be used.
>
>
If everything is static, then Django is overkill. All you need is your 
favorite HTTP server. But if you are dealing with forms and databases, then 
Django is very, very suitable indeed. There are classes in the framework 
that allow you to create forms on the fly. As for databases, there are also 
classes that allow you to model the database tables and run queries 
_without writing any SQL_.  Do you really want to write your own SQL 
statements? I don't. 

You asked "are there some other modules which needs to be used?" Well, you 
need Python to run it; Django won't work without it. But other "modules" 
you may need are modules written in Python - and they can be installed as 
simply as running "pip install <module-name>" from the command line.

One of the best things about Django is that a lot of security is built in 
by default. You can write something and be fairly confident that all the 
attack vectors have been blocked off. SQL injections? Not a problem; the 
model classes do all the hard work of passing queries to the database and 
_escaping content_.  Cross Site Request Forgeries? The form classes prevent 
such things occurring.

 

> Q: Is Django a substitute to CGI for dynamic web generation.
>
>
It sounds better than bog standard CGI, where every request spawns a new 
process.  


 

> Q: Can i use Django for development of a full fledged website.
>
>
> Of course you can. 
 
Best regards,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/GcI_d9S8bYMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to