Ajuda, recursos e dicas
Nós fizemos o nosso melhor para tornar simples PY4WEB e limpo. Mas você sabe, moderno programação web é uma tarefa difícil. Ela exige uma mente aberta, capaz de saltar com frequência (sem ser perdida!) De python para HTML para javascript para css e gestão de banco de dados mesmo. Mas não tenha medo, neste manual vamos ajudá-lo lado a lado nesta jornada. E há muitos outros recursos valiosos que nós vamos mostrar-lhe.
Recursos
Este manual
This manual is the Reference Manual for py4web. It’s available online at https://py4web.com/_documentation/static/index.html, where you’ll also find the PDF and EBOOK version, in multiple languages. It written in RestructuredText and generated using Sphinx.
O grupo Google
Existe uma lista de discussão dedicado hospedado no Google Groups, consulte https://groups.google.com/g/py4web. Esta é a principal fonte de discussões para desenvolvedores e usuários simples. Para qualquer problema que você deve enfrentar, este é o lugar certo para procurar uma dica ou uma solução.
The Discord server
For quick questions and chats you can also use the free Discord server dedicated to py4web. You could usually find many py4web developers hanging out in the channel.
Tutoriais e vídeo
There are many tutorials and videos available. Here are some of them:
the Learn Py4Web site by Luca de Alfaro (with lots of excellent training videos)
the free video course 2020 by Luca de Alfaro at UC Santa Cruz
the py4web blog app by Andrew Gavgavian, which uses py4web to replicate the famous Corey Schafer’s tutorial series on creating a blog app in Django
the South Breeze Enterprises demo app by Jim Steil. It is built around the structure of the Microsoft Northwind database, but converted to SQLite. You can view the final result online here
As fontes no GitHub
Last but not least, py4web is Open Source, with a BSD v3 license, hosted on GitHub at https://github.com/web2py/py4web. This means that you can read, study and experiment with all of its internal details by yourself.
Dicas e sugestões
Este parágrafo é dedicado a dicas preliminares, sugestões e dicas que podem ser úteis para saber antes de começar a aprender py4web.
Pré-requisitos
A fim de compreender py4web você precisa de pelo menos um conhecimento básico python. Há muitos livros, cursos e tutoriais disponíveis na Web - escolher o que é melhor para você. decoradores do Python, em particular, são um marco de qualquer quadro python web e você tem que compreendê-lo totalmente.
Um local de trabalho python moderna
In the following chapters you will start coding on your computer. We suggest you to setup a modern python workplace if you plan to do it efficiently and safely. Even for running simple examples and experimenting a little, we strongly suggest to use an Integrated Development Environment (IDE). This will make your programming experience much better, allowing syntax checking, linting and visual debugging. Nowadays there are two free and multi-platform main choices: Microsoft Visual Studio Code aka VScode and JetBrains PyCharm.
Quando você vai começar a lidar com programas mais complexos e confiabilidade necessidade, sugerimos também para:
use virtual environments (also called virtualenv, see here for an introduction). In a complex workplace this will avoid to be messed up with other python programs and modules
use git to keep track of your program’s changes and save your changes in a safe place online (GitHub, GitLat, or Bitbucket).
use an editor with Syntax Highlighting. We highly recommend Visual Studio Code (VScode) or PyCharm.
Depuração py4web com VScode
It’s quite simple to run and debug py4web within VScode.
If you have installed py4web from source, you just need to open the main py4web folder (not the apps folder!) with VScode and add:
"args": ["run", "apps"],
"program": "your_full_path_to_py4web.py",
to the vscode launch.json
configuration file. Note that if you’re using Windows the «your_full_path_to_py4web.py» parameter must be written using
forward slash only, like
«C:/Users/your_name/py4web/py4web.py».
If you have instead installed py4web from pip, you need to set the launch.json file to run py4web as a module
{
"name": "py4web apps",
"type": "debugpy",
"request": "launch",
"module": "py4web",
"args": ["run", "apps", "-D", "--watch", "lazy"]
}
Adjust the args to match your apps folder. For example, replace apps with . if you opened the apps folder itself in VSCode.
Dica
In both cases, if you should get gevent errors you have to also add "gevent": true
on the launch.json
configuration file.
Depuração py4web com PyCharm
In PyCharm, if you should get gevent errors you need to enable Settings | Build, Execution, Deployment | Python Debugger | Gevent compatible.
Como contribuir
We need help from everyone: support our efforts! You can just participate in the Google group trying to answer other’s questions, submit bugs using or create pull requests on the GitHub repository.
Se você deseja corrigir e ampliar este manual, ou mesmo traduzi-lo em uma nova língua estrangeira, você pode ler todas as informações necessárias diretamente no `README específica <https://github.com/web2py/py4web/blob/master/ docs / README.md> `__ no GitHub.
It’s really simple! Just change the .RST files in the /doc folder and create a Pull Request on the GitHub repository at https://github.com/web2py/py4web - you can even do it within your browser. Once the PR is accepted, your changes will be written on the master branch, and will be reflected on the web pages / pdf / epub at the next output generation on the branch.