This file contains hidden or 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
    
  
  
    
  | # SQLite database | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.sqlite3', | |
| 'NAME': 'mydatabase', | |
| } | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #MYSql Database | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.mysql', | |
| 'NAME': config('DB_NAME'), | |
| 'USER': config('DB_USER'), | |
| 'PASSWORD': config('DB_PASSWORD'), | |
| 'HOST': '127.0.0.1', | |
| 'PORT': '3306', | 
  
    
      This file contains hidden or 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
    
  
  
    
  | python -m pip freeze > requirements.txt | 
  
    
      This file contains hidden or 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
    
  
  
    
  | python -m pip install -r requirements.txt | 
  
    
      This file contains hidden or 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
    
  
  
    
  | python3 -m venv env | |
| source env/bin/activate | 
  
    
      This file contains hidden or 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 React, { useState, useEffect ,useRef } from 'react'; | |
| import { | |
| SafeAreaView, | |
| ScrollView, | |
| StyleSheet, | |
| View, | |
| ImageBackground, | |
| Image, | |
| Animated, | |
| Dimensions, | 
  
    
      This file contains hidden or 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
    
  
  
    
  | if __name__ =='__main__': | |
| blog_publisher = BlogPublisher() | |
| for Subscribers in [SMSSubscriber,EmailSubscriber,AnyOtherSubscriber]: | |
| Subscribers(blog_publisher) | |
| print("\n Subscribers : ",blog_publisher.subscribers()) | |
| blog_publisher.addBlog('My First Blog!') | |
| blog_publisher.notifySubscribers() | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class SMSSubscriber: | |
| def __init__(self,publisher): | |
| self.publisher=publisher | |
| self.publisher.attach(self) | |
| def update(self): | |
| print(type(self).__name__,self.publisher.getBlog()) | |
| class EmailSubscriber: | |
| def __init__(self,publisher): | 
  
    
      This file contains hidden or 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 abc import ABCMeta, abstractmethod | |
| class Subscriber(metaclass=ABCMeta): | |
| @abstractmethod | |
| def update(self): | |
| pass | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class BlogPublisher: | |
| def __init__(self): | |
| self.__subscribers=[] | |
| self.__latestBlog = None | |
| def attach(self,subscriber): | |
| self.__subscribers.append(subscriber) | |
| def detach(self): | |
| return self.__subscribers.pop() | |
| def subscribers(self): | |
| return [type(x).__name__ for x in self.__subscribers] | 
NewerOlder