Is it possible to wrap Django API into public C methods in Cython?

I'm thinking I could define a few functions in my libdjango.pyx typically used for Django administration.

What do you think?

Etienne

Le 2018-01-24 à 06:26, Etienne Robillard a écrit :
Hi Jason,

Le 2018-01-24 à 06:11, Jason a écrit :
I'm curious about this to, but am struggling to see the use case for this.  Could you elaborate on how you'd use something like this, and its expected benefits?

The goal would be to use faster C code for accessing Django internal api.

Then I suppose you could build precompiled a Django binary for specific architectures/compilers (like llvm) :)

Here is my results so far:

erob@marina:~/src/django-hotsauce-devel$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libdjango
>>> libdjango
<module 'libdjango' from '/home/erob/src/django-hotsauce-devel/lib/libdjango/__init__.pyc'>
>>> dir(libdjango)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
>>> libdjango.main
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'
>>> import libdjango.main
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (initmain)

erob@marina:~/src/django-hotsauce-devel/lib/libdjango$ cat libdjango.pxd
from django import *

erob@marina:~/src/django-hotsauce-devel/lib/libdjango$ cat libdjango.pyx
from libdjango cimport *


Any ideas why the dynamic module does not define init function?




You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9210f6ce-e01c-423f-a1a7-1eae6fe596a0%40googlegroups.com <https://groups.google.com/d/msgid/django-users/9210f6ce-e01c-423f-a1a7-1eae6fe596a0%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/
--
You received this message because you are subscribed to the Google Groups "Django hotsauce" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-hotsauce+unsubscr...@googlegroups.com <mailto:django-hotsauce+unsubscr...@googlegroups.com>. To post to this group, send email to django-hotsa...@googlegroups.com <mailto:django-hotsa...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/django-hotsauce/99d0931e-2a14-c977-5519-6bcac70637c0%40yandex.com <https://groups.google.com/d/msgid/django-hotsauce/99d0931e-2a14-c977-5519-6bcac70637c0%40yandex.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5e81f5d5-d84f-30e3-1b32-32cf06fd124c%40yandex.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to