A
A
Artyom Innokentiev2015-11-01 20:51:54
Django
Artyom Innokentiev, 2015-11-01 20:51:54

How to make a Django project executable?

There is a Django project that needs to be made portable: ideally, download it to a flash drive so that it can be run from it.
Those. a person double-clicks on the executable file - the built-in standard server starts, and when you go to localhost, the project page is displayed. Base standard - SQLite.
It will run on Windows 7 and above, possibly Windows XP. I myself have Mac OS.
It is assumed that the end user does not have Python and other project dependencies installed.
There will be no big loads - only one user.
No troubles are needed either - it's as simple as possible to make it work.
What should be used to do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Kitaev, 2015-11-01
@artinnok

Create a virtualenv from under Windows (let's call it project) in the root of the flash drive and install all dependencies
Throw the folder with the project into project (let it be called src)
Create a file in the root of the flash drive (start.bat) and write something like the following in it:

%CD%\project\bin\python.exe %CD%\project\src\manage.py runserver

N
nirvimel, 2015-11-01
@nirvimel

Under windows for packaging in exe there are:

  1. py2exe
  2. PyInstaller

O
OnYourLips, 2015-11-01
@OnYourLips

You need to put the installed python on the same flash drive and write the full paths when starting the site:
Here is a simple option to run in dev mode:

cd e:\project
e:\python\python manage.py runserver

No additional software is needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question