Skip to main content

Posts

Showing posts from 2018

DJANGO Startup

https://www.ostechnix.com/install-django-web-framework-ubuntu-16-04/ https://stackoverflow.com/questions/46210934/importerror-couldnt-import-django create a folder now in cmd: go to that folder make virtual environment there: virtualenv py1 now activate the environment: .\py1\Scripts\activate then virtual env is activated: now install django python -m pip install django : to install django in project create project: django-admin startproject projectname now open project in vscode and pip install mysqlclient :  to install mysql in django for going to py1 environment from cmd workon py1 DATABASES={ 'default' :{ 'ENGINE' : 'django.db.backends.mysql' , 'NAME' : 'djangoproject' , 'USER' : 'root' , 'PASSWORD' : '' , 'HOST' : 'localhost' , 'PORT' : '' } } inside settings.py write this code to connect with mysql , for that first c

check website information

to identify info about visitor:  https://www.alexa.com/siteinfo to estimate daily visitor and worthy info:  http://www.siteworthtraffic.com/report other site:  https://www.worthofweb.com check whether  domain is registered or not: https://domainregistrationinnepal.com/domain-registration/index.php http://www.mos.com.np/domain-registration.php

resize image and store it as thumbnail as well as store real image in laravel + resize image and store in laravel

Reference site 1: https://itsolutionstuff.com/post/laravel-5-image-upload-and-resize-example-using-intervention-image-packageexample.html i.e.   intervention/image  in laravel Main reference site is : http://image.intervention.io/ when any error ocurs during integration then follow : https://laracasts.com/discuss/channels/laravel/some-problems-with-install-intervention-image?page=1 INSIDE CONTROLLER : use Intervention\Image\Facades\ Image ;  In store funtion and update function: if (! empty ( $request -> file ( 'image' ))){ $file = $request -> file ( 'image' ); // dd($file); $path = base_path (). '/public/multimedia_upload' ; $thumbpath = public_path ( '/multimedia_upload' ); // this above is folder name inside public folder where we store thubnail $img = Image :: make ( $file -> getRealPath ())-> resize ( 100 , 100 , function ( $constraint ) { $constraint -> aspectRatio ();}); $name = uniqid

generate chart dynamically in laravel by getting data from database

Controller : public function boardkarya () { $labeltmp = array (); // $tmplabel=array(); $valuetmp = array (); $value = array (); $label = array (); // $tmpvalue=array(); $charts = array (); $trainings = Training :: where ( 'status' , '1' )-> orderBy ( 'id' , 'desc' )-> get (); $category = Chart :: select ( 'category_id' )-> distinct ()-> get (); // dd($category); foreach ( $category as $key => $item ) { $tmpcharts = Chart :: where ( 'status' , '1' )-> where ( 'category_id' , $item -> category_id )-> orderBy ( 'id' , 'desc' )-> get (); array_push ( $charts , $tmpcharts ); # code... } foreach ( $charts as $i => $items ) { $tmplabel = array (); $tmpvalue = array (); foreach ( $items as $key => $item ) { array_push ( $tmplabel , $item -> fiscal ); array_push ( $tmpvalue , $item -> total ); } array_push (