Trouble deploying django webapp onto google cloud - django

I've been following the google cloud documentation titled, "Running Django on the App Engine standard environment" . I'm using the same app provided in the documentation in the "Cloning the Django App". Honestly, I get lost in the google cloud documentation under the "Configuring Database Settings" section. This what my settings.py (mysite/settings.py in the given app mentioned previously)
Mysite/settings.py img
Whenever running python manage.py makemigrations - I get the following error message on the CLI...
django.core.exceptions.ImproperlyConfigured: Set the SECRET_KEY environment variable
Also, I have noticed there is no .env file in that repo. Would I maybe have to create it myself or would is it fine? Again I am using the github given app via the documentation.
Just trying to deploy Django website to google cloud. Any help would be greatly appreciated. Im on Mac Big Sur btw if that matters.

I tried to deploy the application using this documentation and got the same error you mentioned about. Then I observed that there is some issue with the github files mentioned in the documentation for which an open github issue is there. The reason for the issue is that the current code in the github repository matches a new tutorial version and we hope to get the new tutorial version updated soon to match the current code in the github repository.
For now using a specific previous version of ‘mysite/settings.py’ file in place of the current ‘mysite/settings.py’ file and adding ‘PyMySQL==1.0.2’ in requirements.txt file will work. The required previous version of the ‘mysite/settings.py’ can be found in this link. Follow the documentation for all remaining steps.

Related

"Is there any repository or documentation with instructions to run docker created by django oscar?"

I am working with Django oscar docker and in the meantime found that Django oscar sandbox not installing as expected. So I want to get rid of all hassles and want to run it in docker. When I went through Django oscar GitHub repository and their docker hub profile I found no instructions and guideline to run it. I have also created an issue to their GitHub profile and they suggested me to ask questions on StackOverflow or google group. For a faster response, I am asking help from this community. Hope you guys will come up. This is my github issue link
https://github.com/django-oscar/django-oscar/issues/3051
Assuming you already have pulled the image locally using docker pull, run docker run -d -p 8080:8080 oscarcommerce/django-oscar-sandbox and access the sandbox on http://localhost:8080/.

CKAN missing datastore tab / upload options

I've followed install instructions from source in here:
http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html
And from here:
http://docs.ckan.org/en/latest/maintaining/datastore.html
I added the datastore entry in ckan.plugins setting.
I did Test the setup and it worked.
However, when editing/creating a resource in CKAN web interface, the datastore tab or upload to datastore option does not show up.
This a new install on a Ubuntu 16.04.
CKAN version 2.6.2
Any help is appreciated. Thanks.
UPDATE:
After installing datapusher, and trying to upload a resource in the DataStore tab, came up another error, which is specified in here: CKAN error upload to datastore (with datapusher)
Follow this link. It has datapusher installation for both developement and production installation (paster and Apache). And how to start datapsuher for respective servers
Don't forget to add Datapusher plugin and Datapusher URL in development/production.ini
Data Pusher Documentation
Not only datastore, you should also add datapusher in your .ini file, and you will be able to see Datastore tab from where you can upload resources on Datastore. Also in your .ini file you must set up ckan.storage_path location

Django openid (google-app-engine) error: No module named django_openid_auth

I'd like my users to be able to log in to my django project using their google accounts login (instead of having to sign up and create a new one). I found this : http://learnedstuffs.wordpress.com/2012/05/22/django-google-account-authentication/
But it doesn't work for me. After deploying my project in to Google apps engine it shows an error: ImportError: No module named django_openid_auth. I've checked many times - i did install django-openid-auth (by virtualenv). I'm new to django and I have no idea what I'm doing wrong.
Can anybody please help me with it? Thanks!
I found the solution: Packages installed in system or virtualenv environments won't get uploaded to GAE production servers. Packages should be in GAE project folder.

Deploying django project on AWS elastic beanstalk

I am following the tutorial for deploying a django project on AWS elastic beanstalk here:
http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html
My app works when I test locally but when I deploy, I'm getting a 404 error. Looking at the event logs, I see this message:
Error running user's commands : An error occurred running '. /opt/python/ondeck/env && PYTHONPATH=/opt/python/ondeck/app: django-admin.py syncdb --noinput' (rc: 127) /bin/sh: django-admin.py: command not found
That leads me to believe that the tutorial is missing a part about installing django files on the server or at least configuring my project to recognize django-admin.py. I have django installed on my local machine so it works there.
I know python support is brand new for elastic beanstalk but has anyone deployed django to it?
I believe you don't need to put container_commands in .config because there is no database or table at this moment.
Did you made the step?: Freeze the requirements.txt file.
(djangodev)# pip freeze > requirements.txt
Note
Make sure your requirements.txt file contains the following:
Django==1.4.1
MySQL-python==1.2.3
I had the same problem because I skipped it. Once I did it, add, commit and push. It works!
I followed the same tutorial recently and had a similar result.
At step 6, upon seeing the default django 'congrats' page render locally, I deployed to EB as instructed and got a 404 instead of the default 'congrats' page.
I decided to use the code up to that point as a foundation for following the 'getting started with django tutorial' which led me to a successful rendering of a 'home' view. This is a much more useful place to be anyway. I do agree that there is something wrong with the AWS tutorial and posted to the AWS forums here.
If you can, you should try to access the log file; it might give you a better idea of what's going on. Here's a link that might help:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.loggingS3.title.html

Deploying a "working when run locally via pycharm" django app to webfaction

I've been following the steps in the box under "Configuring Django" here to try and get the django app up onto webfaction after getting it to work locally.
I zipped my project folder and used scp myproject.zip catubc#web513.webfaction.com to get it up. I then used ssh and moved the zip to $HOME/webapps/plot_composite_metrics as the linked steps instruct and unzipped it there. Since the name of my project is "myproject" I didn't have to do steps 6-7.
From the webfaction control panel I have made an application and called it plot_composite_metrics, Django 1.9.1 (mod_wsgi 4.4.21/Python 2.7). I also made a new website called good_morning_cat and added plot_composite_metrics to it.
I have ALLOWED_HOSTS = ['catubc.webfactional.com'] in settings.py
So, as per this example why do I get a "server not found" when I navigate to http://good_morning_cat.catubc.webfactional.com/? What did I forget to do to link my working-locally via pycharm app to said domain?
I have seen this related question, sadly I believe I am using the correct python version, so that's not the issue. Additionally, I do have a paid account if that makes any difference.
You have to add all the domains in the WebFaction control panel, i e http://good_morning_cat.catubc.webfactional.com/ as well.
http://catubc.webfactional.com/ works as this is what you have specified, it's resolved anyway. There's an ImportError because you haven't installed all your dependencies.