How to get to the right Django documentation? - django

I'm new to Django. I'm very familiar with Python. We're working with Django 1.8 (I thought with 1.18... this was part of my confusion but by far not all). In most cases I try to find documentation Google sends me to documentation of other versions of Django. This has been quite confusing. With Drupal I can just add d6 or d7 to my search query in Google to get to the right place. Not so with Django it seems.
How do you (experienced Django devs) get to the right page with the right documentation for the version you're working with?
The bottom right corner has a version number. Doesn't really help me to get to the right docs though.

Not all languages have documentation available. For example, 1.8 may not be in Japanese, but 1.9 and 1.10 are (and according to your screenshot, same for Spanish)
The URL at docs.djangoproject.com also has a version chooser, e.g.
https://docs.djangoproject.com/en/1.10/search/?q=filefield
What I do is go to http://docs.djangoproject.com/en/
There's a floating box at the lower right where you can choose the documentation version.
Then on the right sidebar, I click download as HTML to save it locally. No need to worry if you're on the right version now.
BTW there is no 1.18, it's just 1.8!

Related

Is there any way to bookmark a Django "current" documentation page, without version numbers?

The point of this is to keep notes/urls pointing to particular parts of the documentation that people want to refer to in the future. For example, when something is a complex feature that requires a little bit of review most of the times you work with it.
Let's take an example. I search for Django STATICFILES_DIR:
https://www.google.com/search?q=django+STATICFILES_DIRS
Pretty quickly I get exactly what I want:
https://docs.djangoproject.com/en/4.1/ref/contrib/staticfiles/
which has a STATICFILES_DIR configuration entry.
But, notice from the url, this is for Django 4.1. And it says so on the page too.
But maybe there are a current version? Let's look.
There isn't.
Contrast with Python, which points to a very generic, 3 version. Not to Python 3.10 or 3.11.
https://docs.python.org/3/tutorial/datastructures.html#dictionaries
Or postgres (looking for create table):
https://www.postgresql.org/docs/14/sql-createtable.html
OK, yes, I have a version 14, but...
I can click on that current and that will NOT pin me to a particular version.
https://www.postgresql.org/docs/current/sql-createtable.html
In the case of Django, Python and Postgresql, I am pretty confident a generic, version-less documentation page will serve my purposes just fine 90% of the time - those are pretty stable APIs by now.
Often searching gets you to ancient postgresql versions like 9.2, but you can always find a current link.
Am I looking in the wrong places for a permanent link for Django docs?
Yes, there is dev link on the Django versions, but that's living a bit dangerously, I assume people are potentially working updating the docs on the current version on that URL. Or should I use that after all?
Going to use the dev tag for now. Django is stable enough that I expect minimal problems there and I can always go back to my version of interest from there. But at least I don't have bookmarks pointing to a bunch of different historical versions.

Django A/B Split Testing Packages (None I've found are well-documented and up-to-date.)

There are two main schools of thought for doing A/B (Split) Testing:
Javascript-based solutions such as Optimizely, Google Analytics Content Experiments.
Server-side solutions such as Django-AB, Splango, and django-lean. (Also, writing your own.)
My understanding is that Javascript-based solutions are spectacular for "which color button converts better," but not so great for switching out entire page layouts, and completely unworkable for trying out large functional changes such as the sequence of pages in a funnel.
That leads me towards a server-side solution. I'm not crazy about coding my own, and will do so only if there is no other option. I'm trying to add value by improving the core functionality of my site, not by creating a better split-testing framework.
The Django apps I've found for split testing are various mixtures of unmaintained, undocumented, documented incorrectly, and incompatible with Django 1.5. This surprises me, because the Django and Python communities seem to have a strong focus on good documentation. I'm also very surprised that none of the testing frameworks I've tried has been compatible with Django 1.5 -- is testing not as core a part of the philosophy in the Django/Python world as it is in Rails?
Here's what I've found:
Splango https://github.com/shimon/Splango -- Not compatible with Django 1.5 (although most compatibility bugs I found were trivial to fix). Largely un-touched since October 2010, except for a fix August 2012 which claims to make sure templates get included in the install. Since templates don't get included in the install when Splango is installed via PyPI, either the fix didn't work or didn't get submitted to PyPI. Documentation is largely accurate, but doesn't completely cover how to set up tests and get reports. It tells you how to configure the template to gather the data, but there appears to be additional steps required in the admin interface which are completely undocumented, and I'm not sure I've done them properly.
Django-lean. Original at https://bitbucket.org/akoha/django-lean has not been updated since July 2010. There is an apparently "blessed" fork at https://github.com/anandhenry2002/django-lean which has not been changed since May 2012, when it was copied over from the original. The original's documentation is incorrect in ways that make following the examples impossible. (Though you can probably muddle your way through, as I did.) The new version's documentation has formatting problems that make it difficult to read on github. (This appears to be because it's the unchanged documentation from the old project, and BitBucket syntax doesn't work on Github.) The django-lean Google Group has not had a message since July 2012.
django-mini-lean https://github.com/DanAncona/django-mini-lean -- Updated as recently as February 2013, but undocumented.
Leaner - https://bitbucket.org/brianjinwright/leaner -- Last updated July 2012, and no docs.
Django-AB -- Last updated May 2009. Is not a package, and can't be installed via PIP or PyPI. After placing the checkout in my django app folder (and renaming the folder to ab) and following the installation instructions, I get an error loading the template loader that I have not tracked down further.
So far Splango appears to be the winner, as I've actually been able to get it more-or-less working (by manually installing the templates, and then editing them to fix Django 1.5 incompatibilities).
Can anyone point me to anything I've missed?
You have missed this app : https://github.com/mixcloud/django-experiments + https://github.com/disqus/gargoyle/
And then there's waffle: http://waffle.readthedocs.org/
It's simple, updated, maintained, but not very feature rich, it doesn't have any analytics/reporting stuff integrated. But then again, google analytics or mixpanel type of service is better for this.
I first looked at Django-AB and that is almost what I wanted, but I couldn't get it to work either. After looking at django-experiments and deciding I didn't want to mess around with redis yet, I decided to roll my own. I've tried to package it up nicely and make it easy to use for the beginner. It's super basic.
https://github.com/crobertsbmw/RobertsAB
You can swap out entirely different page layouts with Google Analytics Experiments (their default experiment setup will redirect users to a different URL for each variation you have), although in general its much easier to interpret why something is more successful if you test smaller things against each other.
You are right that testing different funnels and user flows against each other using Google Analytics would require a lot of manual setup; although theoretically you could do it by swapping out different links and tracking your users with UTM campaigns.
For smaller A/B tests within the same page, I ended up using Google Analytics Experiments and writing a custom Django CMS plugin for adding a few variant options to a template, which queries the Google Analytics API and displays the correct variant using Javascript.

Django app or middleware for modern brower detection

I've created a Django site that uses Bootstrap from Twitter. I've tested the site on the latest versions of Chrome, FireFox and Safari. It looks really nice. And then we have Internet Explorer (play failure music... wonk, wonk, woooonk). It seems to work ok, but it doesn't look near as nice (e.g. no rounded corners, etc). What I would like is to detect IE and then redirect them to a page that tells them that IE users may experience issues and that it is strongly recommended to use a more-compliant browser. But, unfortunately, I can't force them to not use IE. So, I need to add a flag saying that they've been show the page. Does anyone know of an app/middleware for doing something like this? I've done some googling, but really haven't found anything.
I don't think it would be terribly hard to write, but I would rather not re-invent the wheel.
Version information: Django 1.3.1; Bootstrap 2.0.2 and jQuery 1.7.2
If there's nothing at http://djangosnippets.org that does this (and I doubt there is, TBH), write it - because like you say, it's not hard - and contribute it

Django/Django nonrel + Google App Engine + Tutorial

I'm starting to learn how to use Django on the Google App Engine.
I had search about some introducing tutorials, like this one.
But looks like isn't really updated (November, 2010).
I really appreciate if someone could point to me a good tutorial, updated (to works with the latest stable release of django/django-nonrel and GAE).
(Strange, why the tutorials tag is not allowed?)
I was able to get it up and runnining, with very little Django or App Engine experience, using this:
http://www.allbuttonspressed.com/projects/djangoappengine
The one big difference I would say is grab the source from the django-nonrel github account, which is more recent than the ones indicated in that tutorial
https://github.com/django-nonrel
Note, allbuttonspressed is outdated, use the following:
http://django-nonrel.org/
http://djangoappengine.readthedocs.org/

Compare TinyMCE and CKeditor for a Wiki

For a custom wiki django-wakawaka, i want to be able to add a WYSIWYG support.
TinyMCE is obviously the most popular plugin, used even by Wordpress.
But CK-editor seems more feature full.
Those who have used either of these or both, which is better and why. Are there some better packages, that I am missing?
Is there something that I am missing when I conclude CKeditor is better, by going through them (because it is not as widely used).
I want to use it with django and jquery, with multiple instances of WYSIWYG widget per page. Does one offer advantage over the other.
I spent some time implementing CKEditor in the last couple days. I've implemented TinyMCE in the past as well. On the positive, it's far more consistent and bug-free than TinyMCE... by which I mean, where TinyMCE "feels" buggy, CKEditor has worked around awkward browser behavior to a much greater degree, making it "feel" much more solid. On the negative, if you want to extend it, the documentation is relatively sparse. I think this is mostly because CKEditor is relatively new (its API is very different from FCKEditor), and it would be reasonable to expect the CK 3.0 documentation to reach at least the quality of the FCK 2.0 docs soon.
I've been using both editors since some years ago... Almost always I've chosen CKeditor over TinyMCE.
The reason?
Short answer:
CKEditor is very stable and very easy to use and has integrated the file manager (with an ad, but it is no problem for me), but TinyCE has not any integrated File manager.
Nevertheless, I like JCE editor (for Joomla), this editor is based on TinyMCE and works like a charm. It has a very good implementation of File management.
If you plan to use a WYSIWYG editor for a wiki, any of them are ok, because you don't need a filemanager (I think).
However, I recommend you, based in my experience, CKeditor.
The long answer is very long for this space. If you want the long answer, contact me or google around about this topic.
A cople of other Wysiwyg editors
http://imperavi.com/redactor/ (paid - actively developed)
http://xinha.webfactional.com/ (updated 2010)
http://www.kevinroth.com/rte/ (updated 2010)
http://nicedit.com/ (updated 2008 - small fix 2012)
Because of the fact that my Internship has something to do with the CKEditor. I have been developing a lot with CKEditor the last 4 months. And as my research said: If we Compare TinyMCE and the CKEditor 4.x There aren't any big difference. The only differences are: CKEditor has a smoother layout and design, CKEditor has a lot bigger community (If i remember it right a difference of 13k (35k vs 50k i remember, something like that) and CKEditor has multiple developers. The last argument is an argument that i'm not sure off. But i have been told that TinyMCE is being developed by only 1 or 2 persons and the CKEditor by multiple (and an entire community!)
If you ask me, all in favor for the CKEditor.
The negative point that is stated once above, that the documentation isn't what it is used to be since the new version. I don't really agree. The only thing is that you need to read the API. With JAVA (as example) you won't find a full explanation neither. And the nice thing is that, I and many other persons are posting questions on StackOverflow. This will support all the support you need. And for the basics almost everything is there already!
And if we have a problem, there is always one of the Core developers of the CKEditor to help us out ;)
One big bug of TinyMCE is a when you copy and paste in TinyMCE then it does not manage any space or tab and indent it to the beginning, so TinyMCE is not good but ckeditore is a more powerful editor.