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
| def r_sleep(): | |
| ''' generates a random sleep between 2.000 and 10.000 seconds ''' | |
| length = float(randint(2000, 10000)) / 1000 | |
| mylog("Safety Random Sleep has started for {0} sec".format(length)) | |
| sleep(length) | |
| mylog("Safety Random Sleep is over") |
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
| fake_headers = { | |
| # Headers taken from Chrome spy mode | |
| 'Connection': 'keep-alive', | |
| 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', | |
| 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36', | |
| 'Accept-Encoding': 'gzip, deflate, sdch', | |
| 'Accept-Language': 'fr,en-US;q=0.8,en;q=0.6'} | |
| r = requests.get(cur_url, headers=fake_headers) |
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
| {% load static from staticfiles %} | |
| <img src="{% static "images/toto.jpg" %}" /> |
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
| AWS_STORAGE_BUCKET_NAME = "bucket_name" | |
| AWS_ACCESS_KEY_ID = "your_access_key_id" | |
| AWS_SECRET_ACCESS_KEY = "your_secret_access_key" | |
| AWS_S3_HOST = "your_s3_host" | |
| AWS_S3_URL = 'https://{0}.s3.amazonaws.com/'.format(AWS_STORAGE_BUCKET_NAME) | |
| AWS_STATIC_DIR = 'static' | |
| STATIC_URL = AWS_S3_URL + AWS_STATIC_DIR + '/' | |
| STATICFILES_STORAGE = 'your_project_name.storage.StaticRootS3BotoStorage' |
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 storages.backends.s3boto import S3BotoStorage | |
| from django.conf import settings | |
| class StaticRootS3BotoStorage(S3BotoStorage): | |
| location = settings.AWS_STATIC_DIR |
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
| AWS_MEDIA_DIR = 'media' | |
| MEDIA_URL = AWS_S3_URL + AWS_MEDIA_DIR + '/' | |
| DEFAULT_FILE_STORAGE = 'livinproject.storage.MediaRootS3BotoStorage' |
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 MediaRootS3BotoStorage(S3BotoStorage): | |
| location = settings.AWS_MEDIA_DIR |
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
| DEBUG = (os.environ['DJANGO_DEBUG'] in ['True', 'true']) | |
| MANDRILL_KEY = os.environ.get('DJANGO_MANDRILL_KEY') | |
| SEND_MAIL = (os.environ['DJANGO_SEND_MAIL'] in ['True', 'true']) |
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
| var cfg = { | |
| backend_host: 'www.magnetiz.fr', | |
| api_name: 'api_t', | |
| app_version: '2-1-0', | |
| google_play_url: 'http://play.google.com/store/apps/details?id=com.ionicframework.magnetiztablet479260' | |
| } |
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
| url(r'api_t/2-[0-2]-[0-9]/get_owner_infos/$', GetOwnerInfos_1.as_detail(), name='get_owner_infos') |