import random
r = lambda: random.randint(0,255)
print('#%02X%02X%02X' % (r(),r(),r()))
More Related Contents:
- How to query as GROUP BY in django?
- How do I filter query objects by date range in Django?
- Programmatically saving image to Django ImageField
- Does SQLAlchemy have an equivalent of Django’s get_or_create?
- In Django, how does one filter a QuerySet with dynamic field lookups?
- Custom Filter in Django Admin on Django 1.3 or below
- Django Aggregation: Summation of Multiplication of two fields
- How to redirect with post data (Django)
- Django: How to manage development and production settings?
- ImportError: No module named ‘django.core.urlresolvers’
- Django migration strategy for renaming a model and relationship fields
- What is the most efficient way to store a list in the Django models?
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock
- How does Django Know the Order to Render Form Fields?
- Django: Display Choice Value
- Django – taking values from POST request
- Create Django model or update if exists
- Django Admin nested inline
- Get request body as string in Django
- Overriding the save method in Django ModelForm
- Django class-based view: How do I pass additional parameters to the as_view method?
- Accessing dictionary by key in Django template
- Case insensitive unique model fields in Django?
- Updating context data in FormView form_valid method?
- What is the difference between static files and media files in Django?
- How can I set two primary key fields for my models in Django?
- Can I make STATICFILES_DIR same as STATIC_ROOT in Django 1.3?
- PyCharm hangs on ‘scanning files to index’ background task
- How to delete a record in Django models?
- Collectstatic error while deploying Django app to Heroku