My presentations, using Reveal.js (mostly in Portuguese).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
5.9 KiB

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Entendendo DJANGO</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/solarized.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'reveal.js/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<!-- personal styles -->
<style>
.semi-opaque {
background-color: rgba(0, 0, 0, 0.7);
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-backgroun='_images/django-allauth.png'>
<p class='semi-opaque'>
<h1>Django</h1>
<h2>Uma Introdução</h2>
</p>
</section>
<section>
<section>
<h2>Projeto</h2>
<p>"Projeto" é como Django chama a base do sistema,
que não passa de um conjunto de apps.</p>
<p>Criado com <code>django-admin startproject [PROJECTNAME] .</code>.</p>
</section>
<section>
<h2>Projeto: startproject</h2>
<pre><code class="hljs" data-trim>
project/
├── manage.py
└── project
├── __init__.py
├── settings.py
├── urls.py
└── wsgi.py
</pre></code>
<aside class="notes">
startproject cria a estrutura do projeto.
manage.py contem a estrutura de execução do projeto
project contém a base do projeto.
settings são as configuração do projeto.
urls define a base das rotas.
wsgi serve para a execução por wsgi.
</aside>
</section>
<section>
<h2>Time out: rodando o servidor de desenvolvimento</h2>
<pre><code class="hljs" data-trim>
$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
October 24, 2016 - 23:04:50
Django version 1.10.2, using settings 'project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
</code></pre>
<aside class="notes">
O que diabos aconteceu?
primeiro, "runserver" carrega o servidor de desenvolvimento.
qualquer alteração em arquivos irá recarregar o serviço.
13 migrações não aplicadas; o django já vem com
um conjunto de aplicações.
</aside>
</section>
<section>
<pre><code class="hljs" data-trim>
$ python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying sessions.0001_initial... OK
</code></pre>
</section>
</section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.configure({languages: ['python']}); hljs.initHighlightingOnLoad(); } },
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'reveal.js/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>