GithubHelp home page GithubHelp logo

bem-django's Introduction

BEM for Django

How to use?

Get NodeJS and NPM

Get BEM Tools

BEM Tools

Copy files

Copy .bem, GNUmakefile, package.json to your Django project root.

Install dependencies

Run npm install to install all dependencies specified in package.json.

Build

Just run make and it will build only what's needed.

What can you do?

Create apps

Django apps are blocks on the project root level. So you can run bem create block <appname> to create new app with all BEM related features inside.

Create models

Models are blocks on <appname>/models level. So you can run bem create block -l <appname>/models <modelname> to create new model.

Create views

Views are blocks on <appname>/pages level. So you can run bem create block -l <appname>/pages <modelname> to create new view.

Development

Tune templates

All templates that are used to create new files are defined in .bem/techs/*.js files. Feel free to modify them.

bem-django's People

Contributors

arikon avatar veged avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mechanism pahaz

bem-django's Issues

Make does not work

Tested on OSX:

[art@~/bem-django]% make
GNUmakefile:8: *** target pattern contains no `%'.  Stop.
[art@~/bem-django]% make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

And similar issue on Ubuntu Precise (12.04):

[+|art@skate:/tmp/bem-django]% make
GNUmakefile:8: *** multiple target patterns.  Stop.
[art@~/bem-django]% make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu

Update Tech API to v2.

Sory, but it`s not work for me.

> bem create block itest

WARNING!
Command "bem create block" is deprecated!
It will be removed in [email protected], please use `bem create -b ...` command instead.


WARNING!
Tech module "app" at ...\DJANGO_BEM_TEST\bem-django\.bem\techs\app.js is using API V1.
Tech modules API V1 is not recommended to use, because it is slow.
Please use tech modules API V2, it makes your build process faster!
Instructions for migrating to API V2: http://git.io/gbLDOA

Error: ENOENT, no such file or directory '...\DJANGO_BEM_TEST\bem-django\itest'
    at Object.fs.readdirSync (fs.js:654:18)
    at exports.Tech.INHERIT.create (...\DJANGO_BEM_TEST\bem-django\.bem\techs\app.js:17:12)
    at exports.Tech.INHERIT.createByDecl (...\DJANGO_BEM_TEST\bem-django\node_modules\bem\lib\tech\v1.js:75:25)
    at C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\lib\commands\create\block.js:39:47
    at Array.map (native)
    at C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\lib\commands\create\block.js:38:36
    at Array.map (native)
    at Cmd.<anonymous> (C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\lib\commands\create\block.js:37:37)
    at C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\node_modules\coa\lib\cmd.js:483:22
    at _fulfilled (C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\node_modules\q\q.js:798:54)
    at self.promiseDispatch.done (C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\node_modules\q\q.js:827:30)
    at Promise.promise.promiseDispatch (C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\node_modules\q\q.js:760:13)
    at C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\node_modules\q\q.js:574:44
    at flush (C:\Users\stribog\AppData\Roaming\npm\node_modules\bem\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:415:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:902:3

And, after created itest dir:

>bem create block itest

WARNING!
Command "bem create block" is deprecated!
It will be removed in [email protected], please use `bem create -b ...` command instead.


WARNING!
Tech module "app" at ...\DJANGO_BEM_TEST\bem-django\.bem\techs\app.js is using API V1.
Tech modules API V1 is not recommended to use, because it is slow.
Please use tech modules API V2, it makes your build process faster!
Instructions for migrating to API V2: http://git.io/gbLDOA

Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)

Sorry, but i have not time for deep research.
May be this trace will be helpful for you.

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.