Mais conteúdo relacionado Semelhante a Startup Camp - Git, Python, Django session (20) Mais de Juraj Michálek (20) Startup Camp - Git, Python, Django session1. Git, Python, Django, Heroku
Startup Camp
Trhový Štěpánov
Juraj Michálek
25. 8. 2012
http://georgik.sinusgear.com
http://twitter.com/sinusgear
2. Obsah
Git
Python
Django
Heroku
3. Git
Remote repository
Local repository
Stage
Working area
4. Git - clone
Remote repository
clone
Local repository
Stage
Working area
5. Git - add
Remote repository
Local repository
Stage
add
Working area
6. Git - commit
Remote repository
Local repository
commit
Stage
Working area
7. Git - push
Remote repository
push
Local repository
Stage
Working area
8. Git – operations
Remote repository
clone push
Local repository
commit
Stage
add
Working area
14. Go web
python -m SimpleHTTPServer
15. Python Shell
Lin/Mac – CTRL+D, Win – CTRL+Z – terminate
exit()
17. Python 2 or 3?
2.x stable, libraries, frameworks
3.x new syntax, missing part of legacy
20. Django
http://djangoproject.com
The Web framework for perfectionists
(with deadlines).
Django makes it easier to build better Web
apps more quickly and with less code.
21. Python 2 in Django context
Experimental Python 3 support
Recommended: Python 2.7
22. Sample Django
https://github.com/georgik/try_git
git clone git@github.com:georgik/try_git.git
23. Start sample Django
cd try_git
cd hellodjango
python manage syncdb
python manage.py runserver
http://localhost:8000/admin
25. Programming philosophy
Multi-paradigm prog. Lang.
Object Orientated Programming
Structured Programming
Functional Programming
Aspect Oriented Programming
26. IDE
● IntelliJ Idea or PyCharm
● Eclipse – pyDev
● Boa Constructor ;-)
● etc...
29. Virtualenv
http://www.virtualenv.org
Isolated environment
31. pip
pip install virtualenv
http://pypi.python.org/pypi
33. Templates – Wat?
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
34. Templates
import os
import django
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
TEMPLATE_DIRS = (
os.path.join(SITE_ROOT, 'templates')
)
7 tips for Python & Django - http://goo.gl/svZ5O
35. cURL
http://curl.haxx.se/
36. Test
curl http://localhost