django user Authentication error? - django

i am new to django. i need to create a user log in system and i am following that tutorial user authentication
and i am getting a particular error
Error importing template source loader
django.template.loaders.filesystem.load_template_source: "'module'
object has no attribute 'load_template_source'"
i am failed to locate what went wrong.can anyone tell me in what conditions this kind of error occur?

It is problem with your Loader Template . Try this Link

Related

Django logging errors occuring in admin page

I face the following issue:
I want to add a new instance of a model in the django admin page, but I do get an 500 error. Now I want to log all the errors occurring in the admin page to a file.
Important details:
website running in production, hence I do not get feedback in the browser or the console (since I use Gunicorn).
this occurs only for one specific model.
this only happens when adding a new instance for that model, not when changing exisiting instance
logging in the view does not help, since error occurs within admin page
I do not want you to help me debug my django code. I am only interessted for tips and a tutorial on how to log every error occuring no matter if it happens in the admin page or the actual site. I am happy for any tips and suggestions! Thanks! Thanks for any advice!
To get the stack trace of an error with gunicorn as proxy server:
sudo systemctl status gunicorn
For the logging tutorial (answer by #markwalker_):
logging tutorial

Stripe payment error opencart

we have installed stripe payment module in opencart its give error message on checkout page please check following error:-
"Notice: Error: Could not load model /home/imarkclients/public_html/prime/catalog/model/payment/stripe_payments.php!"
Please let us know how we can do it
This error is coming because /home/imarkclients/public_html/prime/catalog/model/payment/stripe_payments.php is not found. Make sure you have it at the right place.
"stripe_payments.php"
model file is missing on the path. Please check properly in your folder path.

Unable to edit/add user in Joomla 2.5.16 - error message is missing

I am unable to edit or add a user in Joomla 2.5.16 and Community Builder 1.9.1.
When I try to save a profile I receive a message : "Save failed with the following error:". But there is nothing after that message (no error message, no code). Of course the changes aren't saved.
In Joomla and Apache logs there is nothing too.
I encounter that problem in joomla's user management and in CB.
Do you have any idea on how to correct that problem or at least to find more information about what is broken ?
Thanks
You can debug registration process in function register() in file yoursite\components\com_users\models\registration.php for front end of your site.
Debug registration data of your site.
I solved that problem by upgrading to Joomla 2.5.18.

Unable to log into the Django admin

Im trying to log into the admin GUI but keep getting the error :
Please enter a correct username and password. Note that both fields are case-sensitive.
Ive created a new user, dropped all the db tables for auth_xxx and resynced. And also checked that the is_staff,is_active,is_superuser flags are all true within the db.
Does anyone have any other ideas ?
The following within the settings.py resolved the issue
django.contrib.auth.backends.ModelBackend

Unusual Error when Django App Is Deployed on apache2+mod_wsgi

I'm getting this weird AttributeError on the app I'm currently working on. I'm developing using the development web server i.e. "runserver" command of django toolsets. Then I decided to test the application on apache+mod-wsgi and I persistently get this error though it works fine sometimes. So I think there must be something wrong with that piece of code,
so I decided to comment it out and see what happens. And YES, it still give me the same error (See 2nd picture). <-- NOT RELEVANT NOW. The AttributeError I'm getting on custom User model, even if it actually contains the classmethod get_by_type_and_id() is what I'm interested on.
Have you even seen like this one before? What do you think is causing this? I've followed the tutorial here to deploy it. Note though that User is not the built-in django User model. I think it's a "customized,stripped-down" implementation based from the django's Auth module.
Note that I have not gotten this error on my development using django's own development server. This only happens when I deployed the app on Apache+mod_wsgi.
More Info:
Django version == 1.2.5
Thanks! I'd really appreciate any kind of help.
First Picture:
2nd Picture:
Few things to notice:
Are you sure that you have get_by_type_and_id method for the User?
You set pasword instead of password (typo)
I think you have to indent line 60 in your second screenshot
After hours of diving into the code, I had a eureka moment. So I thought, maybe at some point django.contrib.auth.models.User model is being put into action by some django module used in the application. Because like I mentioned, this app's User model is customized and the application is not using django.contrib.auth.* at least directly. This was my suspicion because this kind of error is not specific to that particular attribute. Sometimes it gets through that point, but then another AttributeError would occur on some other view referring to other User model attributes. Then at one point I noticed that the attributes of User in the error messages was that of django.contrib.auth.models.User.
So I decided to "remove" django.contrib.auth.models on my python path, and there it showed, an error occurred in one of the modules I'm using specifically django.contrib.messages. I removed it, and I'm not seeing the AttributeError again. It turned out that django's Message model has a foreign_key to django.contrib.auth.models.User.
But then, I lost the flexibility of django message framework, especially when I'm using it on view with a HttpResponseRedirect i.e. no way to put useful messages in a template's context. or maybe there is? :)
UPDATE 2 (Pretty Sure Now):
Yes, I'm pretty sure now that django.contrib.messages is the one causing the error. I tried reproducing the error on another application which uses the customized User model i.e. not django.contrib.auth.models.User. I enabled django.contrib.messages module and produced basically the same error. I would like to know why is this happening on Apache+mod_wsgi, but not on django's own development server.