Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django + Celery & Rabbit - part one
First part of series about Django application with Celery and RabbitMQ. -
Dutch django meetup (feb 2016) summaries
Dutch django meetup revival - Erik Romijn Sponsored by http://byte.nl, organized by the Dutch django association (django vereniging). The association was founded to organize the 2011 Django Europ conference. They're also behind the "django under the hood" conferences. They're also supporting django girls workshops and even Python Namibia 2015. If you want to become a member, mail bestuur@djangovereniging.nl If you want to help with future meetups, contact him! Migrating nu.nl to Django - Besma Mcharek-Boussif Besma works for Sanoma, the company behind http://www.nu.nl/, a very big news site in the Netherlands. The real title of the talk is "nu.nl performance and our journey in the django realm". She's a django backend developer. She's also a co-organizer of the django girls meetings. Nu.nl is the biggest Dutch news platform. 10^9 pageviews per day. They specialize on getting the news online fastest. Mobile and desktop web sites plus mobile apps (ios, android and windows) for tablets, phones and smart watches. There's now an ios team, an android team and a web/API and a CMS team. The API is also used by the mobile apps, btw. Regarding development: they try to use a devops mind set. It is almost continuous integration. About 10 … -
Django cookiecutter
Have you ever wanted to automate all these boring things that you have to do while setting up new django project? Like writing proper settings, setting up whole folder structure, adding docs, readmes, setup.py etc? There is app that can do these mundane actions for you: Cookiecutter Django. Q: What you get after reading this post? A: Basic understanding how you can automate boring tasks and get exciting ones done! Let's start with cookiecutter. What exactly is it? It's CLI tool for automatically generating projects from given template. What do I mean by that? Suppose that when you make new python project you want certain things to be setup the same way every time. For instance: setup.py or docs folders. Thanks to cookiecutter it's possible to automate these things so every time you make the new project the boring stuff is already made for you. Django Cookiecutter is made especially for django applications. Based on GitHub README it provides: For Django 1.9 Renders Django projects with 100% test coverage Twitter Bootstrap v4.0.0 - alpha End-to-end via Hitch AngularJS 12-Factor based settings via django-environ Optimized development and production settings Registration via django-allauth Comes with custom user model ready to go. Grunt … -
Django cookiecutter
Have you ever wanted to automate all these boring things that you have to do while setting up new django project? Like writing proper settings, setting up whole folder structure, adding docs, readmes, setup.py etc? There is app that can do these mundane actions for you: Cookiecutter Django. Q: What you get after reading this post? A: Basic understanding how you can automate boring tasks and get exciting ones done! Let's start with cookiecutter. What exactly is it? It's CLI tool for automatically generating projects from given template. What do I mean by that? Suppose that when you make new python project you want certain things to be setup the same way every time. For instance: setup.py or docs folders. Thanks to cookiecutter it's possible to automate these things so every time you make the new project the boring stuff is already made for you. Django Cookiecutter is made especially for django applications. Based on GitHub README it provides: For Django 1.9 Renders Django projects with 100% test coverage Twitter Bootstrap v4.0.0 - alpha End-to-end via Hitch AngularJS 12-Factor based settings via django-environ Optimized development and production settings Registration via django-allauth Comes with custom user model ready to go. Grunt … -
Django cookiecutter
Automate everything. -
Python 3 in 2016
My completely anecdotal view on the state of Python 3 in 2016. Based on my own recent experience, observations, and exchanges with other members of the Python community. -
Python 3 in 2016
My completely anecdotal view on the state of Python 3 in 2016. Based on my own recent experience, observations, and exchanges with other members of the Python community. -
Wagtail: 2 Steps for Adding Pages Outside of the CMS
My first Caktus project went live late in the summer of 2015. It's a community portal for users of an SMS-based product called RapidPro. The portal was built in the Wagtail CMS framework which has a lovely, intuitive admin interface and excellent documentation for developers and content editors. The code for our Wagtail-based project is all open sourced on GitHub. For this community portal, we needed to allow users to create blog pages on our front-facing site without giving those same users any level of access to the actual CMS. We also didn't want outside users to have to learn a new CMS just to submit content. We wanted a simple, one-stop form that guided users through entering their content and thanked them for submitting. After these outside users requested pages be published on the site, CMS content editors could then view, edit, and publish the pages through the Wagtail CMS. Here's how we accomplished this in two steps. Karen Tracey and I both worked on this project and a lot of this code was guided by her Django wisdom. Step 1: Use the RoutablePageMixin for our form page and thank you page Now for a little background information on … -
Django-minipub: a minimal publication control mixin
Django-minipub is a minimal publication control system for Django. I wrote this app in 2013/2014 and I've used it on several websites... However, I've never had the time to talk about it! Time to fix that oversight. -
Climbing up Branches
Today I pushed the latest Evennia development branch "wclient". This has a bunch of updates to how Evennia's webclient infrastructure works, by making all exchanged data be treated equal (instead of treating text separately from other types of client instructions).It also reworks the javascript client into a library that should be a lot easier to expand on and customize. The actual client GUI is still pretty rudimentary though, so I hope a user with more web development experience can take upon themselves to look it over for best practices. A much more detailed description of what is currently going on (including how to check out the latest for yourself) is found in this mailing list post. Enjoy! -
Using mysql load data infile with django
Using mysql load data infile with django -
Using Fabric to update a remote svn checkout with ssh public key authentication
Using Fabric to update a remote svn checkout with ssh public key authentication -
Allow squid/mod_wsgi to pass the HTTP_AUTHORIZATION header to Apache
Allow squid/mod_wsgi to pass the HTTP_AUTHORIZATION header to Apache -
Django "view-permissions" for related objects
Django "view-permissions" for related objects -
Nested resources in Tastypie
Nested resources in Tastypie -
Custom choices in Django admin
Custom choices in Django admin -
RestORM - The client side of REST
RestORM - The client side of REST -
Customizing Django startproject with templates
Customizing Django startproject with templates -
Django redirects with regular expressions
Django redirects with regular expressions -
Using jsPDF in Django templates to export as PDF
Using jsPDF in Django templates to export as PDF jsPDF is used to generate pdf files in client-side Javascript. You can find the links for jsPDF here and also you can find the link to project homepage. You've to include the scripting files/links in head section to work properly. Tip: We have to download the newest version of the library and include it in the HEAD or at the end of the BODY section. Example to run the script from local storage: In the HEAD section: <head> <script src="js/jspdf.js">script> head> (or) In the BODY section: <body> <script src="js/jspdf.js">script> <script src="js/main.js">script> body> After loading the scripts in HEAD/BODY section, now we can start using the jsPDF library. Lets start with some of basics of jsPDF to get the idea of using it in our applications: First let us discuss how to create a new document? It's simple as below mentioned: var doc = new jsPDF(orientation, unit, format, compress); The constructor can take several parameters. orientation - The default value of orientation is "portrait". We can set it to "landscape" if we want a different page orientation. unit - We can tell jsPDF in which units we want to work. Use on of the following: "pt" (points), … -
Creating Django App
Django: Django is a high-level Python Web framework that encourages rapid development. Install django in virtualenv to keep it safe from messing around with the other versions you may have. $ virtualenv env $ env/bin/activate $ pip install django If Django is installed, you can see the version of our installation by running following command $ python -c "import django; print(django.get_version())" otherwise you get an error “No module named django” Creating a Project: If this is your first time using Django, you’ll need to auto-generate code that establishes a Django Project A collection of settings, Including database configuration, Django-specific options and application-specific settings. With the following command: $ django-admin.py startproject myproject This will Create "myproject" directory in your current directory.The above command(startproject) creates myproject/ |- manage.py |- myproject/ |- __init__.py |- settings.py |- urls.py |- wsgi.py The outer "myproject/" root directory is where your project is stored. manage.py: It is automatically created in each Django project. manage.py is a thin wrapper around django-admin.py before delegating to django-admin.py.It puts your project’s package on sys.path,Sets the DJANGO_SETTINGS_MODULE … -
django Payu Payment gateway Integration
In this blog, we will see how to integrate Django and PayU Payment Gateway. To integrate with PayU, we have package called "django-payu" - a pluggable Django application. GitHub Repository: django-payu Documentaion: django-payu.readthedocs.org Install: $ pip install django-payu Integration Process: 1. To start the integartion process, you need test merchant account and test credit card credentials to have the experience of overall transaction flow. Once you create the account with PayU, they will provide SALT and KEY, we need this two credentials for the integration. NOTE: Here, you need to make the transaction request to the test-server and not on the production-server. Once you are ready and understood the entire payment flow, you can move to the production server. 2. To initialise the transaction, you need to generate a post request to the below urls with the parameters mentioned below For PayU Test Server: POST URL: https://test.payu.in/_payment For PayU Production (LIVE) Server: POST URL: https://secure.payu.in/_payment Parameters to be posted by Merchant to PayU in transaction request are: key (Mandatory), txnid (Mandatory), amount(Mandatory), productinfo(Mandatory), firstname(Mandatory), email (Mandatory), phone (Mandatory), lastname, udf1-udf5, address1, address2, city, state, country, zipcode, surl(Mandatory), furl(Mandatory), curl(Mandatory), hash(Checksum)(Mandatory): sha512(key|txnid|amount|productinfo|firstname|email| udf1|udf2|udf3|udf4|udf5||||||SALT) NOTE: udf : User defined field … -
Django Haystack and Elasticsearch- part two
Hello! This is the second part of Django Haystack and Elasticsearch series. First you can find here. Now it's time to install and elasticsearch. On ubuntu you can do it as follows: 1.First install java-8 $ sudo apt-get install python-software-properties -y $ sudo add-apt-repository ppa:webupd8team/java -y $ sudo apt-get update $ sudo apt-get install oracle-java8-installer -y 2.Verify if it's properly installed $ java -version java version "1.8.0_72" Java(TM) SE Runtime Environment (build 1.8.0_72-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode) 3.Now install elasticsearch itself $ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - $ echo "deb http://packages.elastic.co/elasticsearch/1.7.5/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elk.list $ sudo apt-get update && sudo apt-get install elasticsearch -y $ sudo service elasticsearch start 4.Verify if elasticsearch is running $ curl http://localhost:9200 { "status" : 200, "name" : "May \"Mayday\" Parker", "cluster_name" : "elasticsearch", "version" : { "number" : "1.7.5", "build_hash" : "00f95f4ffca6de89d68b7ccaf80d148f1f70e4d4", "build_timestamp" : "2016-02-02T09:55:30Z", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search" } Now it's time to install to more python packages: $ pip install django-haystack==2.4.1 $ pip install elasticsearch After adding them to INSTALLED_APPS: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'haystack', … -
Django Haystack and Elasticsearch- part two
Hello! This is the second part of Django Haystack and Elasticsearch series. First you can find here. Now it's time to install and elasticsearch. On ubuntu you can do it as follows: 1.First install java-8 $ sudo apt-get install python-software-properties -y $ sudo add-apt-repository ppa:webupd8team/java -y $ sudo apt-get update $ sudo apt-get install oracle-java8-installer -y 2.Verify if it's properly installed $ java -version java version "1.8.0_72" Java(TM) SE Runtime Environment (build 1.8.0_72-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode) 3.Now install elasticsearch itself $ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - $ echo "deb http://packages.elastic.co/elasticsearch/1.7.5/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elk.list $ sudo apt-get update && sudo apt-get install elasticsearch -y $ sudo service elasticsearch start 4.Verify if elasticsearch is running $ curl http://localhost:9200 { "status" : 200, "name" : "May \"Mayday\" Parker", "cluster_name" : "elasticsearch", "version" : { "number" : "1.7.5", "build_hash" : "00f95f4ffca6de89d68b7ccaf80d148f1f70e4d4", "build_timestamp" : "2016-02-02T09:55:30Z", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search" } Now it's time to install to more python packages: $ pip install django-haystack==2.4.1 $ pip install elasticsearch After adding them to INSTALLED_APPS: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'haystack', … -
Django Haystack and Elasticsearch- part two
Second part of tutorial about django haystack with elasticsearch.