Tag: Django

  • Getting started with Django Framework

    Getting started with Django Framework

    Django is a python framework for developing web applications. To install Django, run

    pip install django
    

    To create a project, run

    django-admin startproject PROJECT_NAME
    

    Django come with built in development server. To start Django development server, change to the project folder and run

    ./manage.py runserver
    

    django framework

    It will start a development web server on url http://127.0.0.1:8000/

    Creating App

    A django project consists of multiple apps. Apps do a specific task, can be considered as a module. To create an app, run

    python manage.py startapp NAME_OF_APP
    

    To activate the app, you need to edit file

    vi PROJECT_NAME/settings.py
    

    Find

    INSTALLED_APPS
    

    this list all installed apps, you need to add name of your app to end of the list.

  • Django Framework

    Django is a Python framework. You can find more info at

    https://www.djangoproject.com

    Django Tutorials

    Getting started with Django Framework
    https://realpython.com/tutorials/django/

    Create Project

    django-admin.py startproject 
    

    Create New Application

    python manage.py startapp 
    

    Run Server

    python manage.py runserver [IP:PORT]
    

    Django framework run server command start development web server on port 8000

    To run server on port 80, use

    python manage.py runserver 0.0.0.0:80
    

    if you are running as non root user, you won’t be able to use port 80. The solution is to run as user root or install a reverse proxy like Nginx.

    Applications using Django

    https://wagtail.io