Comments (6)
reproduction: https://pyfiddle.io/fiddle/af018023-317c-4460-9d76-9e40621f3def/?i=true
turns out pyfiddle doesn't support sqlite3 so you'll have to copy it into your codebase
from django-micro.
Thank you for reporting. I’ll look into it.
from django-micro.
import django_micro
from django.http import HttpResponse
from django.db import models
django_micro.configure({
'DEBUG': True,
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
},
},
})
@django_micro.route('', name='homepage')
def homepage(request):
name = request.GET.get('name', 'World')
return HttpResponse('Hello, {}!'.format(name))
class Post(models.Model):
title = models.CharField(max_length=255)
parent = models.ForeignKey('self', null=True, on_delete=models.CASCADE)
class Meta:
app_label = django_micro.get_app_label()
from django.core import management
@django_micro.command('print_hello')
class PrintHelloCommand(management.BaseCommand):
def handle(self, *args, **options):
management.call_command('makemigrations', django_micro.get_app_label())
management.call_command('migrate', run_syncdb=True)
p = Post.objects.create(title='foo')
Post.objects.create(parent=p, title='ham')
print(
Post
.objects
.values_list('parent__title', 'title')
)
application = django_micro.run()
from django-micro.
also interestingly omitting the django_micro.get_app_label()
in the makemigrations
command means it django doesn't find any changes
from django-micro.
@ZenWalker okay I've managed to get sqlite working on pyfiddle: https://pyfiddle.io/fiddle/f5a6361a-49df-4c79-8d3c-f94cadb94b6a/
from django-micro.
Fixed in 1.7.1 🎉
from django-micro.
Related Issues (12)
- New idea for admin panel HOT 3
- No module named "example", when I try to run application from example HOT 3
- when django admin its configured messages didnt work HOT 1
- ERROR:Command errored out with exit status 1: python setup.py egg_i HOT 2
- django 2.2 support HOT 2
- Cloudflare Native Django HOT 2
- Add tests HOT 2
- This looks amazing HOT 2
- Missing TEMPLATE_DIRS in README example HOT 2
- This works serverless with zappa
- Add admin panel HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-micro.