django non-rel rollback - django

I cancelled a deployment to GAE while using django non-rel's manage.py deploy.
Now when I try to redeploy it says Another transaciton is already in progress and use appcfg to rollback.
But django non-rel doesn't have appcfg.py so how can I rollback or fix this issue?
I've scoured the internet and can't find any answers. I've waited about half an hour and it still displays this message.

manage.py deploy calls appcfg.py in order to deploy.
appcfg.py is in the SDK. you must have the SDK installed somewhere if "manage.py deploy" is working. you can look around for it, or download the SDK again.
There's no reason you don't have access to appcfg.py
If you need more help finding it, add details about what platform you're running on, where you installed the appengine SDK and where your python folder is.

What do you mean by "I don't have access to appcfg.py"?
Try going to cmd (for windows), navigate to your app directory, and type in the following:
appcfg.py rollback .
Hit return (enter key) and see if that works. If not, what does it display?

Related

Django un Azure Webapp: Run command on deployment

I am deploying a Django app to Azure Webapp, which does everything automatically. I have set it up so when I push to a specific Github branch, it is deployed and everything works. If I have to run a migration, I must login via SSH and run it manually (which is not perfect but I can accept it).
However, I need to use django-background-tasks, which needs to have a command running constantly listen for new tasks. I can't find a way to run this on every deployment. I found some documentation but most of it is for Node apps, it seems. For example, following some (oudated) tutoriales, I logged into {myapp}.scm.azurewebsites.net but I didnt find any "Download deployment scripts", which it seemed to be the proper way to do it.
Is there a way to set up some commands to run on deployment (without changing my current setup of deploy directly from Github using Github actions)? Or I have to do it manually?
Well, if someone is looking how to do it, I found the solution.
Create a startup file (sh), add the first line the gunicorn instruction and after that your own custom commands.
Here is explained: https://learn.microsoft.com/en-us/azure/developer/python/tutorial-deploy-app-service-on-linux-04#create-a-startup-file

Django-Heroku Deployment Procfile

I've created a basic Django app and I wanted to deploy it with Heroku. I have followed all the instructions given on Heroku but there was one error I made which was naming the file "procfile" instead of "Procfile". Now the website has been deployed but it only opens up to an application error. Upon checking the log, I have found the error code to be H14. I have since renamed the "procfile" to "Procfile" but the change doesnt seem to be integrated. How do I fix this?
Add the change on your repository, commit it, and push the applicable branch to Heroku. Finally, try to run Heroku again.

Deploy Django project with MSSQL DB in Local Server

I am new in Django and this will be my very FIRST Times web deploying. So I am trying to deploy my project to the local server and My project stack is Django with MSSQL so obviously I will need Window.
I was read the documentation and I think I will need WSGI and As the documentation say to deploy with gunicron or uWSGI but both are supported for Unix and not for window. So How can I start this one? This will be the first question.
I would like to know whether I am doing is correct or not.
Now I copy my project to the local server and when I try to run my project like python manage.py runserver it asks me to install Django and other but I thought this environment is working at well my computer and all of the needed application is already installed in the environment. So I still need to install all of my needed apps like Django to this environment again?
If u have any tutorial or can guide me to some useful site, I will be very very appreciated.
Anything u want to know further, Just let me know.
Thanks.

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

Deployment woes: What do I do after "svn up"?

I've got several questions. I have no idea how the heck to deploy...
After doing "svn up" on my production server, I'm not sure how to "refresh" my server so that the changes are reflected when you visit it. What can I do to refresh my server to see the changes in production? (I tried rebooting.)
I also noticed that some of the files that I changed weren't truly updated. I deleted a file and saw that doing "svn up" would bring the file back. I went back and deleted everything in the web app's folders, including the svn files (probably a mistake). (I should be safe since I have the prod revisions on the test server, I assume...) So, how can I bring these files back?
I need all the advice and resources on this that I can get. Feel free to post anything else that will get me through this process.
It depends how you run your django up. If you're serving with mod_python/modwsgi, a simple apache restart does the trick.
If you're datamodel changed, you may need to call south command migrate.
On most Linux-Systems this can be done with service apache2 restart
You can do the svn up, manage.py migrate and service apache2 restart with fabric
Fabric helps you to automate to execute shell commands over ssh.
If you are deploying on mod_wsgi you can simply touch the .wsgi file and it will reload the app without having to restart your whole server/httpd/etc