Author Picture

Kim Majali


Pagination Django

Author Avatar wrote on 26/05/2022

In the view.py file, instead of passing the listings we pass paged_listings

Import from django.core.paginator import EmptyPage, PageNotAnInteger, PaginatorRead more

Front Facing Django

Author Avatar wrote on 26/05/2022

Showing the Database’s content on the Front Facing

n view.py under index function, get the list of question and store them in an object then pass them to the url

Read more

Creating & Registering Folder for Media Uploads

Author Avatar wrote on 26/05/2022

Go to settings.py file and register the folder

MEDIA_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/media/'
Read more

Creating Models and Tables in DataBase

Author Avatar wrote on 26/05/2022

To create a table follow these stems:

  • Create the model in the model.py folder in its app folder
  • Make migration files python manage.py makemigrations this will create the migration files
  • Run the migration python manage.py migrat and that will create the tables

Notes:

Read more

PostgreSQL with Django

Author Avatar wrote on 26/05/2022

PostgreSQL is a more advanced DB server than MySQL, it’s free and open-source, ISO compliant, and has more advanced features like;

    • Rich datatypes (arrays, maps, json)

Read more

Topics: TemplatesBasicsModelsIntegrations

CRUDgen Django CRUD generator