Re: Suse Linux installation
In case of openSUSE 11.3, as root type: zypper ar http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_11.3/devel:languages:python.repo In case of openSUSE 11.4, as root type: zypper ar http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_11.4/devel:languages:python.repo Then install Django itself, as root type: zypper in python-django Thanks. On Mon, Oct 17, 2011 at 5:55 PM, Andrew Johnson wrote: > Thanks again for your reply. On the django installation guide is > says: > > A Django package is available for openSUSE Linux in the openSUSE > Build Service. The current package can be installed by subscribing to > the devel:languages:python project and typing 'zypper install python- > django'. Alternatively, you can use a one-click-install link. > > How do I "subscribe to the devel:languages:python project"? > > Sorry for my complete ignorance and thanks in advance for your > patience. > > > On Oct 17, 3:02 pm, aledr wrote: >> It is the openSUSE software repos site. You can check how to usage it >> here[1]. >> Choose the correct folder from the openSUSE version you are using. >> >> [1]:http://en.opensuse.org/SDB:Zypper_usage >> >> On Mon, Oct 17, 2011 at 4:37 PM, Andrew Johnson >> >> wrote: >> > Thanks for the response! >> >> > Where can I get more guidance about how to use the website you >> > reference? I go there and see nothing about django and am unsure how >> > to proceed. >> >> > On Oct 14, 1:07 pm, aledr wrote: >> >> You can get it directly from the Python repo[1]. >> >> Otherwise you need python-distribute or python-setuptools to build it >> >> (you can just install one of them with 'zypper in python-...' or >> >> download from the same[1] repo). >> >> >> [1]:http://download.opensuse.org/repositories/devel:/languages:/python/ >> >> >> On Fri, Oct 14, 2011 at 1:54 PM, Andrew Johnson >> >> >> wrote: >> >> > I download and untar Django-1.3.1 and try to install and get: >> >> >> > django/Django-1.3.1> sudo python setup.py install >> >> > Traceback (most recent call last): >> >> > File "setup.py", line 1, in ? >> >> > from distutils.core import setup >> >> > ImportError: No module named distutils.core >> >> >> > I don't see a file named distutils.core anywhere I look. Did >> >> > something go wrong with my download? >> >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups "Django users" group. >> >> > To post to this group, send email to django-users@googlegroups.com. >> >> > To unsubscribe from this group, send email to >> >> > django-users+unsubscr...@googlegroups.com. >> >> > For more options, visit this group >> >> > athttp://groups.google.com/group/django-users?hl=en. >> >> >> -- >> >> [ ]'s >> >> Aledr - Alexandre >> >> "OpenSource Solutions for SmallBusiness Problems" >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Django users" group. >> > To post to this group, send email to django-users@googlegroups.com. >> > To unsubscribe from this group, send email to >> > django-users+unsubscr...@googlegroups.com. >> > For more options, visit this group >> > athttp://groups.google.com/group/django-users?hl=en. >> >> -- >> [ ]'s >> Aledr - Alexandre >> "OpenSource Solutions for SmallBusiness Problems" > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- [ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems" -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Suse Linux installation
It is the openSUSE software repos site. You can check how to usage it here[1]. Choose the correct folder from the openSUSE version you are using. [1]: http://en.opensuse.org/SDB:Zypper_usage On Mon, Oct 17, 2011 at 4:37 PM, Andrew Johnson wrote: > Thanks for the response! > > Where can I get more guidance about how to use the website you > reference? I go there and see nothing about django and am unsure how > to proceed. > > On Oct 14, 1:07 pm, aledr wrote: >> You can get it directly from the Python repo[1]. >> Otherwise you need python-distribute or python-setuptools to build it >> (you can just install one of them with 'zypper in python-...' or >> download from the same[1] repo). >> >> [1]:http://download.opensuse.org/repositories/devel:/languages:/python/ >> >> On Fri, Oct 14, 2011 at 1:54 PM, Andrew Johnson >> >> wrote: >> > I download and untar Django-1.3.1 and try to install and get: >> >> > django/Django-1.3.1> sudo python setup.py install >> > Traceback (most recent call last): >> > File "setup.py", line 1, in ? >> > from distutils.core import setup >> > ImportError: No module named distutils.core >> >> > I don't see a file named distutils.core anywhere I look. Did >> > something go wrong with my download? >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Django users" group. >> > To post to this group, send email to django-users@googlegroups.com. >> > To unsubscribe from this group, send email to >> > django-users+unsubscr...@googlegroups.com. >> > For more options, visit this group >> > athttp://groups.google.com/group/django-users?hl=en. >> >> -- >> [ ]'s >> Aledr - Alexandre >> "OpenSource Solutions for SmallBusiness Problems" > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- [ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems" -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Suse Linux installation
You can get it directly from the Python repo[1]. Otherwise you need python-distribute or python-setuptools to build it (you can just install one of them with 'zypper in python-...' or download from the same[1] repo). [1]: http://download.opensuse.org/repositories/devel:/languages:/python/ On Fri, Oct 14, 2011 at 1:54 PM, Andrew Johnson wrote: > I download and untar Django-1.3.1 and try to install and get: > > django/Django-1.3.1> sudo python setup.py install > Traceback (most recent call last): > File "setup.py", line 1, in ? > from distutils.core import setup > ImportError: No module named distutils.core > > I don't see a file named distutils.core anywhere I look. Did > something go wrong with my download? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- [ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems" -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: 32-bit integers IP address to 4-octet IP address
>From the Django docs[1]: "values() takes optional positional arguments, *fields, which specify field names to which the SELECT should be limited. If you specify the fields, each dictionary will contain only the field keys/values for the fields you specify. If you don't specify the fields, each dictionary will contain a key and value for every field in the database table." So, when you try "ip = Iphdr.objects.values("ip_src")" you are not getting the 32 bit integer you want. [1]: http://docs.djangoproject.com/en/dev/ref/models/querysets/ On Sun, Jan 23, 2011 at 8:36 PM, phil...@bailey.st wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I aledr, > > thanks for your reply, > > > I've added the socket.inet_ntoa to my view.py > > #view.py > from django.http import HttpResponse > import socket > from snort.models import Iphdr > > > def snort(request): > > ip = Iphdr.objects.values("ip_src") > return socket.inet_ntoa(ip) > > > after opening the web page I get this error bac > > > > > > Request Method: GET > Request URL: http://192.168.1.5:8080/ > Django Version: 1.3 beta 1 > Exception Type: TypeError > Exception Value: > > inet_aton() argument 1 must be string, not ValuesQuerySet > > Exception Location: /home/user/django/app/../snort/views.py in snort, > line 10 > Python Executable: /usr/bin/python > Python Version: 2.6.5 > Python Path: > > ['/home/crypto/django/snort', > '/usr/lib/python2.6', > '/usr/lib/python2.6/plat-linux2', > '/usr/lib/python2.6/lib-tk', > '/usr/lib/python2.6/lib-old', > '/usr/lib/python2.6/lib-dynload', > '/usr/lib/python2.6/dist-packages', > '/usr/lib/pymodules/python2.6', > '/usr/lib/pymodules/python2.6/gtk-2.0', > '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', > '/usr/local/lib/python2.6/dist-packages'] > ~ > > > What I'm doing wrong ? > > Thanks again, > > Phillip > > > > On 01/23/2011 07:18 PM, aledr wrote: >> I guess socket.inet_ntoa is enough for what you need. >> >> On Sun, Jan 23, 2011 at 7:06 AM, Phillip Bailey wrote: >> >> >> Dear All, >> >> I've started playing around with Django in the last few days, and I'm >> enjoying the speed >> and the power of such framework. I'm writing a small application to >> display and sort >> ip addresses stored in a Postgresql database, right now I'm stuck with >> 32-bit integers >> IP address translated to 4-octet IP address . >> >> Here's the the class of the ip address. >> >> class Iphdr(models.Model): >> sid = models.IntegerField(primary_key=True) >> cid = models.BigIntegerField(primary_key=True) >> ip_src = models.BigIntegerField() >> ip_dst = models.BigIntegerField() >> ip_ver = models.SmallIntegerField() >> ip_hlen = models.SmallIntegerField() >> ip_tos = models.SmallIntegerField() >> ip_len = models.IntegerField() >> ip_id = models.IntegerField() >> ip_flags = models.SmallIntegerField() >> ip_off = models.IntegerField() >> ip_ttl = models.SmallIntegerField() >> ip_proto = models.SmallIntegerField() >> ip_csum = models.IntegerField() >> class Meta: >> db_table = u'iphdr' >> >> >> As the IP addresses are stored in the database as unsigned 32-bit >> integers, so when I >> run ip = Iphdr.objects.values("ip_src") the result is in 32-bit integers, >> >> {'ip_src': 3251031814L}{'ip_src': 3251031816L}{'ip_src': 3251031816L} >> {'ip_src': 3251031816L}{'ip_src': 3251031814L}{'ip_src': 3251031816L} >> >> There's any elegant solution that can translate 32-bit integers to >> 4-octet IP address (192.168.1.88) ? >> >> Thanks in advance. >> >> Phillip >>> > - -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. >>> >>> >> -- >> [ ]'s >> Aledr - Alexandre >> "OpenSource Solutions for SmallBusiness Problems" > > - -- > Snorby SSD: The IDS (Intrusion Detect
Re: 32-bit integers IP address to 4-octet IP address
I guess socket.inet_ntoa is enough for what you need. On Sun, Jan 23, 2011 at 7:06 AM, Phillip Bailey wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > Dear All, > > I've started playing around with Django in the last few days, and I'm > enjoying the speed > and the power of such framework. I'm writing a small application to > display and sort > ip addresses stored in a Postgresql database, right now I'm stuck with > 32-bit integers > IP address translated to 4-octet IP address . > > Here's the the class of the ip address. > > class Iphdr(models.Model): > sid = models.IntegerField(primary_key=True) > cid = models.BigIntegerField(primary_key=True) > ip_src = models.BigIntegerField() > ip_dst = models.BigIntegerField() > ip_ver = models.SmallIntegerField() > ip_hlen = models.SmallIntegerField() > ip_tos = models.SmallIntegerField() > ip_len = models.IntegerField() > ip_id = models.IntegerField() > ip_flags = models.SmallIntegerField() > ip_off = models.IntegerField() > ip_ttl = models.SmallIntegerField() > ip_proto = models.SmallIntegerField() > ip_csum = models.IntegerField() > class Meta: > db_table = u'iphdr' > > > As the IP addresses are stored in the database as unsigned 32-bit > integers, so when I > run ip = Iphdr.objects.values("ip_src") the result is in 32-bit integers, > > {'ip_src': 3251031814L}{'ip_src': 3251031816L}{'ip_src': 3251031816L} > {'ip_src': 3251031816L}{'ip_src': 3251031814L}{'ip_src': 3251031816L} > > There's any elegant solution that can translate 32-bit integers to > 4-octet IP address (192.168.1.88) ? > > Thanks in advance. > > Phillip > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (GNU/Linux) > > iQEcBAEBAgAGBQJNO++eAAoJENNBJKHbaDgTM0cH/0/QjdPTi53tJG4YhjVpt6oj > cJk6rAEHwFha//Vby4lH2sT+ZyKmv+UAjSVmvBCptXBOcm5LuedMmMCVeInfuliQ > GeOPlQ4nvrZSbcdXirLu9Jqa+Yqj6nalGF7i0WetqvdsdrkQQdrcx1D814DSZKGq > qQWpdyVEmdrRSfiOUvrYbnXDCnTwCXZdUhcpDNmD+5h9S2/uiMzP5cM2wtfMg1hO > swYS9B7h/6vAd1ekOZh+ij2X4mszUfp5rQzFjCXtYnQma8pN+58UMpWwYVKj2FzA > tgRaWC1Qz4hWsXRvwirqo/ZtyJMWxkOdwVaxl3iug/NCGW/yDCMa97zweYOHKCs= > =W+IC > -END PGP SIGNATURE- > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- [ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems" -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: read only django admin
On Fri, Jan 29, 2010 at 12:55 AM, zweb wrote: > Is it possible to have a read only django admin, ie user cannot add, > delete or update. User can only view data. > > or may be one user can be view only and other user has add/delete / > update as well in Django admin. > > How to do that? http://www.alextreme.org/drupal/?q=django-view-permissions-patch Just read at bottom: "Feel free to use the patch, but be warned: if users logging in to your site really want to change something, they'll probably find a way through." -- [ ]'s Aledr - Alexandre "OpenSource Solutions for SmallBusiness Problems" -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.