Coder Social home page Coder Social logo

django-micro's Issues

Missing TEMPLATE_DIRS in README example

Just did a copy/paste of the README, and go this:

% python app.py runserver
Traceback (most recent call last):
  File "app.py", line 5, in <module>
    configure(locals())
  File "/Users/jbbarth/.virtualenvs/elastictac/lib/python2.7/site-packages/django_micro.py", line 81, in configure
    'DIRS': config_dict.pop('TEMPLATE_DIRS'),
KeyError: 'TEMPLATE_DIRS'

Having a TEMPLATE_DIRS = [] above the configure(locals()) call seems to fix it. I'm running django-micro-1.4.1 with django-1.10.7 at the moment.

Thanks for your work anyway, I'm giving it a try today and I already like it :-)

This works serverless with zappa

We're running a django-micro app serverless on AWS Lambda using Zappa 👍

Only things needed was to use "app.application" as app_function WSGI function and to not specify a django_settings module in zappa_config.json; and then apply the sys.path import fix from django_zappa.py.

It also runs fine without database by disabling all database related apps and functionality.

This is a pretty neat way to run lightweight services while keeping commonality with our existing full fat Django apps and dependencies!

FYI 😉

Add tests

The project doesn't seem to have tests and test automation.

Would you be interested to have that and packaging automation added via a PR?

New idea for admin panel

What if we will right:

configure(locals(), admin_on='admin')

instead of:

configure(locals(), django_admin=True)

So, in that case we will make it even more easy to enable admin and add route.

Add admin panel

I think it would be great to add lightweight integration of admin panel.

No module named "example", when I try to run application from example

(.venv) ~/sources/wisdomchest/django-micro/example$ python app.py migrate
Traceback (most recent call last):
File "app.py", line 19, in
configure(locals(), django_admin=True)
File "/home/roman/sources/wisdomchest/.venv/lib/python3.6/site-packages/django_micro.py", line 83, in configure
_create_app(inspect.stack()) # load application from parent module
File "/home/roman/sources/wisdomchest/.venv/lib/python3.6/site-packages/django_micro.py", line 34, in _create_app
import_module(app_module)
File "/home/roman/sources/wisdomchest/.venv/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'example'

If I try to import this module from +1 level of file system then importing work correctly either running with uwsgi.
Uwsgi backtrace from example folder shows the same error.

I found that U cannot import module when U stay in imported module folder. It looks like a reason.

Django 2.0.8, python 3.6

`migration --run-syncdb` doesn't create models

https://github.com/django/django/blob/a77f21880dfb0631ea0adb22d47909915cbfc3a9/django/core/management/commands/migrate.py#L268-L276

        # Build the manifest of apps and models that are to be synchronized.
        all_models = [
            (
                app_config.label,
                router.get_migratable_models(app_config, connection.alias, include_auto_created=False),
            )
            for app_config in apps.get_app_configs()
            if app_config.models_module is not None and app_config.label in app_labels
        ]

It seems that app_config.models_module is None for django-micro apps

Reproduction:

Problem Repro
only works with app_name and migrate https://pyfiddle.io/fiddle/f5a6361a-49df-4c79-8d3c-f94cadb94b6a
makemigrations needs app_name https://pyfiddle.io/fiddle/ca85bac0-b44b-4810-9a4f-4afd9f6440a4
migrate sync_db=True doesn't work https://pyfiddle.io/fiddle/2512299d-6fdb-4e36-9612-96844d4122f9

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.