I am using satchless app in my local server. It is installed at python path.
Later i have create my project in my home directory and modify the settings.py file as described in this doc
But when i am running my server and goes to localserver localhost:8000 it gives me the error cannot import name cart_app I think it does not imort none of the app (cart, product or anything i have mention in my doc).
My url.py file is similar as it is specified in the doc i have mentioned above.
So any one who have used satchless app can tell me where i am wrong
Any suggestions would be appreciated
Thanks
Try to runserver --traceback, sometimes the error comes from somewhere else.
Related
I am trying to deploy the most simple Django 1.10.5 project into Google App Engine and am completely stumped.
Upon running gcloud app deploy I am getting the following error when navigating to /...
This is the file structure of my app...
This is my .yaml file...
This is my appengine_config.py file...
I am also getting the following errors in Google Dev Tools network tab...
I am pretty certain the problem lies within my app.yaml file and am very unclear as to what url and handler are doing in this code. Can anyone see what I am doing wrong?
You seem to be quite far off from getting your django based app running on GAE. For example you're missing the lib dir where your version of django should be installed. You may want to go through Running Django on App Engine standard environment
Take a look of GAE log page and search text "raise". If you see something like "sqlite3", the problem might be caused by the default content of DATABASES section in settings.py file. Commenting out this DATABASES section solved my problem("Error: Server Error" only when deployed to GAE; working fine locally).
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.
I'm using Openshift with Django/Python 3. As of yesterday, I've been unable to update my server. When I push a change, the push is successful. Using SCP to view the files on the server, the updated files are present. Using rhc git-pull downloads the correct files as well. However, the templates are the only thing that actually get changed on the app by the push. No changes to python files cause an effect on the app.
When I try to use 'rhc tail', I get the following error:
OSError: [Errno 98] Address already in use
Searching this error leads me to believe there are multiple server processes running for my app. I'm not sure how to run suggested diagnostics, as I don't control the server. Any ideas? Restarting the app does not fix it. Running rhc stop appears to successfully stop the app, yet my website works unhindered. (I've never tried stopping before, but assume it's supposed to kill the website.)
I found this post this afternoon by somebody having the same problem. It looks like Openshift changed some things on us. I didn't get the memo :(.
Read here:
Openshift March Blog post
#MSDOS, it is similar to your answer but I wanted to post the generic answer that is probably affecting most people.
For me, I just had to rename app.py (my old wsgi entry point) to wsgi.py and everything worked as it should. :) Now I have to figure what they changed to the cron jobs :(
Solved by executing 'rhc app force-stop', then 'rhc app start'. I don't know what caused the problem, but force-stopping it killed the website, and it worked with the new code after starting it again.
I think I solved the problem.
I was using an old django repository, based on https://github.com/openshift/openshift-community-cartridge-python-3.3/blob/master/template/app.py (the link is dead, I mentioned here just for information).
In these old community cartridges, there was a app.py file that started CherryPy or httpd, but now the official django repository doesn't have app.py anymore. (check https://github.com/openshift/django-example)
The app.py doesn't exist anymore because httpd service was added automatically. That's why we were having OSError: [Errno 98] Address already in use.
Removing the app.py from my repository solved the problem.
I was receiving error 500 because my Django application was having errors, not my Python cartridge. That's why I wasn't understanding what was happening. I did a find . -name *.log* in my cartridge and read all logs.
Now my app is working. Good luck!
Committed a small code change to my django app and deployed to heroku. The app now throws H10 (app crashed) errors on every response. When I checked the logs, I saw..
[web.1]: Traceback (most recent call last):
[web.1]: File "nightlife2/manage.py", line 2, in <module>
[web.1]: from django.core.management import execute_manager
[web.1]: ImportError: No module named django.core.management
[web.1]: bash: bin/gunicorn_django: No such file or directory
..which I know means that django isn't on the pythonpath. I looked at the PATH on the heroku config which says bin:/usr/local/bin:/usr/bin:/bin. But while doing a heroku run bash, I noticed that the entire bin directory is now gone. Other apps of mine deployed on heroku can still be pushed to and still have the bin directory on there (I believe newer apps no longer have the bin directory and it's now in .heroku/venv/bin. Not 100% sure on the details there)
Has anyone ever encountered this? I can change the PATH to .heroku/venv/bin but then I get an error about sql and I don't know if this is closer or farther away from the root problem. ANYTHING would be greatly appreciated as this is the production server and is currently hosed.
EDIT: The error when changing the path is: django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3
. The database is postgress so I'm not sure where this is coming from
I resolved the issue. It was a combination of things. I'll document here and hopefully saves someone the headache I just experienced.
Our database had just been updated to the new Heroku Postgres dev plan. (Unsure if this is related or not). This was the first push of code since the database had been updated.
A while back I remember hearing about settings injections being deprecated. Being naive, we did nothing about it and never saw any changes so never followed up about it. They decided to take effect today and broke the linking to our postgres database. I'm still unsure as to why the bin directory is now gone, but it appears that the app is now using the new .heroku/venv/bin. To fix all of this, I had to change the settings.py to use the new postgres declaration for the database. I was correct in my OP that the PATH variable in the heroku config needed to be updated to point to the .heroku/venv/bin directory. I then had to update the Procfile because it was complaining about bin/gunicorn_django not being found. Once everything was updated, pushing the code solved the issue
I've been developing on my laptop.
Now, I've uploaded my development project from Django 1.2/Python 2.7 up to Dreamhost created using the Passenger setup. I am using South for migration.
I modified settings.py to access MySQL. Got Admin working.
Questions:
1) Where is the std out shown when you hit the site? (all my print statements)
2) I had to add
from decimal import Decimal
to get the settings.py to run.
Now, hitting the server gives me a 500. When I go to the commandline and try any manage.py command I'm getting:
Error: Could not import settings 'pholdershare.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings
I modified the permissions for my folder to 755 but that didn't change anything.
3) Regarding development to testing to live, I'm totally unclear on how to do this. I want to have a nice solid system for development where I can do releases but I've never done that. I have been using GIT locally. Can anybody point me to the tutorial on setting up the release system?
Suggestions?
Thanks much!
"Could not import settings 'pholdershare.settings'"
...usually means either settings.py has an import error or syntax error, or pholdershare has not been added to sys.path in your wsgi.py