position pa permit spec 2 django

Upload: michycon22

Post on 02-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Position Pa Permit Spec 2 Django

    1/10

    Introduction

    Web Frameworks is a type of software framework that takes us away from the usual structured

    programming that developers know of. It is designed to support the development of dynamic websites,

    web applications, web services and resources. They already have libraries for the database use, session

    management and promote code reuse. Designing a website with the help of a web framework employs

    the model-view-controller or a three-tier organization to which applications are structured around three

    physical tiers: the client, application and database. The database is normally the RDBMS, the application

    layer contains the logic of the application running on the server while the client runs the HTML generated

    by the application layer.

    There are a number of web application frameworks available for development of projects, each

    web application framework rooted from a popular web programming language. For example: In PHP, you

    can basically talk about Joomla or Code Igniter, Python also has several other frameworks written under

    it, the one that this position paper will be concentrating on is Django.

    Djangoproject.com defines Django as a high level Python web framework that encourages rapid

    development and clean pragmatic design.

    History

    Django was conceptualized in 2003 when the web programmers Adrian Holovaty and Simon

    Willison used Python to build applications. Released publicly in 2005, the framework was named after

    guitarist Django Reinhardt. In 2008, it was announced that then newly founded Django Software

    Foundation will maintain the Django Framework.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    2/10

    Main Concept of Django

    Django was developed by a fast-moving online-news operation meant to handle the following

    challenges: the intensive deadlines found in a newsroom and the stringent requirements of the web

    developers who wrote the framework. It focuses on automating the requirement and sticking to the DRY

    Principle.

    Benefits of using Django as Web Framework

    In the article Django: A Web Framework with Immense Potential. Deo (2013) defines several benefits

    on why a developer should use Django as a web framework:

    1. It is based in Python: Django is written in Python thus all the advantages of using Python as a

    web framework is also with Django. Python has a clean and elegant syntax and is supported by a

    large library of standard and contributed modules. Pythons runtime environment is also the

    concept when using Django as it is known to be fast and stable. Pythons support is also to

    various web servers, including the infamous Apache. It can also be used with almost every type

    of database engines but you as the developer would not have to deal with them for Django

    provides a unified layer for all database engines.

    2. Coding Standards: Deo (2013) defines that code reliability is essential in software development

    there is only one single way in writing any code.

    3.

    It has a robust ORM system: As mentioned previously, Django supports a large number of

    database systems and changing the database will just be going through the configuration file.

    4. A powerful template system: You can integrate programming logic to your templates to speed up

    the development of the project.

    5. Committed to the DRY Principle: DRY Principle means Do not Repeat Yourself where Django

    programmers should learn how to be better object-oriented programmers. Many programmers

    make a mistake of recoding what can be called by wrapping up their function through code bases.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    3/10

    Django already has this in place and has many essential pieces of code for a developer built on its

    libraries.

    Features of the Django Framework

    Object-relational mapper

    You can define your data models purely in Python but still write SQL as needed.

    Automatic admin interface

    Having problem in creating interfaces for CRUD? Django does the admin interface

    automatically and its deployment ready.

    Cache system

    Django employs a cache system for super performance

    Internationalization

    The programming language has support for multi-language applications. Django lets you

    specify translation strings for any programming language to hook up with your

    application instantly.

    Application of Django to an Organization or Industry

    Research contributes that Django, a framework written in Python has already been used for

    Pininterest, Instagram, Mozilla, Disqus and Washington Times are already using Django as their

    framework with this, Django can be used in creating a web application for an Information Technology

    DepartmentHelpDesk Unit, particularly when it comes to servicing the request through tickets.

    A ticketing system consists of who to attribute the request, when is the request needed, the extent

    of the request (repair, replacement or PC checkup as an example) and if the request should be escalated to

    other individuals. A ticketing system developed through Django can be useful as it presents a clean syntax

    and can be embedded with various database systems.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    4/10

    Process of Adapting Django in the Organization

    How to Install Django (Notes from Djangoproject.com)

    With Django being a Python web framework, Django requires Python, it works with

    version such as Python 2.7, 3.2 and 3.3

    Install Apache and mod_wsgi

    o

    Apache and mod_wsgi is only needed if you install Django in a production set-

    up, if you are just going to experiment, Django already has a web server in place.

    o Mod_wsgi operates in 2 modes: an embedded mode and a daemon mode. In embedded

    mode, mod_wsgi is similar to mod_perl it embeds Python within Apache and loads Python code

    into memory when the server starts.

    o If for some reason you cannot use mod_wsgi, there are other deployment options

    such as uWSGI which is supported by nginx.

    Get your databases running

    o Django supports many database servers from: Oracle, MySQL, PostgreSQL,

    SQL Lite, etc.

    o SQL Lite is generally the simplest version to work with on a Django project, for

    an experimental testing like Django. However if you are working on something

    that is substantial especially when you move to production, better start working

    with those databases such as Oracle or PostgreSQL.

    o

    Get to install the Python data bindings depending on the backend installed.

    Install the Django code.

    o Installing a distribution-specific package.

    o Installing an official release with pip.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    5/10

    Install pip. The easiest is to use the standalone pip installer. If your

    distribution already has pip installed, you might need to update it if its

    outdated. (If its outdated, youll know because installation wont work.)

    (optional) Take a look at virtualenv and virtualenvwrapper. These tools

    provide isolated Python environments, which are more practical than

    installing packages systemwide. They also allow installing packages

    without administrator privileges. Its up to you to decide if you want to

    learn and use them.

    If youre using Linux, Mac OS X or some other flavor of Unix, enter the

    command sudo pip install Django at the shell prompt. If youre using

    Windows, start a command shell with administrator privileges and run

    the command pip install Django. This will install Django in your Python

    installations site-packages directory.

    If youre using a virtualenv, you dont need sudo or administrator

    privileges, and this will install Django in the virtualenvs site-packages

    directory..

    o Installing an official release manually (without the use of the PIP)

    o Installing a development version.

    To install a development version you need to check if Git is installed.

    Security and Extensibility with Django

    Django does not allow inclusion of codes that will ruin the application for example a sql code

    that will delete all the data within the database. It is also extensible as Django allows templates to be used

    as a part of the development of their application.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    6/10

    Django in the Philippine Setting

    Impact of Utilizing the Said Framework:

    Web Developers use various web frameworks to develop their projects, Django changes the core of web

    programming for the following reasons:

    It has good documentation originating from Python, Django is known to have a well-

    written documentation, there is a saying that goes that if it is not well implemented, it is

    not documented.

    Template System the template system of Django has been the inspiration of other

    programming languages.

    LicensesDjango is under the BSD Software Distribution while the older ones are under

    GPL making it easier to distribute the software.

    Open CommunityProblems will not be away in any development measure, there is an

    open community for Django to which developers can share their ideas with.

    In a web application framework, what is commonly measured is the performance of the framework,

    Django has tools which can be able to answer performance measures to which a developer can check how

    his application is doing:

    Django Toolbar

    o Install via pip install django toolbar

    Profiling Middleware

    Load Testing

    o

    Load testing can easily generate HTTP traffic in volume, sending a decent

    number of concurrent requests against your application and returning some useful

    results.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    7/10

    Djangos security measures changes the way web development is done. A developer should never trust

    the user and never trust the data, no exceptions. A developer must look at the layer to which security may

    be compromised:

    User Management

    Authorization

    Cookies

    SQL Injection

    Cross Site Scripting

    Clickjacking

    o Django protects against clickjacking which is the act when a malicious site tricks

    a user into clicking on a concealed element of another site which they have

    loaded in a hidden frame or iframe.

    o

    To prevent clickjacking, Django provides a simple middleware which sets the

    header to all the responses and a series of decorators that can be used to

    overwrite the middleware (basis: Django Project documentation)

    Directory Traversal

    o

    You cannot easily access the root directory or a user account will not be given

    access to the root directory.

    With these measures, developers may choose to use Django than other frameworks to make sure that their

    applications are available 24/7.

    Django in the Philippines

    When you talk about web development in the Philippines, the first thing that would come to mind

    is PHP or the CMS packages such as Code Igniter or Drupal, only a handful of developers start with

    Pythonmore so Django.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    8/10

    Django should be applied in the Philippines for the reason that it is a secure framework something

    that web developers in general have left out especially in the government where every now and then

    websites are hacked. If you are going to look at the websites that use Django: Pininterest and Instagram

    for example, it is not that vulnerable to security loopholes to which websites in the government had been

    subject to. WebCube (2012) describe Django as the global platform as it can be considered as scalable

    which Pininterest and Instagram has proven.

    There is already a case study that shows why Django in form of security extensibility which is

    somehow neglected by developers. If you look at the deployment or the coding scheme, since it was made

    in a newsroom where deadlines have been evident, Django is an ideal way of creating web projects easily.

    Django can be an effective framework for government websites which actually show the risk of

    being hacked nowadays. If you would look at the system, it can be easily seen when you view the source

    of the project and Django means to change that idea.

    If you are not really used to hard coding Django as it is which is a structured programming

    language used to implement websites, There is also a Content Management System powered by Django.

    DjangoCMS.org is a website that caters to web developers who would like to use Django as their CMS.

    Orange Communications (2012) cites the need to create their website to change their old website

    to which their users have a hard time navigating through their site to find the information they required.

    They also feel they lost their appeal to the market with their old architecture with them pulling away

    from the B2C and B2B.

    What they wanted to see was their users finding the information they want, check out if their

    customers are buying their products or to check if they could easily support their users. They had

    achieved the result they want through this:

  • 8/10/2019 Position Pa Permit Spec 2 Django

    9/10

    A better design with a three-click rule that is found within the website.

    People can easily distinguish where to go through the website.

    The distinction between customer types had suddenly become clearer.

    If developers can take time to use Django instead of having to go through the usual HTML or other

    structured programming languages, it can be assured that there would be continuous service, easier

    deployment and fast-paced integration to users.

    The proponent of this position paper hopes that people take time to learn Python more so, Django and

    improve their web programming skills.

  • 8/10/2019 Position Pa Permit Spec 2 Django

    10/10