What's new in Django community blogs?

Remi and EPEL repositories in CentOS

Aug 27 2015 [Archived Version] □ Published at Programmer blog under tags  add centos epel howto install

There are 2 common repositories that come nowdays for centos. They contain tasty things, while they are absent in official repositories.

CentOS 5:
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
sudo rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

CentOS 6:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

You can check you are successful like so:
ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo

Now you are only left to activate Remi repository:
sudo vi /etc/yum.repos.d/remi.repo

In [remi] section we need to change enabled=0 into enabled=1. It will look like so:
[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Only need to update now:
yum update -y


















JavaScript is eating the world

Aug 26 2015 [Archived Version] □ Published at TravisSwicegood.com

Ok, not really, but JavaScript is the best place to start programming. I can hear the sound of the “true” programmers whipping their noses into the air as they read that last sentence, but hear me out.

JavaScript started as this quick hack to add a little bit of inteactivity that was needed for the browser, but now it’s deployed around the world on several billion devices. And it’s not a bad language. All languages have their quirks and those that do type conversion like JavaScript – 2 + “2” anybody? – have their share plus some but it’s a solid language to start. Why, you ask? Read on for my take.

Ease of deployment for testing

When you’re starting out, getting your code to run somewhere is the hardest part. That was the appeal of PHP. Write your code, copy it via FTP to your server, reload your page. The whole idea of starting a server is simple to us programmers who have done this for awhile, but not to someone starting out. That increased the cost of entry for tools like Rails and Django. You had to have a mental model for how you loaded your code. For PHP you wrote a file, you put a file on a server, you loaded that file through the server. You were done. With JavaScript it’s even easier.

  1. Save your file to your computer
  2. Refresh your browser
  3. There is no step three, you’re already looking at the result

Rise of JavaScript on the server

Server-side JavaScript wasn’t created by Node, but Node was the first thing to make it usable and fast. Taking the same skills you use to interact with events from a user and making those interact with events from a database or a caching layer means one less thing you have to learn. Yes, deployment of that application is a bit more involved than working with the browser, but you’re learning about deployment, not deployment and a new framework and a new language.

The other thing that’s often discounted by folks in the development community is how important native Windows support is. Yes, you can run Python or Ruby or PHP on Windows, but the thought of deployment is nearly laughable. The thing that makes Node a killer platform is that you can run and deploy it inside the enterprise without having to change all of your computers.

JavaScript is here to stay. Even if only a target for other languages like CoffeeScript or TypeScript. It’s a great language to start with since it’s situated right in the middle of the web development stack – that space between design and backend development. It’s easy to get started but challenging to truly master. And it runs on just about every computing device created in the past decade.


aristotle-metadata-registry

Aug 26 2015 [Archived Version] □ Published at Latest Django packages added

Aristotle-MDR is an open-source metadata registry as laid out by the requirements of the ISO/IEC 11179 specification.


django-spaghetti-and-meatballs

Aug 26 2015 [Archived Version] □ Published at Latest Django packages added

Its a spicy meatball for serving up fresh hot entity-relationship diagrams straight from your django models.


Easy maintainance: script that prints out repair steps

Aug 25 2015 [Archived Version] □ Published at Reinout van Rees' weblog under tags  django nelenschuurmans python

At my work we have quite a number of different sites/apps. Sometimes it is just a regular django website. Sometimes django + celery. Sometimes it also has extra django management commands, running from cronjobs. Sometimes Redis is used. Sometimes there are a couple of servers working together....

Anyway, life is interesting if you're the one that people go to when something is (inexplicably) broken :-) What are the moving parts? What do you need to check? Running top to see if there's a stuck process running at 100% CPU. Or if something eats up all the memory. df -h to check for a disk that's full. Or looking at performance graphs in Zabbix. Checking our "sentry" instance for error messages. And so on.

You can solve the common problems that way. Restart a stuck server, clean up some files. But what about a website that depends on background jobs, run periodically from celery? If there are 10 similar processes stuck? Can you kill them all? Will they restart?

I had just such a problem a while ago. So I sat down with the developer. Three things came out of it.

  • I was told I could just kill the smaller processes. They can be re-run later. This means it is a good, loosely-coupled design: fine :-)

  • The README now has a section called "troubleshooting" with a couple of command line examples. For instance the specific celery command to purge a specific queue that's often troublesome.

    This is essential! I'm not going to remember that. There are too many different sites/apps to keep all those troubleshooting commands in my head.

  • A handy script (bin/repair) that prints out the commands that need to be executed to get everything right again. Re-running previously-killed jobs, for instance.

The script grew out of the joint debugging session. My colleague was telling me about the various types of jobs and celery/redis queues. And showing me redis commands that told me which jobs still needed executing. "Ok, so how do I then run those jobs? What should I type in?"

And I could check serveral directories to see which files were missing. Plus commands to re-create them. "So how am I going to remember this?"

In the end, I asked him if he could write a small program that did all the work we just did manually. Looking at the directories, looking at the redis queue, printing out the relevant commands?

Yes, that was possible. So a week ago, when the site broke down and the colleague was away on holiday, I could kill a few stuck processes, restart celery and run bin/repair. And copy/paste the suggested commands and execute them. Hurray!

So... make your sysadmin/devops/whatever happy and...

  • Provide a good README with troubleshooting info. Stuff like "you can always run bin/supervisorctl restart all without everything breaking. Or warnings not to do that but to instead do xyz.
  • Provide a script that prints out what needs doing to get everything OK again.


Tmux quick start guide

Aug 25 2015 [Archived Version] □ Published at Programmer blog under tags  advanced beginner command complex dive

Tmux is a handy terminal manager that allows you to switch between terminal sessions easily. Without losing history or windows upon ssh disconnects or similar. It is like screen, just better. (First of all because of using client-server based technology... )

Here is my minimal keyboard shortcuts guide that allows you to start using Tmux in a blink of an eye. Endless advanced commands and hotkey combinations you could always find by entering "man tmux" in a terminal.

Tmux is installed quite easily in most of common linux based systems. Just type:
Ubuntu:
$ sudo apt-get install tmux
CentOS:
$ sudo yum install tmux

This allows you to start using by starting it with
$ tmux a || tmux new
This command first tries to attach to existing running tmux instance and creates new in case it is not found.

Ctrl+b d - Will allow you to disconnect at any time. (This is also a way it is happening when you loose ssh session. How to connect - look earlier)


Each session can have many windows:
Ctrl+b c - Create a new window.
Ctrl+b 0...9 - switch to window #;
Ctrl+b p - switch to previous window;
Ctrl+b n - switch to next window;
Ctrl+b l - switch to next active window (to the one you have switched from to this window);
Ctrl+b & - close this window (Or just type exit in terminal.

One terminal can have multiple windows:
Ctrl+b % - splits current panel in part, vertically;
Ctrl+b " - splits current horizontally;
Ctrl+b →←↑↓ - switch between panels;
Ctrl+b x - close current panel (you could also type exit in a terminal window).

Minus is a scrolling behavior:
Ctrl+b PgUp - enters "copy mode", afterwards:
    PgUp, PgDown - scrolling;
    q - exit copy mode.

Good more complex gist of hotkeys also here:
HOTKEYS GIST


fluentcms-link

Aug 25 2015 [Archived Version] □ Published at Latest Django packages added


New Course: Getting Started With Django

Aug 25 2015 [Archived Version] □ Published at tuts+

Final product image
What You'll Be Creating

If you like the elegance of the Python programming language, Django is the web framework for you! Django is a powerful but pragmatic framework, with an emphasis on getting work done.

In Getting Started With Django, you'll learn how to write web applications using the Django framework. Tuts+ instructor Derek Jensen will teach you the basics of Django by helping you build a simple chore list application.

The Django app youll be creating

You can take our new course straight away by subscribing to Tuts+. For just $15 a month, you get access to this course and hundreds of others, with new ones added every week.


Django Redis Views

Aug 24 2015 [Archived Version] □ Published at Latest Django packages added


Runs on python 3: checkoutmanager

Aug 24 2015 [Archived Version] □ Published at Reinout van Rees' weblog under tags  django python

Checkoutmanager is a five-year old tool that I still use daily. The idea? A simple ~/.checkoutmanager.cfg ini file that lists your checkouts/clones. Like this (only much longer):

[local]
vcs = git
basedir = ~/local/
checkouts =
    git@github.com:nens/syseggrecipe.git
    git@github.com:buildout/buildout.git
    git@github.com:reinout/reinout-media.git
    git@github.com:rvanlaar/djangorecipe.git

[svn]
vcs = svn
basedir = ~/svn/
checkouts =
    svn+ssh://reinout@svn.zope.org/repos/main/z3c.recipe.usercrontab/trunk

In the morning, I'll normally do a checkoutmanager up and it'll go through the list and do svn up, git pull, hg pull -u, depending on the version control system. Much better than going though a number of them by hand!

Regularly, I'll do checkoutmanager st to see if I've got something I still need to commit. If you just work on one project, no problem. But if you need to do quick fixes on several projects and perhaps also store your laptop's configuration in git... it is easy to forget something:

$ checkoutmanager st
/Users/reinout/vm/veertien/efcis-site
 M README.rst

And did you ever commit something but forgot to push it to the server? checkoutmanager out tells you if you did :-)

Porting to python 3. The repo was originally on bitbucket, but nowadays I keep having to look all over my screen, looking for buttons, to get anything done there. I'm just too used to github, it seems. So after merging a pull request I finally got down to moving it to github.

I also copied over the issues and added one that told me to make sure it runs on python 3, too. Why? Well, it is the good thing to do. And... we had a work meeting last week where we said that ideally we'd want to run everything on python 3.

Two years ago I started a django site with python 3. No real problems there. I had to fix two buildout recipes myself. And the python LDAP package didn't work, but I could work around it. And supervisord didn't run so I had to use the apt-get-installed global one. For the rest: fine.

Recently I got zest.releaser to work on python 3 (that is: someone else did most of the hard work, I helped getting the pull request properly merged :-) ). For that, several test dependencies needed to be fixed for python 3 (which, again, someone else did). Checkoutmanager had the same test dependencies, so getting the test machinery to run was just a matter of updating dependencies.

What had to be done?

  • print 'something' is now a function: print('something'). Boring work, but easy.

  • Some __future__ imports, mostly for the print function and unicode characters.

  • Oh, and setting up travis-ci.org testing. Very easy to get both python 2.7 and 3.4 testing your software that way. Otherwise you keep on switching back/forth between versions yourself.

    (There's also 'tox' you can use for local multi-python-version testing in case you really really need that all the time, I don't use it myself though.)

  • Some from six.moves import xyz to work around changed imports between 2 and 3. Easy peasy, just look at the list in the documentation.

  • It is now try... except SomeError as e instead of try... except SomeError, e. The new syntax already works in 2.7, so there's no problem there.

  • The one tricky part was that checkoutmanager uses doctests instead of "regular" tests. And getting string comparison/printing right on both python 2 and 3 is a pain. You need an ugly change like this one to get it working. Bah.

    But: most people don't use doctests, so they won't have this problem :-)

  • The full list of changes is in this pull request: https://github.com/reinout/checkoutmanager/pull/9 .

  • A handy resource is http://python3porting.com/problems.html . Many common problems are mentioned there. Including solution.

    Django's porting tips at https://docs.djangoproject.com/en/1.8/topics/python3/ are what I recommended to my colleagues as a useful initial guide on what to do. Sane, short advice.

Anyway... Another python 3 package! (And if I've written something that's still used but that hasn't been ported yet: feel free to bug me or to send a pull request!)


Your Django Story: Meet Michela Ledwidge

Aug 24 2015 [Archived Version] □ Published at Django Girls Blog

This is a post in our Your Django Story series where we highlight awesome ladies who work with Django. Read more about it here. 

Michela Ledwidge is an artist and director redefining the space between cinema and games. In 2004 she won a NESTA Invention award for ‘remixable film’, which outlines her vision for playful storytelling and digital culture and continues to underpin her artistic practice. She is co-founder of studio Mod and has been both the creative and technical lead on numerous productions.

 

How did your story with code start?

My dad bought a Commodore 64 and some copies of Compute’s Gazette magazine home in the mid-80s that I was expressly forbidden to use without permission. Mucking around with computers was elevated to a more attractive illicit activity than it would otherwise have been. This was back in the day when full source code could be printed in magazines. My first “coding” was covert typing in of pages and pages of BASIC to get a new game. At primary school we did some LOGO (Turtle Graphics on the Apple IIe) but once puberty kicked in I abandoned coding. It wasn’t until university that I got back into coding. I ended up majoring in Computer Science and French as part of an Arts Degree. This was 1993 and my honours thesis “Cruising and Creating with WHype” involved writing a (very rudimentary) web browser/editor and publishing the first website in NSW.

 

What did you do before becoming a programmer?

As a ten-year old? Not that much.

 

What do you love the most about coding?

I subscribe to hypertext pioneer Ted Nelson’s school of thought, that software is a branch of film-making. As a director, my process involves writing words, music and code. I love the creative process of turning ideas into art and functionality. Being able to develop your own ideas can be very empowering. I’m a lifelong student of digital culture. It’s a fascinating story.

 

Why Django?

I’ve been using Django since 2009 after switching from Turbogears. What attracted me was the larger user base and “batteries included” functionality like the admin interface. I’m not a full-time developer so I place great value on stable frameworks that support quick and dirty prototyping.

 

What cool projects are you working on at the moment/planning on working on in the near future?

My day job is creative and technical director at studio Mod. We create interactive entertainment that sits between cinema and video games and often incorporate live experience. Django is a core component of our production management product Rack&Pin which powers all our shows. Our immersive interactive video show ACO Virtual lets the audience remix the Australian Chamber Orchestra and set a new benchmark for high performance video off a single PC. The show is 2 years into a 4 year tour - currently showing at Gataker’s Artspace and Gladstone Art Gallery. We’re in production on a new show - an immersive “on board” experience for the Australian National Maritime Museum’s destroyer-class warship and submarine. I’m using Django to direct an experience across 30+ hidden computers in a process I’m calling augmented set design.

 

What are you the most proud of?

I’m most proud of our little studio Mod which is now five years old. It’s a very tough business environment to operate in but we’ve done some exciting work with media and technology. I find it very satisfying and a privilege to lead fabulous multi-disciplinary teams.

 

What are you curious about?

I’m curious about how the traditional screen industry and interactive entertainment will evolve. I’m very curious as to how we can increase digital literacy for women and get more people coding, writing, directing and producing in this space.

 

What do you like doing in your free time? What’s your hobby?

Watching comedy. Playing games. Bushwalking.

 

Do you have any advice/tips for programming beginners?

Pick a subject that you’re passionate about and look at how programming can help. There are lots of excellent general purpose tutorials out there (including the djangogirls one!) but nothing is more satisfying that coding something personal that you and your network find beautiful and/or useful.

Thanks Michela! :)


image

Anna Ossowski

@OssAnna16


django-url-shortener

Aug 21 2015 [Archived Version] □ Published at Latest Django packages added

A Django URL shortening application, with the ability to create custom short URLs


dotulu

Aug 21 2015 [Archived Version] □ Published at Latest Django packages added


Deploying a Django App with mod_wsgi on Ubuntu 14.04

Aug 20 2015 [Archived Version] □ Published at Dinesh Ram Kali. » Django under tags  django mvc python ubuntu web framework

via Deploying a Django App with mod_wsgi on Ubuntu 14.04. Django is a free, open-source, Python-based web framework. Django follows the MVC architectural pattern, with special emphasis on creating your applications rapidly. In recent times, Django has become a popular choice for creating web applications. Popular services like Instagram, Bitbucket and Pinterest were developed using …


django-handlers

Aug 20 2015 [Archived Version] □ Published at Latest Django packages added


django-planet aggregates posts from Django-related blogs. It is not affiliated with or endorsed by the Django Project.

Social Sharing

Feeds

Tag cloud

admin administration adsense advanced ajax angularjs apache api app appengine app engine apple application security aprendiendo python architecture articles asides audrey authentication automation backup bash basics binary bitbucket blog blog action day blogging book books buildout business cache capoeira celery celerycam celerycrawler challenges chat cherokee choices class-based-views cliff cloud cms code codeship coding command community computer computing configuration continuous deployment continuous integration couchdb coverage css custom d data database databases db debian debugging deploy deployment deployment academy design developers development devops digitalocean django django1.7 djangocon django-nose django-readonly-site django-rest-framework django-tagging django templates django web framework tutorials documentation dojango dojo dotcloud dreamhost dughh easy_install eclipse education elasticsearch email encoding english error events extensions fabric facebook family fashiolista fedora field file filter fix flash flask form forms frameworks friends fun gae gallery games geek general gentoo gis git github gmail gnome google google app engine guides gunicorn hack hackathon hacking hamburg haskell heroku holidays hosting howto how-to how-tos html http i18n image imaging indifex install installation intermediate internet ios iphone java javascript jobs journalism jquery json justmigrated linear regression linkedin linode linux login mac machine learning mac os x math memcached mercurial meta migration mirror misc model models mod_wsgi mongodb months mozilla multi-language mvc mysql nelenschuurmans newforms news nginx nodejs nosql ogólne openshift opensource open source open-source orm osx os x ottawa paas packages patterns pedantics pelican performance personal philosophy php pi pil pinax pip piston planet plone plugin pony postgis postgres postgresql ppoftw presentation private programmieren programming programming & internet project projects pycon pygrunn pyladies pypi pypy python python3 quick tips quora rabbitmq rails rant ratnadeep debnath redis refactor release request resolutions rest reusable app review rtnpro ruby scala scaling science screencast script scripting security server setup simple smiley snaking software software collections software development south sphinx sql ssh ssl static storage supervisor support svn sysadmin tag tag cloud talk nerdy to me tastypie tdd techblog technical technology template templates template tags test testing tests tip tools tornado transifex travel tumbles tutorial tutorials twisted twitter twoscoops typo3 ubuntu uncategorized unicode unittest unix use user authentication usergroup uwsgi uxebu virtualenv virtualenvwrapper web web 2.0 web application web design & development webdev web development webfaction whoosh windows wordpress work workshop yada znc