Posts

Django With ReactJs

  Solving CSRF issue on React With Django (Running on Django Server) npm install js-cookie --save import Cookies from 'js-cookie' const csrftoken = Cookies.get( 'csrftoken' ) // Cookies from Django Domain const loginRequest = async () => { await Axios({ method : "post" , url : `/api/api-auth/login/` , headers : { 'X-CSRFToken' : csrftoken }, data : {} }).then( ( res ) => { console .log(res.data); }) } Fetch CSRF Token from Django Server: django.middleware.csrf.get_token(request) Send emails with Django and Gmail , a better way : https://dev.to/abderrahmanemustapha/how-to-send-email-with-django-and-gmail-in-production-the-right-way-24ab

Solution to install 'Pyrebase' in python3.6 django framework

https://stackoverflow.com/questions/48047495/when-pip-install-pyrebase-i-got-error-unicodedecodeerror-cp949-codec-can

City Vehicles References

Make an Android App like Uber - YouTube Link:  https://www.youtube.com/playlist?list=PLxefhmF0pcPl6gcWvrpTbjGO7rcMWY1jT GeoLocation Library:  https://github.com/firebase/geofire-android Google Maps for Android in Urdu/Hindi - YouTube Link:  https://www.youtube.com/playlist?list=PLj76U7gxVixRiyR_fJlpPR-tAlK0Py7f4 https://android.googlesource.com/platform/packages/experimental/+/001472f/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationShowcaseActivity.java Android Material Color System:  https://material.io/design/color/the-color-system.html#tools-for-picking-colors AutoCompleteTextView with a custom adapter: https://codinginflow.com/tutorials/android/custom-autocompletetextview/part-1-layouts-model-class https://codinginflow.com/tutorials/android/custom-autocompletetextview/part-2-adapter

Create a Music Player on Android

Create a Music Player on Android: Project Setup https://code.tutsplus.com/tutorials/create-a-music-player-on-android-project-setup--mobile-22764 Create a Music Player on Android: Song Playback https://code.tutsplus.com/tutorials/create-a-music-player-on-android-song-playback--mobile-22778 Create a Music Player on Android: User Controls https://code.tutsplus.com/tutorials/create-a-music-player-on-android-user-controls--mobile-22787 MediaPlayer overview (Google Guide) https://developer.android.com/guide/topics/media/mediaplayer.html#audiofocus A Step by Step Guide to Building an Android Audio Player App https://www.sitepoint.com/a-step-by-step-guide-to-building-an-android-audio-player-app/ Media streaming with ExoPlayer Media Streaming with Exoplayer: https://codelabs.developers.google.com/codelabs/exoplayer-intro Media streaming with ExoPlayer Media streaming with ExoPlayer

PHP and JQuery Stuff

Declaring non Existing object: In order to comply with  E_STRICT  standards prior to PHP 5.4, or the normal  E_WARNING  error level in PHP >= 5.4, assuming you are trying to create a generic object and assign the property  success , you need to declare  $res  as an object of  stdClass  in the global namespace: $res = new \stdClass (); $res -> success = false ; Jquery Email Regex: var userinput = $ ( this ). val (); var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/ i if (! pattern . test ( userinput )) { alert ( 'not a valid e-mail address' ); }​ Jquery Session: https://www.w3schools.com/jsref/prop_win_localstorage.asp How to bind click event to dynamically created HTML elements in jQuery If you try to do something with the elements that are dynamically added to DOM using the jQuery  click()  method it will not work, because it bind the click event only to the elements that exist at the ...

Django Rest Framwork Important Stuff

Serializing Django objects: https://docs.djangoproject.com/en/dev/topics/serialization/ Filtering against the URL : https://www.django-rest-framework.org/api-guide/filtering/

Hosting to Heroku and Amazon S3 Service

How to Setup Amazon S3 in a Django Project: https://simpleisbetterthancomplex.com/tutorial/2017/08/01/how-to-setup-amazon-s3-in-a-django-project.html Amazon S3 Storage: https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html S3 Static & Media Files for Django: https://www.codingforentrepreneurs.com/blog/s3-static-media-files-for-django/ Configuring Django Apps for Heroku: https://devcenter.heroku.com/articles/django-app-configuration Heroku Python Support: https://devcenter.heroku.com/articles/python-support Youtube: Hosting and Deploying app on Heroku: https://www.youtube.com/watch?v=MoX36izzEWY How To Deploy Django App on Heroku: https://www.codementor.io/jamesezechukwu/how-to-deploy-django-app-on-heroku-dtsee04d4 // Disable the static file for Heroku heroku config:set DISABLE_COLLECTSTATIC=1 // Create seed for db python manage.py dumpdata information.Slider --format json --indent 4 > information/fixtures/sliders.json // To load data...