Code Monkey home page Code Monkey logo

django-app-skeleton's Introduction

Generating a Packagable Django Application

The create_app.py uses several variables to replace within a "template" directory. The default template directory is included and called "skel".

Running the script

The script requires that virtualenv and virtualenvwrapper are installed on your system.

The script is interactive, although you can specify some options when you call it. Calling the script is as easy as:

python create_app.py

and the script will ask you for everything it needs.

Application name: django-coolapp Package name [coolapp]: Author [jcooluser]: Johnny Cooluser Destination directory [/home/jcooluser/app-skel]: .. Application template directory [/home/jcooluser/app-skel/skel]: Virtual environment name [django-coolapp]: coolapp

You can specify some or all of the options when calling the script.

Command-line Options

-a, --author

The name of the author.

-n, --name

The name of the application, like 'django-coolapp'.

-p, --package

The name of the installed package, like 'coolapp'.

-v, --virtenv

The name of the virtualenv to create.

-d, --dest

Where to put the new application. Relative paths are recognized.

-t, --template

The application template to use as a basis for the new application. Relative paths are recognized.

Variable Substitution

The script creates several substitution variables that it uses to substitute for file names and within text files.

APP_NAME

The name supplied by -n, --name, or the answer to Application name.

PKG_NAME

The name supplied by -p, --package, or the answer to Package name. The default is the APP_NAME without django-.

AUTHOR

The value supplied by -a, --author, or the answer to Author. The default is the current user name.

SECRET_KEY

A randomly generated string of characters used in the settings.py file.

VIRTENV

The name supplied by -v, --virtenv, or the answer to Virtual environment name. The default is the APP_NAME.

The variables are referenced by surrounding them with $$$$, such as $$$$APP_NAME$$$$. Here is an example from the setup.py file:

setup(
    name = "$$$$APP_NAME$$$$",
    version = __import__('$$$$PKG_NAME$$$$').get_version().replace(' ', '-'),
    url = '',
    author = '$$$$AUTHOR$$$$',

Contributors

Eric Florenzano Corey Oordt Jose Soares Justin Quick Adam Patterson

django-app-skeleton's People

Contributors

justquick avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.