Skip to content

Instantly share code, notes, and snippets.

View coderdipto's full-sized avatar
🏠
Working from home

Sudipto Das coderdipto

🏠
Working from home
  • Dhaka, Bangladesh
View GitHub Profile
@coderdipto
coderdipto / geodjango_macOS_arm64.md
Created November 28, 2021 20:19 — forked from codingjoe/geodjango_macOS_arm64.md
HowTo run GeoDjango and PostGIS on M1 macOS arm64 MacBook
  1. Install PostgreSQL with PostGIS via Postges.app
  2. Install brew as recommended.
  3. Install dependencies:
    brew install geos gdal
    
  4. Add the following to your settings:
    # settings.py
    

GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')

@Kobold
Kobold / write_restricted_model_serializer.py
Created February 26, 2014 20:34
A default read-only serializer for django-rest-framework as of DRF 2.4.
class RestrictedSerializerOptions(serializers.ModelSerializerOptions):
"""
Meta class options for ModelSerializer
"""
def __init__(self, meta):
super(RestrictedSerializerOptions, self).__init__(meta)
self.writable_fields = getattr(meta, 'writable_fields', ())
class WriteRestrictedModelSerializer(serializers.ModelSerializer):