Posts under tag: "Settings"

Fixed CommandError: Unable to find a locale path to store translations for file __init__.py

By: summonagus ● at Feb. 27, 2017, 12:04 p.m. ● Posted under: #Problem, #Settings, #Django, #Solution, #Internationalization, #Multi Languages

Hello guys, this day I want to share a simply tutorial how to fix CommandError: Unable to find a locale path to store translations for file <app_name>/__init__.py for Django 1.10 In my previous LOCALE_PATHS inside file of settings.py is like this: LOCALE_PATHS = ( os.path.join(BASE_DIR, 'projectname/locale'), ) This should an ...

Read More →

How to implement Django Internationalization

By: summonagus ● at Nov. 17, 2016, 8:27 p.m. ● Posted under: #Tricks, #Database, #Settings, #Module, #Django, #Project, #Solution, #Internationalization, #Multi Languages

Django is real fucking awesome, this morning i want to share a basic tutorial how to implement the django internationalization with GeoIP. Of course this tutorial if you need to make a site with multiple languages. Default django already integrated with common / modern translation system. as the docs warning ...

Read More →

Step by step how to use multiple databases with database routers in Django

By: summonagus ● at Oct. 26, 2016, 11:29 p.m. ● Posted under: #Tricks, #Problem, #Database, #Settings, #APP, #Django, #Project, #Solution, #SSO, #Multi Databases

1. Please create a new superuser for the second/default/current database. Because you will getting this issue that i already asked before: https://gitter.im/django/django?at=5810b0b5806316005dc11f46 i use multiple site, multiple env, multiple project, multiple database. and found this error message if use DATABASE_ROUTERS. insert or update on table "django_admin_log" violates foreign key constraint ...

Read More →

Django: Redirect HTTP to HTTPS

By: summonagus ● at Oct. 8, 2016, 4:24 a.m. ● Posted under: #Settings, #Django, #Security, #Solution

Django: Redirect HTTP to HTTPS, basically the Django already support to handle this redirection at https://docs.djangoproject.com/en/dev/topics/security/#ssl-httpsEdit in your settings.py # Redirecting from `HTTP` to `HTTPS` for Django 1.8 or later SECURE_SSL_REDIRECT = True SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') Hope it usefull..

Read More →

Change backend gmail to Postmarkapp for Django

By: summonagus ● at Oct. 2, 2016, 5:11 p.m. ● Posted under: #Settings, #Module, #Django, #News, #Project, #API, #Solution

1. Install module of Python Postmark Install this module manually from souce inside your environtment: https://github.com/themartorana/python-postmark If you work on Django==1.9.*, requirements only mock.2. Register and Put the Server KeysRegister and put your server API token here: https://account.postmarkapp.com/servers/101010/credentials . 101010 is id of your server.Makesure verified your SPF and DKIM. ...

Read More →

Setup Django in apache2 Raspberry Pi

By: summonagus ● at Oct. 2, 2016, 3:49 p.m. ● Posted under: #Settings, #Network, #APP, #Django

Setup Django in apache2 Raspberry Pi. Example in this configuration for monitoring the server raspberry pi using https://github.com/k3oni/pydash/ As following this configurations https://github.com/k3oni/pydash/wiki/Install-pyDash#3-setup-apache, how to setup it. Edit in your:/etc/apache2/sites-available/pydash.conf and then, add this configuration:Listen 192.168.1.27:8001 <VirtualHost *:8001> ServerName 192.168.1.27:80/pydash ServerAlias 192.168.1.27:8001 DocumentRoot /var/www/pydash/ WSGIDaemonProcess pydash display-name=%{GROUP} python-path=/var/www/pydash WSGIProcessGroup pydash ...

Read More →

Django session for setup expired User was logged in to log out

By: summonagus ● at Oct. 2, 2016, 8:13 a.m. ● Posted under: #Tricks, #Problem, #Settings, #Django, #Security

Django session for setup expired User was logged in to log out, this problem hasbeen asked with someone in stackoverflow, and this is a good answer of it http://stackoverflow.com/a/14831237/3445802: That answer Update for Django 1.6, and now we worked with django 1.8.7, but it still works. 1. Add this for Handle session, in your ...

Read More →

Django: Installing Django Ckeditor

By: summonagus ● at Oct. 2, 2016, 8:13 a.m. ● Posted under: #Problem, #Settings, #Module, #APP, #Django

Django: Installing Django Ckeditor, Ckeditor is awesome editor and most popular editor was used for website, and compatible with django. 1. Install or add django-ckeditor to your python path. $ pip install django-ckeditor 2. Add ckeditor and ckeditor_uploader to your INSTALLED_APPS setting. 3. django-ckeditor uses jQuery in ckeditor-init.js file. You must set ``CKEDITOR_JQUERY_URL`` ...

Read More →

How to setup PostgreSQL Database in Django

By: summonagus ● at Oct. 2, 2016, 8:13 a.m. ● Posted under: #Settings, #Module, #Django

How to setup PostgreSQL Database in Django, this night I wanna share simple tutorial how to setup PostgreSQL Database in Django. This problem has been asked and solved with user from http://stackoverflow.com/a/5421511 Installation Download http://initd.org/psycopg/, then install it under django & python PATH. After downloading, easily extract the tarball and: ...

Read More →

Set Idle python as default open in linux ubuntu

By: summonagus ● at Oct. 2, 2016, 8:13 a.m. ● Posted under: #Settings, #News

Set Idle python as default open in linux ubuntu, this day, i wanna show you simple tutorial how to Set Idle python as default open in linux ubuntu. This tutorial has been asked and solved by user and inhttp://askubuntu.com/a/78645. So, there i want to re-share again in this tutorial with ...

Read More →