Error: No module named messages Django 1.1.3 - django

I was working on a Django project in version 2.0, but my client was unhappy about it as he wants that project to be made with Django 1.1.3. So, I switched back to old version and tried to setup the project on that version but was unable to do so.
After that, I created a new project in Django 1.1.3 and created a Django app too. I tried to run command python manage.py syncdb but I got this error message:
Error: No module named messages
What's the issue? I am not able to find Django 1.1.3 documentation on this.

The module django.contrib.messages is available only for Django versions >= 1.2, unfortunately.
You could maybe convince your client to switch to 1.2.X, or write your own messages as part of your server's responses, and create your own client-side message renderer.

Related

Django development server quits itself when accessing admin page

I am following the django docs tutorial to build a polls app i just created the superuser but whenever i try to access the admin page the server quits on its own with no error message that's in both chrome and firefox i'm on windows
You need to check your version numbers of Django and Python to ensure compatibility. There is a problem with Django 3.0 (the latest version) and with version 3.7.0 of Python and potentially its older versions as well.
Try updating your Python installation to see if that fixes the issue.

Error using Django Facebook

I am trying to use Django Facebook to register users in my app.
Right now I am in local develoment and after giving persmissions to the app in Facebook and following all indications in readthedocs, I get the next error:
Please specify a Facebook app id and ensure the context processor is enabled
Django version: 1.8
Python version: 3.8
This was an error django-facebook code, which has been fixed. Make sure you are using django-facebook 6.0.4 or later. Even if the latest model is not yet shipped you can get it by doing pip install git+git://github.com/tschellenbach/Django-facebook.git

Google App Engine and Django support

I'm trying to deploy my Django app to Google App Engine (GAE) as per this document. I created and configured a Google Cloud SQL instance, as described in that document. I use PyCharm as development environment and created a GAE project with Django support.
I configured a local server to point to the GAE server. When I try to launch the GAE local server in PyCharm, it's raising exceptions on an improperly configured database in SETTINGS.PY:
google.appengine.ext.django.backends.rdbms' isn't an available database backend
I can see from the stack trace that the local server is using the Django version in /Library/Python/2.7/site-packages while I presume it should use the one in /usr/local/google_appengine/lib.
What would be the best way to solve this given that I have other Django projects as well that should use the Django version in /Library/Python/2.7/site-packages? If I modify my PYTHONPATH to include the GAE version of Django, would not all my projects be referencing that version of Django?
EDIT: To be more precise, the GAE local server starts just fine but throws the mentioned stack trace when I do a syncdb task to update my database.
EDIT 2: In PyCharm Settings under Python Interpreter, I found the possibility to modify paths and added the Django 1.4 version as distributed with GAE SDK. When I start the GAE development server, I can actually see it uses the Django version from the GAE SDK but it still crashes on the database definitions:
Error was: No module named google.appengine.ext.django.backends.rdbms.base
EDIT 3: I ran into problems when trying to deploy an existing Django app using the tutorial. See this separate question.
Looks like PyCharms call of syncdb is using the wrong Django installation.
google.appengine.ext.django.backends.rdbms is not part of the official Django distribution, but it is part of GAEs django.
My GAE django is in /usr/local/google_appengine/lib/
If you're on linux/OS X you could add this to your .bashrc/.bash_profile and make syncdb use this:
export GAE="/usr/local/google_appengine"
export PYTHONPATH="$PYTHONPATH:$GAE:$GAE/lib/django_1_4"
export PATH=${PATH}:$GAE/lib/django_1_4/django/bin/
export PATH=${PATH}:/usr/local/mysql/bin
I wrote a tutorial about using Django with GAE and Google Cloud SQL. There might be some relevant infos there as well.

Django/Jython ImproperlyConfigured error

As specified in the tutorial (http://www.jython.org/jythonbook/en/1.0/JythonDjango.html), I am using doj.backends.zxjdbc.postgresql as Django's DB engine. However, when I do
jython manage.py syncdb
I get an ImproperlyConfigured error, stating that doj.backends.zxjdbc.postgresql is not an available backend and that no module named postgresql exists. Strangely, if I enter the Jython shell, I can do
import doj.backends.zxjdbc.postgresql
without any error messages.
Ideas on what is going on here?
Solution: django-jython is out of date. 1.4 is not currently supported, so there is no solution to this issue other than to revert to a supported version of django.
Unfortunately it seems like django-jython is not seeing much/any active development anymore...
However, I have found that development versions available at the Google code repository below do work in Django 1.5 (and I assume they may work with 1.4 too, if you pick the right version):
https://code.google.com/p/django-jython/source/list
In particular, I have found that this dev version works with Django 1.5:
https://code.google.com/p/django-jython/source/detail?r=c4a0dd949a6d86a4baf8d1bed3b1926fa5318e87

No module named filterspecs

In eclipse,when i create new project, i got an error like,
Error creating Django project
settings.py file not created
Stdout:
Stderr:
If i synchronize present project and runserver, iam getting Error: No module named filterspecs.But i haven't used filterspecs in my project. Already filterspecs.py installed in usr/local/lib/python2.7/dist-packages/django/contrib/admin.
Kindly advise to rectify the error.
You may be using django.contrib.admin.filterspecs to create custom filters for your admin pages, such as outlined here:
Custom Filter in Django Admin on Django 1.3 or below
Unfortunatelly, you will have to rewrite these using the new list_filter module functionality.
See the manual here:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
This happened to me as well, even though my code wasn't directly using any filterspecs.
Run python manage.py runserver --traceback to see exactly where the error is coming from.
This module was removed in Django 1.4, but other external modules you have listed in your settings.py might still be using it, so make sure you upgrade everything in your INSTALLED_APPS list. In my case, I was using an outdated version of FeinCMS, but after I upgraded it, the error went away.
Obviously, your system is lacking filterspecs module which is required by the project. Install it by typing sudo pip install filterspecs in the console (if you are on linux)