This instructs Compose to run django-admin startproject composeexample in a container, using the web service’s image and configuration. Because the web image doesn’t exist yet, Compose builds it from the current directory, as specified by the build:. Line in docker-compose.yml. Once the web service image is built, Compose runs it and executes the django-admin startproject command in the. Download Mac OS X 64-bit/32-bit installer; Python 2.7.12 - June 25, 2016. Download Mac OS X 32-bit i386/PPC installer; Download Mac OS X 64-bit/32-bit installer; Python 3.4.4 - Dec. Download Mac OS X 32-bit i386/PPC installer; Download Mac OS X 64-bit/32-bit installer; Python 3.5.1 - Dec. Download Mac OS X 32-bit i386/PPC.
Latest version Released:
MAC address model and form fields for Django apps.
Project description
MAC Address model and form fields for Django
We use netaddr to parse and validate the MAC address. The tests aren’tcomplete yet.
Patches welcome: http://github.com/django-macaddress/django-macaddress
Release Notes:
For release info: https://github.com/django-macaddress/django-macaddress/releases
Getting Started
settings.MACADDRESS_DEFAULT_DIALECT
To specify a default dialect for presentation (and storage, see below), specify:
where the specified value is a string composed of a parent python module nameand the child dialect class name. For example:
PS: old default of macaddress.mac_linux (uppercase and divided by ‘:’ ) will be used by default.
If the custom dialect is defined in a package module, you will need to define theclass in or import into the package’s __init__.py.
default_dialect and format_mac
To get the default dialect for your project, import and call the default_dialect function:
This function may, optionally, be called with an netaddr.EUI class instance as its argument. If nodefault is defined in settings, it will return the dialect of the provided EUI object.
The format_mac function takes an EUI instance and a dialect class (netaddr.mac_eui48 or asubclass) as its arguments. The dialect class may be specified as a string in the same manner assettings.MACADDRESS_DEFAULT_DIALECT:
MACAddressField (ModelField)
This is an example model using MACAddressField:
The default behavior is to store the MAC Address in the database is a BigInteger.If you would, rather, store the value as a string (to, for instance, facilitatesub-string searches), you can specify integer=False and the value will be storedas a string:
If you want to set unique=True on a MACAddressField that is stored as a string, you will needto set null=True and create custom clean_<foo> methods on your forms.ModelForm class foreach MACAddressField that return None when the value provided is an ' (empty string):
You should avoid changing the value of integer after running managy.py syncdb,unless you are using a schema migration solution like South or Django’s built-in migrations.
To Do
- Add greater support for partial string queries when storing MACs as strings in the database.
- Add custom validator to check for duplicate MACs when mixing string and integer storage types.
- Add deprecation warning and timeline for changeover to default string storage.
Release historyRelease notifications | RSS feed
1.7.0
1.6.0
1.5.0
1.4.1
1.4.0
1.3.2
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size django_macaddress-1.7.0-py2.py3-none-any.whl (8.3 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes |
Filename, size django-macaddress-1.7.0.tar.gz (7.2 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for django_macaddress-1.7.0-py2.py3-none-any.whl
Python Django Install
Algorithm | Hash digest |
---|---|
SHA256 | db8beedcbd708aba3a6c9e83de6527efa2f9cc7dbe698406cebdfdbaf98c896d |
MD5 | 6554f3b8d9cd91e2ac0c5ca7ca8b763f |
BLAKE2-256 | ecfac0542bd4252af14b0dffe7e4e0baf4c87f4fd4f447e3f05a6f5328235b87 |
Install Django For Mac
CloseHashes for django-macaddress-1.7.0.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 342aa3421ee19acc3661d1705dad2ae674eaa7d06a02799f7a5dc394d6233275 |
MD5 | 39deeaecc3b8857d7f9fd0281e29241a |
BLAKE2-256 | 43258e56620a65c76b1f6cc6a1de5ef8d59b167fb3694896ab3014671d9adc9a |