Starting in Python Django

Asked

Viewed 532 times

-3

I am a web programmer working with Zendphp OS linux Ubuntu and decided to migrate to python. I have some questions. Python is an interpreted language! which server I will have to install so that everything works perfectly, it seems that python already comes with your server this is already indicated for the final work?

looking about the language I saw that she has a predefined admin who did not like me very much, I can make my layout totally different from the idea of Django?

Ex. first screen

  • menus and home with the company logo.
  • Browsing on mine and choosing an option (Product registration)
  • the system sends the user to the product listing
  • in the listing will have a table containing the records and in the same row the icons that would be the actions (see, change, delete).

as the database is made, I was a little lost in this part. I am accustomed to modeling my bank postgres and only then go to the part of the system crud, but all the examples I found were with Django himself creating the bank based on my classes.

Note: I did not do anything in language and I do not know it right so I am 100% lay in the subject.

  • here are some examples of Jango pages, maybe help. https://github.com/brumazzi/DJango-Exemples

  • 1

    The questions are pertinent, but it would be better to separate them into separate questions, as it is very broad (each answer would have to address each item separately). But in short: 1) PHP is also interpreted, what does that have to do with it? 2) Python usually comes pre-installed on Sos Linux, but a webserver you have to choose (and install) alone, Django is not an integral part of Python, it is an option among many; 3) As the answer of jsbueno speaks, you use admin if you want, do not use if you do not want, the "normal" is that the end user never touch the admin (for security); 4)...

    1. Django’s ORM has two modes, the "managed" (Managed) and the "unmanaged". In the first, you create your templates using Python code and the framework generates all SQL for you. In the second, the bank is created by you in the way you think best, and the ORM only map each table to a template and each table column to a template field. In this second case, schema migration tools do not act on the database, the structure is fixed and you are responsible for evolving it (and ensuring that the data model is consistent with the table structure being used).

1 answer

3

Your question is not entirely on-topic - but come on:

I am web programmer working with Zendphp OS linux Ubuntu and solved migrate to python. I have some questions. Python is a language performed! "Half true" is very easy to say that Python is an interpreted language - and people attribute a number of features falsely because of it. Python is a dynamic language, strongly typed, and compiled for Bytecode - this Bytecode is interpreted on a virtual machine - these characteristics are the same for example, in Java, which is a language that people don’t associate with being "interpreted".

which server I have to install to make everything work perfectly, it seems that python already comes with your server this is already suitable for the final job? The web server that "stares" at the internet, is mostly an HTTP server and consolidated general purpose - like Apache or Nginx. These servers bridge to the Python application. Depending on the set of technologies you choose within Python, it is possible to expose a Python server directly on the Internet (Tornado, API-Hour, uWSGI, etc...) - but this is not relevant to the start of work.

looking over the language saw that she has a predefined admin that not pleased me much, I can make my layout totally different of the idea of Django?

Django’s Admin is an extra tool, which allows the application to work with a set of CRUD screens (creation, editing, deletion of elements) as soon as you define your templates. No application is required to use Django-admin screens.
If it covers all the functionality you need, yes, it is possible to put different themes on it, to look different - but most applications and websites define distinct visualisations, made completely separate from Django-admin.

Ex. first screen

menus and home with the company logo. Browsing on my and choosing a option (Product registration) the system sends the user to the list of products in the listing will have a table containing the records and in the same row the icons that would be the actions (see, change, delete).

The presentation, and what views your system will have, you define as you develop. If you follow a common Jango tutorial, you will have demonstrations of how to develop the views.

As the database is done, I was a little lost in this part. I am accustomed to modeling my bank postgres and only then go to the part crud system, but all the examples I found were with Django himself creating the bank based on my classes.

Django has its own ORM (Object-Relational Adapter), very simple to use, and in most cases, requires you to create things directly in the bank. You can model all your data models directly with Python classes, which you inherit from the Model class defined in Django. The tool set that accompanies this framework specifically generates SQL for you. If this is the case, you can optionally edit this generated SQL before it runs automatically in the database (for example, to add options in creating tables that can lead to greater performance for your application). In general this step is not necessary.

Django one of the web frameworks available for Python, and one of the most complete - following a good tutorial, it can rather serve to get you started and become proactive more or less quickly. Just be careful not to neglect the language learning itself - I’ve seen many people who follow a tutorial by Django, make your application medium in copy and Paste from the tutorial examples, and continue developing without having much idea of what you’re doing. To learn Python, one of the best requests is the tutorial available on the language site itself - http://python.org

Other frameworks are smaller, and allow component exchange - for example, it’s easier to store the data in a Nosql database if you’re using Flask (another framework) than using Django - there the data persistence layer is completely pluggable.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.