The first thing to do is to install Git on the remote server.
Once you do that the rest of the process is split into three sections:
- Server set-up
- Local set-up (push commits)
- Server (pull commits)
| from types import MethodType | |
| from django.http import CompatCookie, HttpRequest | |
| def _set_cookie(self, key, value='', max_age=None, expires=None, path='/', | |
| domain=None, secure=False): | |
| self._resp_cookies[key] = value | |
| self.COOKIES[key] = value | |
| if max_age is not None: |
| """ User Django Rest Framework to check to see if an authenticated user | |
| is in a particular group | |
| Usage:: | |
| from api.group_permissions import GroupAPIGETPermission | |
| class SearchProductView(View): | |
| permissions = (IsAuthenticated, GroupAPIGETPermission,) |
| <?php | |
| // See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html | |
| // Start a session (which should use cookies over HTTP only). | |
| session_start(); | |
| // Create a new CSRF token. | |
| if (! isset($_SESSION['csrf_token'])) { | |
| $_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32)); | |
| } |
| class TransactionsList(ListAPIView): | |
| """ | |
| List all transactions for currently logged in user, paginated by 25 | |
| page -- page number | |
| ordering -- yoddle_amount, created, yoddle_description, reverse order ie. -yoddle_amount | |
| """ | |
| model = Transaction |
| from celery import Task | |
| from celery.task import task | |
| from my_app.models import FailedTask | |
| from django.db import models | |
| @task(base=LogErrorsTask) | |
| def some task(): | |
| return result | |
| class LogErrorsTask(Task): |
| Disclaimer: The instructions are the collective efforts from a few places online. | |
| Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did. | |
| First off, bundle. | |
| ================== | |
| 1. cd to the project directory | |
| 2. Start the react-native packager if not started | |
| 3. Download the bundle to the asset folder: | |
| curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle" |
To run on ios:
xcode-select --installnpm run iosTo run on Android:
npm run android-emulator-createnpm run android| <?php | |
| require 'vendor/autoload.php'; | |
| use GuzzleHttp\Client; | |
| $client = new Client([ | |
| 'base_uri' => 'http://example.com', | |
| ]); |