Top products from r/django

We found 32 product mentions on r/django. We ranked the 32 resulting products by number of redditors who mentioned them. Here are the top 20.

Next page

Top comments that mention products on r/django:

u/AntiMS · 5 pointsr/django

James Bennett, Django release manager and author of Practical Django
Projects
, in a lecture he gave at PyCon 2009 suggested five criteria for writing Django apps:

Do one thing and do it well. This is known as one of the main points of the Unix Philosophy. Basically, it means that every Django app should have exactly one function or feature, and this function should be narrowly defined. For instance, instead of a blogging app, you'll want (depending on your feature requirements) one app for the WYSIWYG interface, one for writing and viewing blog entries, one for handling the archives interface, one for the tag cloud, one for user comments, and one for the captcha.

Don't be afraid of multiple apps. It's a good thing to have lots and lots of apps in your project. In general, I'd recommend erring on the side of too many apps rather than too few.

Write for flexibility. Write your apps so that they can be used without being forked. If you're writing an app to allow users to make comments on an object, it shouldn't be necessary for you to modify your app in order to allow the users to have avatars. This may mean you'll have to go to a bit of extra "trouble" to make such additions possible, but that "trouble" will pay off in the end.

Build to distribute. If you write your app as if other developers are going to use it, you get several benefits including a cleaner API, better documentation, and generally higher quality code.

Extend carefully. If you think of a new feature, think hard before you add it to an existing app. First ask yourself if the new feature fits within the defined purpose of the existing app. If it doesn't, then the new feature almost definitely belongs in a new app. For instance, if you write an app for users to leave comments and it later becomes apparent that you might need to have a captcha when users leave comments, first ask yourself if a captcha is strictly part of the definition of your comment app. In this case, the answer is a pretty resounding "no". So, write (or obtain) an app for captchas and "plug it in" to your app. (Pro tip: if your app isn't flexible enough to allow the addition of a new feature by adding a new app, then that's an indication that you're not fully following the third directive. In such a case, you should "retrofit" your existing app with additional flexibility which allows you to accomplish your goals, but you should not add any code to your old app which is specific to your new function. So, in the case of the commenting/captcha example, you could change your comment app so that the django.forms.Form subclass users use to make a comment could be overridden by another app, write a captcha app which defiens a django.forms.fields.Field subclass CaptchaField, and write a glue app which defines a new django.forms.Form subclass with the necessary field for writing a comment as well as a CaptchaField. Magic.)

James Bennett has another talk on the subject (perhaps another version of the same talk. I'm not sure.) on YouTube. It might be worth it to give it a watch: http://www.youtube.com/watch?v=A-S0tqpPga4

Good luck, and happy hacking.

Edit: Formatting.

u/dynamowku · 7 pointsr/django

Like those before me, I had been doing the same thing. It's a practice I borrowed from the 2 Scoops of Django book.

It's served me well and I think it's fine to do this, but in a recent project I started using the project django-configurations which has also been pretty nice to use. It allows me to create individual python modules (common, local, staging, production, etc.), but where it's completely different is each module contains a class-based representation of the settings your'e interested in. Each non-common/base configuration (like staging) would inherit from the common class. It's quite nice in my opinion and recommend a look to see if it works for you.

EDIT: By the way, I discovered django-configurations via setting up my initial Django projects using django-cookiecutter and using the cookiecutter-django template. Take a look at their requirements files to see the load of stuff they start you off with. There's serious efficiency boosters in there that I've been using a lot lately and makes my life a bit easier once you get the hang of it all. Hope that helps!

u/supra621 · 1 pointr/django

For HTML/CSS/JavaScript/jQuery, Jon Duckett's books are pretty good. I linked the set because individually they're about $23, and together it's $28. His is the only JavaScript book in my library. I found his books to be well-ordered, and he describes things in really simple ways, though the book layout feels like reading House of Leaves until you get used to it. Both books have made for great references, though free HTML/CSS tutorials are quite abundant, and I leaned on Google more than the book for learning those.

I can't recommend the Django book that I started with, "Mastering Django: Core" by Nigel George, as much of the advanced topics were no better explained than the official documentation. If you're using Django 2.0, forget it. This, and other Django books I've looked at, don't go into any front-end details, seemingly from a belief that "writing Python code and designing HTML are two different disciplines" (quoted straight from the book I linked). The official docs and web tutorials have served me better for bringing Django to the browser.

Aside from d3.js, I'm only using basic JS and jQuery. d3.js was a very specific use-case for the data I'm working with, as it excels at making graphs and charts using SVG. If that sounds like something you're doing, Interactive Data Visualization for the Web was pretty clear for d3.js. Note that d3.js only uses a minimal amount of traditional JavaScript, so do consider your project needs before dropping $40 on it.

The basics of JS and jQuery will go a long way, even without react/angular/vue.js. Just like my first statement about HTML/CSS, I'd say learn the other frameworks when you can no longer do what you want with JS/jQuery, or when a framework is going to save you time.

Sorry for the wall of text - hope that helps!

u/druski · 1 pointr/django

There are a few basic ways of customizing the display of form fields.

Without using outside packages

  1. Pass an attrs dictionary to the form field, ex name = forms.TextInput(attrs={'class': 'myclass',}) see here for documentation https://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.attrs

  2. Alternately, for even more fine control you can skip using the built in form renderers, {{form.as_p}} {{form.as_table}}, and override the form template completely, see here https://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template

    Using 3rd party packages

  3. Crispy forms lets you do very advanced layout control, including full support for bootstrap all in python, check out https://github.com/maraujop/django-crispy-forms.

  4. Widget tweaks gives you some template tags to make overriding the indvidual templates easier, see https://github.com/kmike/django-widget-tweaks


    I recommend that you do use django forms, as they are quite easy to use and handle all of the validation for you (use required=True on each field, and you are done for the simple 'not blank' checking you mentioned). I'd start with just setting the class in the attrs dict if your needs are simple, and if you have more complex needs, check out crispy forms. I quite like that package.

    The excellent Two Scoops of Django 1.6 book covers forms quite well, if you are familiar with the basics of Django and want expert advice on best practices I highly recommend it. Available on amazon.


    Edit: actually I may have misread your post, if you are just talking about adding css to the form tag itself, that is simply as described here https://docs.djangoproject.com/en/dev/topics/forms/#displaying-a-form-using-a-template:

    <form action="/contact/" method="post" class='myclass'>
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="Submit" />
    </form>
u/dsizemore · 2 pointsr/django

Thanks, I appreciate that. I started doing front end stuff probably 12 years or so ago right when I was finishing college. I got started with these two books:

http://www.amazon.com/CSS-Mastery-Advanced-Standards-Solutions/dp/1430223979

http://www.amazon.com/Bulletproof-Web-Design-flexibility-protecting/dp/0321509021

That's about it, really. I do browse some of the top blogs and try to find inspiration though and see what kind of layouts everyone is doing these days.

I'm guessing they're pretty outdated right now though. Aside from that, I just try to not over complicate things in the design and keep it as simple as possible. I'm not someone who's going to spend hours designing some award winning illustration for the website header; I just try to pick a nice color palette (usually two at most three colors) and then lay out the site with some common sense. One big thing I've found is ensure you're using enough padding/margins. I think too many times people only have 5 or 10px between elements and it makes it really difficult for your eyes to flow over the site. That's just my opinion though.

Hope that helps.

u/sudipkafle · 8 pointsr/django

Here are a couple of things I would recommend anyone diving in more depth into Django:

  • Learn about Class Based Views. You are going to implement them most of the time in projects.
  • Implement Test Driven Development on your new projects. Here's a nice book on TDD with Django which is available online for free.
  • Go though the book 2 scoops of Django to know about best practices.
  • Implement best practices like - multiple requirements.txt and settings.py for production and local, using named urls and reverse, profiling with tools like Django Debug Toolbar.
u/TailoredBeats · 8 pointsr/django

There's no reason that data rich applications can't be rendered server side. It just takes a little bit more thought. Basecamp is a Rails app but it's a great example. I'd look into how it is setup and see if you can't replicate that using Django. I know that you can use the Turbolinks library that they use with Django it just requires a Middleware to set the headers it requires. You might also pick up Two Scoops of Django and read the sections on templating best practices.

u/eIix · 2 pointsr/django

Good job, works great!
I recommend getting into the habit of writing tests as you develop your applications, this book is a really good resource for that: www.amazon.com/Test-Driven-Development-Python-Harry-Percival/dp/1449364829

u/esdio · 7 pointsr/django

I really enjoyed the Two Scoops of Django book. It's very well written and covers some of the newbie things that are a little hard to google, like how to organize your project directory.

Why don't you try creating a blog or some other django project just for yourself and see how far you get?

u/Jazztoken · 3 pointsr/django

Slightly outdated, but you need Two Scoops of Django. It established this and many, many other great practices.

u/johninbigd · 1 pointr/django

I've heard great things about this book:

https://www.amazon.com/Mastering-Django-Core-Complete-Guide/dp/099461683X

I have it but haven't had a chance to dig into it yet, so I can't really comment. What I've read so far is good, but I'm not very far into it.

u/AeroNotix · 7 pointsr/django

Looking at your posting history you really need to pick up a book or two. Very unfocused learning going on here.

OpenShift is probably the most unusual way of deploying or learning how to deploy Django. This is confounding your learning troubles. Omit OpenShift.

If you already know Python, skip this one, but at least think about it: Learning Python. Then.

Pick up Two Scoops of Django. Learn it, read it. All. Local. Do not use a "real" database, use SQLite. Do not think about deploying at all.

Once you're comfortable with Django. Experiment with understanding what a database actually is, how it works and how to administer it, how to configure it. How to configure it with Django. Use something other than MySQL, which invariably means Postgres.

Once this is done and I mean done. Only then is it time to think about how to get deploying Django. Use a VPS, do not use a magical "we'll do it all for you" thing. It's just clouding too much for you to clearly understand what's going on. It's hindering learning. Omit things which cloud understanding.

u/krumg · 1 pointr/django

I don't really get how it could give any relevant information: for instance when I searched for "laptop" it gave me an old HP as #1 and a Chromebook as #2. Then I tried "laptop for development" and the best choice for me became some toy (VTech Light-Up Baby Touch Tablet, Pink). What's the point?

u/souldeux · 1 pointr/django

Yeah, absolutely! Feel free to PM me anytime.

Also, I'd highly recommend picking up a copy of Two Scoops of Django 1.6 if you've got $35 lying around. Even though we're in 1.7 now, the info in that book is pure gold.

u/il_doc · 2 pointsr/django

Two Scoops of Django by /u/pydanny is kind of a bible of django best practices

also, read the code of djangoproject.com and look at their app structure

u/BobBeaney · 1 pointr/django

I know that it’s not on your list but you may want to consider Test Driven Development with Python. It discusses all sorts of real world practicalities in setting up a web application using Django. I’m working my way through it but I wish I’d known a little Django first.

u/jawn- · 2 pointsr/django

Noone has mentioned it yet but hands down the best django book is Marty Alchin's Pro Django.

It might not be the best for a person new to programming, or new to MVC style frameworks. If you have some experience it will really transform the way you look at both django and python. I can't recommend it enough.

http://www.amazon.com/Pro-Django-Experts-Voice-Development/dp/1430210478/ref=sr_1_1?ie=UTF8&qid=1331608592&sr=8-1

u/igncampa · 5 pointsr/django

I have come to learn in my self-teaching journey that once you start looking for "more than the basics", it's time to start working on a project you will go hard at, and as you continue to make progress and come up with new ideas, new questions will arise, more problems and roadblocks will show up and by solving those is how you go beyond the basics.

That has been my approach though, there might be a magical recipe out there. In any case, people will probably recommend Two Scoops of Django. I, however, haven't read the book.

u/asdfasdfasdf1212asd · 3 pointsr/django

I wonder why nobody mentioned mixins?
Make your models DRY and inherit!

blogpost

Two Scoops of Django The book treats the topic nicely.

u/dAnjou · 8 pointsr/django

Simply start by writing tests for each HTTP endpoint and check the content of the response.

Maybe check out Michael Feathers' Working Effectively with Legacy Code too.

u/TalosThoren · 2 pointsr/django

A properly implemented deployment cycle should be a press-button operation. Every environment, including production, should be able to be updated (and rolled back if necessary) unattended and automatically.

I highly recommend this book to anyone presently babysitting deployments.

u/xrayfur · 2 pointsr/django

There's this book which figuratively speaking tears Django apart called Lightweight Django might help integrating a Mongo ORM to Django.

u/marcoscoder · 1 pointr/django


Have you seen this book? (https://www.amazon.com/dp/1430258543/) I read the 3 or 4 first chapters of it, and I remember that it has these topics (http server / client, cache and other related stuff), maybe I should go for it and learn a little more from python (I think in the fluent python book) .