How do you deploy django applications for windows? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm working on a web application using isapi_wsgi and django-pyodbc. I'd like to have a way to install all dependencies and push the files out to the webserver. Unfortunately, some of these are easier said than done. In particular, handling dependencies is a pain as some of them won't install correctly even under setuptools (pywin32 is especially difficult).
Most of the tools that I see for automating this kind of stuff (fabric and capistrano) are made for use with unix-y systems. I would like to set up a continuous integration system, but that only solves part of the problem. Is there any way to make life easier for a Pythonista who's forced to use Windows/IIS?

BitNami provides free Windows Django all-in-one installers that include all dependencies to deploy a Django app on Windows. Disclaimer: I am one of the developers of this tool. If you are going for a hosted version, we also have free Windows Amazon Machine Images (look further down in that page) but in that case I would strongly recommend going with a Linux-based AMI.

Have you looked into Paver? It might not be the perfect solution, but maybe better then your current process.
And it has setuptools (and other useful wrappers) built-in.

Nowadays deploying your Django web project on a Windows based server has become less cumbersome. It's still challenging as most guides are geared towards Unix systems, but deploying on a Windows server is not impossible. Microsoft now provides some native support for Django with IIS.
However, you are not limited to IIS. You can use Apache + mod_wsgi. Here is one of my own test projects that you can deploy on Apache my web project.
Guide: Deploy Django with Apache and mod_wsgi on Windows Server 2019

Related

How to deploy Django application developed locally in PyCharm to Web Server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I made a project in Pycharm 2018.3 community version with Django and now I want to deploy to a web server to host the project. I'm using Mamp host the web server, but I don't know how to export/import my project from Pycharm to Mamp.
How do I deploy from Pycharm to the web server? What are the options for GitHub integration with Pycharm? Are there other ways to move the project to the web server while staying in the PyCharm IDE?
Thanks very much!
This may fall under looking for opinions, but in general, PyCharm provides you with a few options. You can use the deployments option by setting up a remote host (once you have your server set up) which allows you to develop locally, then sync up over ssh either automatically or when you goto Tools -> Deployment -> Sync Local to Deployed.
Although this previous option can work in PyCharm, I'd opt for and highly suggest setting up a git repository (Github, Bitbucket or other) then use PyCharm to commit and push your code to that remote repository. Then from your server, you can pull down the code from the git repository. This allows you the benefits of managing the code changes through all of the utilities a version control system provides.
You'll want to pay particular attention to any paths you have set in settings.py as they will likely differ on your server. One way to manage that is to use environment variables which allows you to refer to the environment variable, with your local development machine having it's own settings, and the server with its own set. https://12factor.net/config

Django deployment best practices [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Safaribooksonline.com has a video [1] from Jacob Kaplan-Moss about how to deploy a Django app. This video is from 2010. It refers to a site [2] that has a list of many relevant aspects.
Now the workshop mentions things like virtual machines, vagrant (as deployment environments) or Fabric and other tools for deployment automation.
I was wondering how much has changed since then. I can think of Docker replacing Vagrant. Or Heroku or AWS instead of renting a dedicated physical server for deployment (or virtual machines). Or using Ansible or Chef / Puppet instead of Capistrano or Fabric.
But what else has changed? What is still relevant? What is done differently? What is the state of the art in 2017 for deploying a production ready Django app.
Can anybody point me to good blogs / books / tutorials?
[1] "Django deployment workshop", https://www.safaribooksonline.com/library/view/django-deployment-workshop/9781449396442/
[2] "infrastructure of modern websites", https://randomfoo.net/2009/01/28/infrastructure-for-modern-web-sites
Honestly, the answer to this question will be extremely opinionated and defining best practices in ever-changing devops area can be challenging. Something is a best practice one day, and tomorrow someone makes a blog post about that being god awful and obsolete.
There are numerous ways to do deployment, but it all comes down to what do you need, how much do you want to automate and what level of customization is required.
For instance, at my current place we use CircleCI, Heroku, Sentry and
Rollbar.
One of my previous clients (three months ago) wanted us to use
CodePipeline which includes CodeCommit, CodeBuild, CodeDeploy for
AWS.
Recently I also worked on a project involving Docker and flexible
environment from Google App Engine.
For my personal projects I simply use Fabric and Heroku, but I'd really like to try the new CodeStar or whatever the name is on AWS.
Define what you want, how you want to customize it and simply do it. If something does not work out, just change it. Things are becoming easier to do and replacing one item in your pipeline can occur in matter of minutes and not days/weeks as it did. Nowadays every provider has support for Docker and CI, one way or the other.
YMMV.

Is there any Open-Source project hosting that allows to programmatically upload distribution? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I develop open-source project in Python and I want it to be easy accessible for Windows users. So for each new source revision I need to generate new windows executable distribution with py2exe and upload it as a downloadable artifact for project users.
I'd rather not do it each time manually but instead I would like to write some type of script that will do both things (generation, upload) in single command, fully programically.
So the question is: are there any Open Source project hostings that provide simple API to make operations like uploading new version of distribution?
Currently I'm using Google Code but it doesn't support that feature (I expected it to be supported as Google Data Api Service but it isn't). I don't really know too much about other hostings - that's why I'm asking.
Check out the GitHub Downloads API or, if it's something suitable for packaging, then look at PyPI, the Python Package Index
Google Code does support it perfectly well: http://code.google.com/p/support/wiki/ScriptedUploads
Most other such sites do in a similar way; on one project on SourceForge, for example, I have a release script which uploads a file to the release system by FTP.
The Python Distutils that come with Python support uploading to the Python Package Index.

Good Python library for AMQP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Can you recommend what Python library to use for accessing AMQP (RabbitMQ)? From my research pika seems to be the preferred one.
My own research led me to believe that the right library to use would be Kombu, as this is also what Celery (mentioned by #SteveMc) has transitioned to. I am also using RabbitMQ and have used Kombu with the default amqplib backend successfully.
Kombu also supports other transports behind the same API. Useful if you need to replace AMQP or add something like redis to the mix. Haven't tried that though.
Sidenote: Kombu does currently not support the latest pika release (should you rely on it for some reason). Only 5.2.0 is currently supported, this bit me a while back.
Pika is the RabbitMQ recommended library, and py-ampqlib is also mentioned. Depending on what you're using Rabbit for, you might also want to look at Celery (a client library dedicated to distributed queuing).
Again, depending on usage, you might also want to look at Apache's qpid which is a full AMPQ-based client-server alternative to RabbitMQ. One thing that attracted us to qpid was that it seemed to have better robustness on server crashes (queues are persisted in a distributed fashion).
Having looked at all these libraries, I am now convinced that the right answer is none of them. Instead, build an abstraction layer as a shim over whatever library you choose because you are bound to run into a situation where you have to change libraries.
But do remember, that if you stick to the same version of the AMQP protocol, these libraries do interoperate. Due to different libraries being tested, we had parts of a prototype application running pika, kombu and py-amqplib.
Read this blog about replacing amqplib with pika for a sense of why this is a good idea.
I am currently in the middle of making our Python app use SSL. I did not originally develop this application (nor am I a Python developer), so I don't know much about it, but we seem to use the AMQP Client in Twisted.
QPid also has one. Again, I don't know the quality.

Generic test automation framework for Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm working as a system administrator/infrastructure engineer, and sometimes I am wasting my time on checking if everything working properly after infrastructure changes. I want to write some tests, such as:
Download some CSS/JavaScript code from a website
Login to website
Upload some file and try to download it
Login to a server and execute some script
And so on.
Most unit testing frameworks focused on unit testing and code coverage, but all I need is just a configurable runner for my tests with nice reporting and may be additional modules for ease of writing HTTP tests. Possibility to use this tool for stress-testing would be an advantage.
I've found many names (testoob, functest, robotframework, py.test, etc.), but I don't know what to choose.
Robot Framework has many nice libraries that would definitely help you - so you don't have to reinvent the wheel. For example, Robot Framework integrates with the Selenium web testing tool.
I think that from the tools that you mentioned Robot Framework is the most active project - py.test seems to be active also.
One thing that you should notice is that Robot tests are not written in Python directly, but they use a simple text based syntax. You can of course access Robots libraries from Python code if you want to or create your own robot library in Python code.
[DISCLAIMER: I am a member of the team that is developing Robot Framework]
I develop an open-source framework (part of Pycopia) that does exactly this. It's not complete yet (still working on the web UI), but it's usable to run real tests and get emailed reports. You write tests in Python, but it also manages test cases, test results, and equipment inventory.

Categories

Resources