Giter Club home page Giter Club logo

growlitheharpo / django2exe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiburualex/django2exe

0.0 1.0 0.0 63.42 MB

A wrapper to be able to run a django application as a windows dekstop application using pyqt and cefpython

Python 85.87% Batchfile 0.01% C 3.68% C++ 2.48% QMake 0.01% HTML 0.62% Visual Basic 0.01% JavaScript 0.01% XSLT 0.01% ASP 0.01% Roff 0.01% PLSQL 0.08% Tcl 7.17% Shell 0.02% Makefile 0.01% Mask 0.01% F# 0.01% C# 0.03% GLSL 0.01% Forth 0.01%

django2exe's Introduction

Packager is a project to help you distribute your django project as exe

Credits:

- https://algotronics.wordpress.com/2015/10/23/dj2exe/

- WinPython

- Cefpython3

Setting Up:

- Run setup.bat to install django and cefpython3 and other custom requirements in requirements/setup_requirements.txt

- After successful installation you can delete setup.bat and requirements folder

- The app folder is a sample django project which you can delete

- Paste your Django project folder where app folder is placed(it is recommended to compile all .py files to .pyc and delete all .py files, this will protect your source code.If you don't django2exe will compile all .py to .pyc but won't delete your .py files)

- In the config folder paste the icon you want on the application window

- Edit the config.json to get it all running

	-project_dir_name -> Name of your django projec folder

	Rest all settings are self-explanatory

- Install all your pip requirements and migrations using the terminal which can be launched by executing py-dist\scripts\cmd.bat

- When all done, try launching the your application with launch.bat

Contents:

setup.bat and setup_requirements.txt:
	
	- sets up django and cefpython3 using pip.DELETE THESE FILES IN PRODUCTION DISTRIBUTIONS

launchapp.bat
	
	- script to launch the application with a console to see log errors.DELETE THIS FILE IN PRODUCTION DISTRIBUTIONS

launchapp.exe
	
	- launchapp.bat converted to exe with invisible console.Rename this to your application name

app/

	- Just a sample Django project for structure reference

config/

	- contains icon for application window

	- config.json for settings for the application

img/

	- contains image for the png splashcreen

py-dist/

	- The py-dist folder has portable python with some extra packages like pip installed

	- There is also a run.py in py-dist folder which launches the web server and the windows application.It also
	takes care of killing processes on exit

		What run.py does

			- A application is made with pyqt
			- A cef component is placed into the application using cefpython3
			- A manage.pyc runserver process is spawned on port 8000 on localhost
			- cef webkit is made to navigate to 127.0.0.1:8000

			NOTE: IF YOU WANT TO NAVIGATE TO SOME OTHER URL OR WANT TO BIND TO SOME OTHER PORT FEEL FREE TO EDIT run.py

	- There is a migrate.py in py-dist folder which makes migrations and migrates models to the database. Runs only once the gets deleted
	since there is no need to make migrations every time one is running. script backup in the migrate-backup folder

	scripts/

		- env.bat
			setups portable python environment

		- cmd.bat
			setups portable python environment and starts cmd in the environment

		- python
			portable python console
py-to-exe/

	- contains the app.py file which is to be converterd to app.exe using pyinstaller

requirements/

	- contains environment requirements for the django app
	- base_requirements.txt
                            base requirements that are a must for the app includes django <=1.11 and cefpython
                            NB: python environment set is python2.7 hence django 2.0 cannot work
	- setup_requirements
			calls the baserequirements.txt and one can add additional requierements depending on
			their application.

django2exe's People

Contributors

kiburualex avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.