To set up Django on Plesk: First of all, let’s check Python presence in the system. we can do it by issuing the command: python –version Install a Python package manager (under the “root” user): apt-get install python-pip It is common practice to have a separate virtual environment for each Python application. So, let’s install… Continue reading Hosting Of a Django Application Using Plesk webserver
Tag: Django
Building a Django Application with Google Routing and Geocoding API
In the realm of web development, incorporating mapping functionalities into applications has become increasingly popular. Google Maps APIs provide a powerful toolkit for developers to integrate mapping, geocoding, and routing capabilities seamlessly into their web applications. In this article, we will explore how to leverage Django, a high-level Python web framework, along with Google Routing… Continue reading Building a Django Application with Google Routing and Geocoding API
Map Box Api for Geocoding
Mapbox APIs are much more than just map tiles. They hold the key to unlocking a rich world of location-based possibilities, enriching your applications and engaging your users in innovative ways. This article delves deeper into the diverse capabilities of Mapbox APIs, showcasing their potential beyond the standard map visualization. From Static to Interactive: Imagine… Continue reading Map Box Api for Geocoding
DJANGO FRAMEWORK BASICS
CREATING PROJECT django-admin startproject projectname eg:django-admin startproject myproject cd myproject myproject/ manage.py myproject/ init.py settings.py urls.py wsgi.py settings.py DEBUG = True for sqlite3 DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.sqlite3’, ‘NAME’: os.path.join(BASE_DIR, ‘db.sqlite3’), } } for mysql DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.mysql’, ‘NAME’: ‘databasename’, ‘USER’: ‘root’, ‘PASSWORD’: ”, ‘HOST’: ‘localhost’, ‘PORT’: ”, }… Continue reading DJANGO FRAMEWORK BASICS
Python code to insert CSV data fields to a local Database table using Django
We can use this code to insert the data in a CSV file to a local database table. Just change the table name, database name, and data fields with your respective field name and others.
Cron job in django
SET UP installation: using the following command pip install django-crontab add it to installed apps in django settings.py: INSTALLED_APPS = ( ‘django_crontab’, … ) now create a new method that should be executed by cron every 5 minutes, f.e. in myapp/cron.py: now add this to your settings.py: CRONJOBS = (‘*/5 * * * *’, ‘myapp.cron.cron’)