Ldap error when try to runserver, Django/Python - python

I can't seem to find much information about my topic online so I figured I'll ask. I'm trying to set up an app on Django and when I try to 'runserver' I get the following error. It runs with no problem when I remove the ldap configurations but when I add it back in I get this error. Anyone have an idea what can be causing this to break? I'm using Ubunut 20.04 on a windows machine.

Related

Google App Engine - One module doesn't deploy

I'm deploying my Python app on GAE using the command line interface, which has always worked without problems. Since yesterday, one of the modules is getting stuck on "Scanning 500 files" and in the end throws following error:
Another transaction by user jong.vincent is already in progress for app: s~replimeapp, version: uno. That user can undo the transaction with "appcfg rollback".
However when I rollback updates for this app, the error is still thrown on the next deployment. No clue what I can do to resolve this. There is another module which refers to the same files, which has no problem deploying. No clue what I can do to get rid of this. Help please!
Changed the name of the module and then it worked. Very strange, but at least the problem is solved.

Strange error during initial database migration of a Django site

I have been working on a localhost copy of my Django website for a little while now, but finally decided it was time to upload it to PythonAnywhere. The site works perfectly on my localhost, but I am getting strange errors when I do the initial migrations for the new site. For example, I get this:
mysql.connector.errors.DatabaseError: 1264: Out of range value for
column 'applied' at row 1
'applied' is not a field in my model, so this error has to be generated by Django making tables for its own use. I have just checked in the MySQL manager for my localhost and the field 'applied' appears to be from the table django_migrations.
Why is Django mishandling setting up tables for its own use? I have dropped and remade the database a number of times, but the errors persist. If anyone has any idea what would cause this I would appreciate your advice very much.
My website front end is still showing the Hello World page and the Admin link comes up with a page does not exist error. At this stage I am going to assume this is related to the database errors.
EDIT: Additional information about why I cannot access the front-end of the site:
It turns out when I am importing a pre-built site into PythonAnywhere, I have to edit my wsgi.py file to point to the application. The trouble now is that I don't know exactly what to put there. When I follow the standard instructions in the PythonAnywhere help files nothing seems to change. There website is also seems to be very short on detailed error messages to help sort it out. Is there perhaps a way to turn off their standard hello world placeholder pages and see server error messages instead?
As it says in my comment above, it turns out that the problem with the database resulted from running an upgrade of Django from 1.8 to 1.9. I had forgotten about this. After rolling my website back to Django 1.8, the database migrations ran correctly.
The reason why I could not access the website turned out to be because I had to edit the wsgi.py file, but I was editing the wrong version. The nginx localhost web server I was using keeps it in the different folder location than PythonAnyhwere's implementation. I uploaded the file from my localhost copy and edited it according to the instructions on PythonAnywhere's help system without realizing it was not being read by PythonAnywhere's server. What I really needed to do was edit the correct file by accessing it through the web tab on their control panel. Once I edited this file, the website front end began to work as expected.
This issue occurred for me as well on version 1.10 with a brand new project. I found that if you use the recommended driver and the connector in the documentation, the migration works without issues.
If you don't feel like reading the docs, in breif:
Install MySQLdb for python 2.7 or mysqlclient for python 3.3+
Modify your settings.py file. In the DATABASES dictionary set:
'ENGINE': 'django.db.backends.mysql',

Google App Engine/Cloud SQL/Django syncdb database backend error

I've been successfully able to run syncdb's on my django project for the past weeks, but something must have happened and I'm not sure what.
I always get this error:
No module named google.appengine.ext.django.backends.rdbms.base
I'm not sure why it's just kind of started. Shortly after getting this error, I tried updating my project on app engine and was prompted to download a new app engine launcher SDK, which I have done, but this error still exists. Not sure if maybe something is wrong with my PYTHONPATH?
From your description, this sounds like it could possibly be an issue, not intended behaviour. It sounds crazy, but perhaps something changed with the default Django installation. I suggest you attach a basic reproducing app to a new issue thread in the Public Issue Tracker
You may need to authorize your IP address. If that doesn't work, try using the standard MySQL driver instead of the Google App Engine one as described in our docs.

Python App failing on pythonanywhere using Flask

I just moved from Heroku to PythonAnyWhere.com and im trying to get my python app work over there.
So i am trying to access the url but i get an error message. When i check the error logs i see this:
https://www.dropbox.com/s/fl16xbatsxbru36/Screen%20Shot%202015-03-27%20at%2023.25.54.png?dl=0
Since i am new to PythonAnyWhere i am having a REALLY hard time trying to understand if this is a code error from my python code (which i doubt since the same code works on Heroku). So does anyone know what problem could be here?

django stripe set up installation error

My problem is down to my lack of experience with django (and coding) and stripe.
I am trying to test a very basic stripe payment on a test form on my local development server, but I am getting an error message when I try to start my local development server.
Here is a a screen grab of the issue:
Can somone give me an idea of what I have done wrong and how I even start to go about solving the issue? I am using djstripe which I have pip installed.
I have searched my templates and gone over my code and SO and Google, but I am still stumped. I have djstripe installed in my INSTALLED_APPS.
Is there a tutorial of how to read and interpret the errors in the above screen grab, or does the understanding mainly come from experience?
You need to define STRIPE_PUBLIC_KEY (and STRIPE_SECRET_KEY I believe) in your settings.py. You can get this key from stripe if you have an account.
If you follow the instructions you will see this. https://github.com/pydanny/dj-stripe
A google search for "reading python stack trace" gives us this:
https://www.odoo.com/forum/help-1/question/how-to-read-and-understand-errors-from-tracebacks-9704

Categories