futurice/djangomi

Name: djangomi

Owner: Futurice

Description: null

Created: 2015-10-28 14:09:40.0

Updated: 2017-10-14 11:17:49.0

Pushed: 2016-01-08 10:14:27.0

Homepage: null

Size: 3

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

django-mi

When you need something up immediately and were tempted to use a microframework. Django Mi(ni) is your path to Django development.

Made for Django 1.9+.

Install

pip install djangomi

Simple app -example

p.py
 djangomi.init import *
ings.ROOT_URLCONF = "app"

index(request):
return HttpResponse("Hello World!")

atterns = [
url(r'^$', index),


= get_wsgi_application()
_name__ == '__main__':
management.execute_from_command_line(sys.argv)

Django management commands available directly python app.py (equivalent to running python manage.py). Develop: python app.py runserver

Everything should work as usual Django

Using Gunicorn

Install pip install gunicorn and run gunicorn app:app

Complete Django app -example

To use external apps it is convenient to initialize the Django framework from within settings.

. celery.py
rt settings
settings.py
 djangomi.init import *
rt os
 django.conf import settings

 = os.path.dirname(os.path.realpath(__file__))
ings.ROOT_URLCONF = "app"
ings.TEMPLATE_DIRS = (
os.path.join(ROOT, 'templates'),

ings.INSTALLED_APPS += [
ngo.contrib.contenttypes',
ngo.contrib.auth',
ngo.contrib.admin',
ngo.contrib.sessions',

app.py
 __future__ import absolute_import

ttings
rt settings

ews
 django.http import HttpResponse
index(request):
return HttpResponse("Hello World!")

ls
 django.conf.urls import patterns, url
atterns = [
url(r'^$', index),


anage.py'
rt sys
 django.core import management
 django.core.wsgi import get_wsgi_application
= get_wsgi_application()
_name__ == '__main__':
management.execute_from_command_line(sys.argv)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.