Fundamental django project deployment information [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am a newbie in Django deployment and have been given the task of the project deployment on an Ubuntu 18.04 LTS prod server.
I have already deployed the project using NginX and uWSGI by copying all the project files in a directory with appropriate permissions and also assigned respective permissions to www-data user.
But, my question is whether all the files need to be directly copied into the said directory (since python files are interpreted files) or is there any other format, such as a war file for jsp projects, that can be directly deployed instead of copying the directory?
Thanks.

In general Django projects are deployed
either as a directory of source files and the accompanying virtualenv, or
as a self-contained container of some sort (e.g. Docker).
In the former case, I really wouldn't manually copy anything, but have the directory be a checkout from your version control system (e.g. Git).

Related

How to export python files for other use? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am looking to export some .py files so I can include them in a website. I am not sure any method to export the files however. Could someone please link some useful information or explain a procedure so the files can be executed using buttons on a website (particularly a HTML site)?
You can use UWSGI as an intermediary between your Python files and nginx (as a web server). But this is not as easy as executing php files, since the php executor comes with any web server. Or call python files as external programs from your existing site.
if your are looking to import function or classes in a file and use them in another file or project, then this might be what you are looking for imports in python

What is the best way to use git with Django? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm starting with python and Django development and I'm creating a project that I want to share it with git. When I started the app I saw folders like "local", "lib", "bin", and "include". Should I ignore this folders or can I commit it?
There's a .gitignore "master" to django files? I found some files on google but any of them mentioned this folders.
When doing Django development in Git you'll typically want to exclude *.db files, *.pyc files, your virtualenv directory, and whatever files your IDE and OS may create (eg: DS_store, *.swp, *.swo)

Web2py launch script [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need a launch script which has access to "db" and other web2py modules. This script must be running constantly. I know that Web2py has launch parameters from which you can run python files in the web2py enviroment, but i don't know how that works. Can this parameter solve my problem and if so, how do I go about it? Thanks!
Look at section 4.17.1 of the web2py manual (or Google "web2py cron").
You can run a script on startup of web2py by registering it in the crontab file as:
"#reboot web2py *scripts/myscript.py"
web2py should be the username that it will run as, which should be the same as what web2py runs as. In my setup I have a user named 'web2py' to run the app.
The asterix before scripts/myscript.py indicates that you want to run the script in the web2py environment.
Keep in mind that you run the risk of locking issues if your script is trying to use the database at the same time as the normal web2py process.

how is docker better if tools like fedora's devassistant and virtualenv exist? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to understand docker.io LXC container for a while,but if we consider fedora's devassistant tool and virtualenv then virtualenv will do the work of isolation and devassistant will download all the needed dependency by interpreting the setup configuration file.so its like by using two keyword commands on terminal like we almost setup a developer environment of Openstack or lets say large multi-repository project within minutes taking into consideration to use right tool for the right job.so how is docker different?
virtualenv only does isolation for python environments, it doesn't do process isolation.
I'm not familiar with fedora's devassistant but I'm pretty sure those changes are system wide. What if on the same server you want to run, python, ruby, java, and node.js apps? There might be conflicting requirements at the system level.
With Docker, this is easy because each app has it's own container and they can put what ever you want in there, and they don't interfere with each other. Think of docker like this. It is giving each application it's own VM (container) to live in, it is similar to setting up a physical server and installing different virtualbox servers on it, one for each application. But it is much more lightweight and you can run it on both physical and virtual hosts.
You can also move the docker containers from one docker compatible server to another really easily.

Online Repository for Google App Engine [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have been writing a web app for some time now for Google App Engine and I just now have gotten a partner on the project. I have been working in Eclipse and writing in Python and I need to share the project with him.
What kind of repository would you suggest or could I use to share the code base with my partner? I have looked at some options like Mercurial or Git but is there anything that I can have directly update my files in the Eclipse development folder?
I recomend you to create a Git repo and use Egit, very nice git plugin for eclipse. You can set up a repo in Google Code or any other website that you like. I have sources in Bean Stalk App and bitbucket. They both work fine with git!

Categories