Django Admin Interface design is different - django

The django version is 1.9.2.
I have my website on two different servers ( the same website) the problem is that the Django admin interface on the first server is different from that on the second here are some screenshots of the two copies of the admin website

Before upgrading to a new Django version it is smart to read the release notes. Not only the release notes of the target but all versions in between. That way you know what you are going for.
1.9 introduces new styling see: https://docs.djangoproject.com/en/1.10/releases/1.9/#new-styling-for-contrib-admin
New styling for contrib.admin
The admin sports a modern, flat design with new SVG icons which look perfect on HiDPI screens. It still provides a fully-functional experience to YUI’s A-grade browsers. Older browser may experience varying levels of graceful degradation.
You run your website on two different machines each with another Django versions installed. By deploying to a new server with newer Django you 'unknowingly upgraded'. Inspect the version you are using with:
$ python manage.py version
Downgrade Django to get your old admin style back.

The design of the Django admin has changed in the 1.9 release. If you think you have upgraded both projects to Django >= 1.9, you must check your requirements, since the first one clearly still runs with Django 1.8 or less.

Related

Where are the docs for older Django versions?

As of this year Django core devs removed docs for Django versions older than 1.7 from https://docs.djangoproject.com/.
Unfortunately, there’re still apps using older Django versions in the wild, such as the project I’m currently busy upgrading.
Googling variations of “django 1.5 docs” gives links to unfamiliar domains such as django-doc-test1.readthedocs.io and django-document-tchinese.readthedocs.io, and a PDF under media.readthedocs.org.
I’m looking for hosted navigable Django 1.5–1.6 documentation, preferably in HTML, is that still a thing? Any options apart from building the docs myself from source?
The docs for Django 1.4, 1.5 and 1.6 were removed from the official docs.djangoproject.com site in February 2016. See this discussion on the django-developers website for more details.
You can still view the docs for Django 1.4 and later on readthedocs.
For earlier versions of Django, you can view the source files on GitHub (for example, Django 1.3), but if you need html versions, you'll have to try building them yourself.

Django, appengine and Django-nonrel

I want to create a web app using Django 1.5 or 1.6 using appEngine. I have read about as I have to do it and I have read about Django-nonrel which is very usefull to avoid the issues related with non-relational Database. Unfortunately I have read about the origininal creators project and they have left the project:
GoodBye
However I have seen new avaiables versions of Django AppEngine wich allow to use the 1.4 and 1.5 versions of Django
https://groups.google.com/forum/#!topic/django-non-relational/I06693ZPeME
After I have read every text I am a mess, do anyone redomended me use last version of django non-rel? can I use other framework? don't I use the last verion of Django?
Thank you.
I have developed a fairly complex web app using "normal" Django, not the non-rel flavour. For database storage I use Google Cloud SQL which is basically MySQL in the cloud. It works pretty good. There are some points to consider:
Google Cloud SQL has no "free plan", so it will incur a cost on your project.
Normal Django for GAE is currently at version 1.4 and lags a bit behind development which is if memory serves me right at 1.6. There is a version 1.5 of Django that comes with the GAE SDK but I did not get that work (I did not put any particular effort in it, just changed the Django version in my app.yaml file and it crashed).
As for the first bullet, there's now also a comparable product available from Amazon. I have not yet looked into it (I believe they do offer a free plan which might be interesting to try out), nor compared prices but that might be an alternative should Google Cloud SQL be too expensive. My yearly cost for Google Cloud SQL are between £150 and £200 which is not too bad.
My reason for choosing normal Django over non-rel was basically twofold:
The non-rel project appears abandoned.
The non-rel product is "crippled" in functionality according to some of the docs I read about it and you will not be able to use all of the pre-baked goodies of Django.
I have been working on this project for 7 months now and I find Django on GAE with Google Cloud SQL very stable and productive environments. FWIW, I use PyCharm which has a one click deployment feature which makes deploying my product an absolute breeze. I've been working on IT projects with various technologies for quite some time and the combination of PyCharm, Python, Django, GAE and Google Cloud SQL would be at the top of my list of productive environments.
Of course there are other Python frameworks to consider, like Flask which allow more of a best-of-breed approach but I have no experience with them.
Hope this helps.
I'm using django-nonrel 1.4, though I haven't updated to the latest build yet. It's running smoothly for me.
You do need to recognize that if you use django-nonrel, you have to live by the rules of the GAE HRD, especially the eventually consistent results, and the limited query capabilities.
Django-nonrel is definitely not abandoned! I am using the 1.6 version with much success at Docket Alarm and it is still being actively maintained.
Here are the up-to-date links to the project:
Docs
GitHub
Discussion group

Django on GAE: use_library vs Django-nonrel

I am really new to the world of App Engine development and I want to start with a test project on Django and GAE. I've done some research and found out that there are two major ways to use Django in my app on GAE.
Django-nonrel + djangoappengine
use_library() to load Django from SDK
Please tell about pros and cons of each way.
Is there anything better than django-nonrel if i will decide to distribute Django code with my project?
It's not a matter of two different ways to use Django - it's two different versions of Django. App Engine comes bundled with versions 0.96, 1.0 and 1.1 of Django, unmodified from the mainline release. Django-nonrel is a branch of Django, which adds support for App Engine for the database backend.
If you're writing a new app, and you want to use Django for the whole app, including the models, you should use Django-nonrel.
When using django-nonrel you can use all Django features (including admin, auth, models, queries). I don't have a complete list of django modules which are either not working or partly not working in app engine.
If you use the Django version via use_library you have to be careful with app engine's limitations (use their model api, their auth via google accounts and so on).

Django + Google App Engine: app engine helper for django or use_library?

There seem to be 2 ways to use django 1.1 with GAE
Google App Engine helper for django
The new use_library() function
We currently use the first. Should we switch? And what's the difference between the two?
use_library loads an unpatched version of django in the production environment, so many things will not work out of the box on app-engine.
The helper applies a series of patches to the django libraries to enable things like Sessions, test, cache framework, etc. If you do not add your own copy of django into your helper application and you are using the latest release (r100 or higher), the helper first tries to load django 1.1 and if it does not succeed then loads 1.0. You can see this in appengine_django/__init__.py::LoadDjango.
On production GAE, django 1.1 always exists, so it is loaded first.
However, on your development environment the dev server SDK does not distribute Django. Therefore, it uses whatever version of Django it can find, first trying 1.1 and then 1.0 and if it cannot find one then throws UnacceptableVersionError.
You probably want to use the helper and not use_library because then you will need to patch the raw django libraries yourself, thus duplicating the work in the helper. Whether you distribute your own version of django, either as a folder or zip file is up to you. One of the advantages of not distributing your own copy of django is that as google applies security patches you automatically get them without having to redeploy your application.
the replacement is called django-nonrel (and djangoappengine)... you can find it at
http://www.allbuttonspressed.com ... with django-nonrel, you should be able to run pure Django apps on top of App Engine without tweaking your models!
FYI, there is at least one more way to get Django 1.1 in GAE.
Take a look at http://code.google.com/p/app-engine-patch/
It allows use to use most of Django features including Admin.
app-engine-patch seems to have died:
http://code.google.com/p/app-engine-patch/issues/detail?id=253
As of GAE 1.5.0, there's a much simpler way of specifying a Django version.
In appengine_congif.py, include the line
webapp_django_version = '1.2'
This will cause the use_libary() to happen under the covers.

Django and App Engine

I wanted to check the status of running Django on the Google App Engine currently and what the benefits of running django on GAE over simply using Webapp.
Django main killer feature, IMHO, is the reuseable apps and middleware. Unfortunately, most current Django apps use models or model forms (django-tags, django-reviews, django-profiles, Pinax apps).
So what are the remaining features or benefits that django has that can still run in Google App Engine (other than what's disabled: the popular django apps, session and authentication middleware, users and admin, models, etc).
Also, is there a list of the Django apps that work in App Engine as well?
app-engine-patch currently has the most of django functional, including sessions, contrib.auth, sites, and some other standard django apps. However, its main drawback (my opinion) is that it uses a zip file of a modified version of django to achieve this functionality and the current maintainers don't seem to have kept pace with current django releases. Currently it seems to be the consensus of the past and present maintainers that this approach is too cumbersome to maintain and therefore no one is currently maintaining it.
google-app-engine-django, uses a monkey patch approach of the latest django version included in the production GAE runtime, so as long as google continues to track django releases you'll be kept up to date regarding django. However, it currently has not fully ported contrib.auth, so you can only authenticate with google accounts - which can be a big drawback depending on whether you want contrib.auth User models to work as you know them on sql backends. There is also no django admin support in the helper as there is in app-engine-patch. A fork of django-app-engine-django exists which adds in some of the contrib apps, such as flatpages, sites, and sitemaps. Also note, it only works on django versions up to 1.1, until issue #3230 Django 1.2 is added to use_library, unless you upload django as a zip file.
On the horizon, the original developer of app-engine-patch has been working on the django-nonrel branch, but this may be pretty far away from being included in a django release. This django developers thread has a lot of information about these efforts.
Separately, there is a google summer of code project working on integrating some aspects of nonrel db's.
app-engine-patch gets most of those things working inside AppEngine - so you can (mostly) use straight Modelforms, use the Django users and admin, etc.
I've only used it for fairly simple projects (being quite new to django), but they claim that most Django apps will work with (at most) minor modifications on appengine. For instance, app-engine-patch uses the AppEngine Model classes rather than the Django classes; and there are some of the basic views that are too inefficient to run on Appengine.
added: google-app-engine-django is similar; but provides a BaseModel that appears identical to Django's BaseModel. My understand is that google-app-engine-django was released by Google, then forked to create app-engine-patch. The maintainers of app-engine-patch seem to have some different goals from the creators of google-app-engine-django, so you may find that one of the two suits your needs better than the other.
Google have provided some articles on running Django apps on appengine; the most recent is actually a guest post from the authors of app-engine-patch.
I've had the best success by simply picking and choosing the Django features that I need and patching them into webapp myself. In my latest project I actually just cut out the webapp stuff entirely. I still import and call several webapp utility functions, but it is mostly a hand rolled application built from the good parts of GAE and Django.
You might be interested to check out web2py, another Python framework that supposedly has less friction between GAE and a "normal" web server.
It is now quite easy to use full Django on GAE:
https://developers.google.com/appengine/articles/django-nonrel#ps
The Django version provided with App Engine has been updated to 1.2.5 with the latest SDK release (1.4.2, changelog). This version is available through the use_library() declaration, so you no longer need to mess around with monkey patching to the same extent.
The GoogleAppEngine (GAE) Python 2.7 runtime provides several third-party libraries that your application can use, in addition to the Python standard library, GAE tools, and GAE Python runtime environment. One of them is Django. The below is copied from the GAE docs page on third-party libraries:
To use Django in Python 2.7, specify the WSGI application and Django library in app.yaml:
...
handlers:
- url: /.*
script: main.app # a WSGI application in the main module's global scope
libraries:
- name: django
version: "1.2"