Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22462

Experienced Django: A Few Interesting Recommendations

$
0
0

I want to pass on a couple of recent recommendations that have come my way.

Weekly Python Chat

Weekly Python Chat is run by Trey Hunner who does a weekly live chat covering python topics.

Trey has been doing Django-related topics recently which have been great learning opportunities for me. I especially like the annotations to the video which allow you to skip to the questions you’re particularly interested in.

This resource led me to the next one.

Two Scoops of Django

This book was brought up in one of the Weekly Python Chats. The current version is for Django 1.8, but so far much of the material has been fairly non-version specific. I’m about 5 chapters in and am not only enjoying it, but also learning some good “common practice” advice that is tough to get when you’re working on your own projects.

From this book, I’ve found the cookiecutter app to generate various types of applications boilerplate structure (proper layout of project, Readme files, etc) in various languages. This might be applicable well beyond my python/Django tasks.

This book also led me to the next topic.

virtualenvwrapper

virtualenvwrapper is a handy little tool which extends the functionality of virtualenv and makes it easier to use across multiple projects.

In the first of my KidsTasks posts, I walked through the project setup using virtualenv. I hope for my next project to use cookiecutter and virtualenvwrapper to simplify and “normalize” the layout of the directories.

requirements.txt

Finally, a quick tip I pulled from one of Daniel Bader’s code reviews. I did not know that you can use a requirements.txt file to list the dependencies for your project and then use pip to install them. This, married with virtualenvwrapper makes creating virtual envs that match any given project much easier.

The syntax for the requirements.txt file is quite simple:

RtmAPI==0.6.0
Django==1.10.0

Running pip is, similarly, quite simple.

$sudo pip install -r requirements.txt
 Requirement already satisfied (use --upgrade to upgrade): RtmAPI==0.6.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
 Downloading/unpacking Django==1.10.0 (from -r requirements.txt (line 2))
 Downloading Django-1.10-py2.py3-none-any.whl (6.8MB): 6.8MB downloaded
 Installing collected packages: Django
 Successfully installed Django
 Cleaning up...

That’s it for recommendations. Feel free to add your cool tricks and recommendations below!


Viewing all articles
Browse latest Browse all 22462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>