- Open terminal using keyboard ctrl+alt T
- sudo add-apt-repository ppa:jonathonf/python-3.6
- sudo apt-get update
- sudo apt-get install python3.6
- sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.5 1
- sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.6 2
- sudo update-alternatives –config python3
- python3 -V then show : Python 3.6.1+
Jquery add / remove attribute
Add Attribute –
$(‘#id’).attr(‘attribute name’,’attribute value’);
$(‘.class’).attr(‘attribute name’,’attribute value’);
Like $(‘#id’).attr(‘multiple’,’multiple’);
Remove Attribute –
$(‘#id’).removeAttr(‘attribute name’);
$(‘.class’).removeAttr(‘attribute name’);
Unable to locate WordPress Content directory wp-content
Add line in wp-config.php file
After this line – /** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);
*** define(‘FS_METHOD’, ‘direct’);
Setting up the uWSGI Application Server
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo -H pip install uwsgi
How to Install and Configure Nginx server in ubuntu16.04 LTS
1. sudo vi /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
2. sudo apt-get update
3. sudo apt-get upgrade
4. sudo apt-get install nginx
5. sudo apt-get install mysql-server
6. sudo apt-get install python-pip
7. sudo apt-get install python3-pip
8. sudo -H pip install –upgrade pip
9. sudo -H pip install virtualenv virtualenvwrapper
10. sudo -H pip3 install –upgrade pip
11. sudo -H pip3 install virtualenv virtualenvwrapper
12. If you are using Python 3 and the pip3 command, you will have to add an additional line to your shell initialization script as well: echo “export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3” >> ~/.bashrc
13. Regardless of which version of Python you are using, you need to run the following commands: echo “export WORKON_HOME=~/Env” >> ~/.bashrc
14. echo “source /usr/local/bin/virtualenvwrapper.sh” >> ~/.bashrc
15. source ~/.bashrc
16. Create your first virtual environment with the name of your first site or project by typing: mkvirtualenv firstsite
17. pip install django
18. we can create our first sample project by typing: django-admin.py startproject firstsite
19. cd ~/firstsite
20. ~/firstsite/manage.py migrate
21. ~/firstsite/manage.py createsuperuser
22. ~/firstsite/manage.py: A Django project management script.
23. ~/firstsite/firstsite/: The Django project package. This should contain the __init__.py, settings.py, urls.py, and wsgi.py files.
24. ~/firstsite/db.sqlite3: The SQLite database file used to store your site information.
25. sudo vi ~/firstsite/firstsite/settings.py
26. STATIC_URL = ‘/static/’
STATIC_ROOT = os.path.join(BASE_DIR, ‘static/’)
27. ~/firstsite/manage.py collectstatic
Check apache config files’ syntax
sudo apachectl configtest
Removing .html Extension from URL and redirect
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
Removing .php Extension from URL and redirect
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [NC,L]
Remove .html extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
remove php file extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]