A simple lightweight version of Django
To make simple setup little web app or testing or simply to make some experiments with the framework.
pip install django-lite
from django_lite.django_lite import DjangoLite
from django_lite.utils char
app = DjangoLite(__file__)
@app.model()
class Sample(object):
some_field = char(max_length=255)
class Extra:
base_url = r'^sample/'
detail_view = r'detail/(?P<pk>\d+)/$'
list_view = r'list/$'
if __name__ == '__main__':
app.start()
Or explore 'example' folder!
-
django_lite.django_lite.DjangoLite.route
- arguments:
- url_pattern: string / Regex for urlpattern
- name: string (default=None) / view name
- arguments:
-
django_lite.django_lite.DjangoLite.model
- arguments:
- admin: boolean (default=True) / create an admin class for the created model
- crud: boolean (default=False) / create a view for every CRUD operation
- arguments:
python path/to/file.py make_models ( > dest_file.py )
python path/to/file.py make_views ( > dest_file.py )
python path/to/file.py make_urls ( > dest_file.py )
python path/to/file.py make_settings ( > dest_file.py )
python 2.7 - django 1.11
- Add useful commands
- Add some tests
- Some refactoring ...
Feel free to contribute!