Ado - A Task managment app built with django & MySQL
Install django and mysqlclient package to work with mysql database.
pipenv install django
pipenv install mysqlclient
Activate shell environment
django-admin startproject core .
python manage.py startapp task
or
django-admin startapp task
python manage.py runserver
Connect database django with mysql
DATABASES = {
' default' : {
' ENGINE' : ' django.db.backends.mysql' ,
' NAME' : ' ado_task' ,
' USER' : ' root' ,
' PASSWORD' : ' root' ,
' HOST' : ' 127.0.0.1' ,
' PORT' : ' 3306' ,
}
}
python manage.py makemigrations
Create directory named "templates" & create a file inside "base.html"
Create directory named "includes" & create file inside "header.html" and "footer.html"
Create a directory named "templates" inside task app & create another folder inside templates called "task" and create a file inside that folder called "index.html"
inside "base.html" setup this way
<!DOCTYPE html>
< html lang ="en ">
< head >
< meta charset ="UTF-8 " />
< meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
< title > Ado Task App</ title >
</ head >
< body >
{% include "includes/header.html" %} {% block content %}{% endblock %} {%
include "includes/footer.html" %}
</ body >
</ html >
inside "index.html" setup this way
{% extend "base.html" %} {% block content %}{% endblock %}
Make sure to setup base template directory on settings.py file
TEMPLATES = [
{
...
'DIRS ': [
BASE_DIR / 'templates'
],
...
},
]
Authentication & Authorization
python manage .py startapp user