These are the materials and the code snippets used in Django training sessions presented by Moez Bouhlel and Firas Chaaben from Tik.tn.
This repository is composed of different Django apps:
- Demo app containing Hello World example and a responsive contact page.
- CV app containing an example of Bootstrap based CV page generated from JSON files.
- Weather app containing an example of using Yahoo Weather API to generate a weather page.
- TODO List app example.
- Blog app example using markdown to render the content.
- Database-backed CV app.
Common Django Commands:
django-admin startproject PROJECT_NAME . # create a django project on current dir
python manage.py startapp APP_NAME # create an app
python manage.py runserver [IP:PORT] # run server on address http://IP:PORT or http://127.0.0.1:8000
python manage.py makemigrations # generate app migration files
python manage.py migrate # apply migration files
python manage.py createsuperuser # create superuser accountCommon Django app dev steps:
- add app name to
INSTALLED_APPSarray onPROJECT_NAME/settings.pyfile. - add url pattern to
urlpatternsarray onPROJECT_NAME/urls.pyfile to include APP_NAMEurls.pyfile. - define view function (or class) on
APP_NAME/views.py - define url pattern releated to the view function on
APP_NAME/urls.pyand addname - define our Databese models on
APP_NAME/models.pybased onmodels.Modelclass - define
__str__funtion for every model to have a better name - register our models to the admin site on
APP_NAME/admin.py - add our templates files under
APP_NAME/templates/APP_NAME/TEMPLATE.html
Links:
Tik.tn is a skilled software development and consulting agency. We offer the following services:
- Training: High-quality training for cutting-edge technologies for individuals and enterprises.
- Consulting: Optimize software architecture and code. Fix hardest bugs.
- Web Development: From simple single web page to high scale modular web platforms.
- Software & Application Development: Reliable software highly optimized for your system and your workflow.
- IOT: Turn-key long-lasting Big Data backed IOT build and integration solutions.
- Cloud & Web Hosting: PaaS hosting solution to meet every need. Top-class server administration services.
For more details, contact us at contact@tik.tn or contact Moez Bouhlel at bmoez.j@gmail.com.
These materials and code snippets are licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Unported License.
Copyright © 2016-2018, Moez Bouhlel (bmoez.j@gmail.com) & Firas Chaaben (firchatn@tik.tn), Tik.tn.