This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/run_supervised_daemon.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/usr/bin/env bash | |
# Get django environment variables | |
djangoenv=`cat /opt/python/current/env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
# Create your models here. | |
class Actor(models.Model): | |
first_name = models.CharField(max_length=128) | |
last_name = models.CharField(max_length=128) | |
dp = models.CharField(max_length=512, blank=True, null=True) | |
age = models.IntegerField(blank=True, null=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# Application definition | |
INSTALLED_APPS = [ | |
'django.contrib.admin', | |
'django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.staticfiles', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""mobileBackend URL Configuration | |
The `urlpatterns` list routes URLs to views. For more information please see: | |
https://docs.djangoproject.com/en/2.0/topics/http/urls/ | |
Examples: | |
Function views | |
1. Add an import: from my_app import views | |
2. Add a URL to urlpatterns: path('', views.home, name='home') | |
Class-based views | |
1. Add an import: from other_app.views import Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render | |
from django.http import HttpResponse | |
from .models import Actor | |
# Create your views here. | |
def fetch_actors(request): | |
#fetch all the actor objects | |
actors = Actor.objects.all() | |
#send the actor objects as a response | |
return HttpResponse(actors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.serializers import ModelSerializer | |
from .models import Actor | |
class ActorSerializer(ModelSerializer): | |
class Meta: | |
model = Actor | |
fields = '__all__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .models import Actor | |
from rest_framework.decorators import api_view | |
from .serializers import ActorSerializer | |
from rest_framework.response import Response | |
# Create your views here. | |
@api_view(['get']) | |
def fetch_actors(request): | |
#fetch all the actor objects | |
actors = Actor.objects.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="text-align:center"> | |
<h1> | |
Welcome to {{ title }}! | |
</h1> | |
<img width="300" alt="Angular Logo"> | |
</div> | |
<div class="input-container"> | |
<input | |
type="text" | |
class="google-place-input" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.input-container { | |
text-align: center; | |
width: 100%; | |
} | |
.google-place-input { | |
width: 50%; | |
min-width: 280px; | |
height: 2rem; | |
font-size: 1.5rem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, ElementRef, OnInit } from '@angular/core'; | |
const google = require('@types/googlemaps'); | |
@Directive({ | |
selector: '[google-place]' | |
}) | |
export class GooglePlacesDirective implements OnInit { | |
private element: HTMLInputElement; | |
constructor(private elRef: ElementRef) { |
OlderNewer