This file contains 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
{% block message_info_homepage %}{% endblock %} | |
{% for object in object_list %} | |
<div class="post"> | |
<h2><a href="{% url 'detail_post_page' slug=object.slug %}">{{ object.title }}</a></h2> | |
<p class="meta"> | |
By: <a href="{% url 'author_posts_page' username=object.author.user.username %}" style="text-transform:uppercase">{{ object.author }}</a> ● | |
at {{ object.created }} ● | |
Posted under: | |
{% for tag in object.tags.all %} |
This file contains 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 movies(request): | |
movie_all = MoviesList.objects.all() | |
page = request.GET.get('page', 1) | |
paginator = Paginator(movie_all, 10) | |
try: | |
movies = paginator.page(page) | |
except PageNotAnInteger: | |
movies = paginator.page(1) | |
except EmptyPage: | |
movies = paginator.page(paginator.num_pages) |
This file contains 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 recipe_form(request): | |
if not request.user.is_superuser: | |
raise Http404 | |
ImageFormSet = modelformset_factory(Recipe_images, form=Recipe_imageForm, extra=10) | |
if request.method == 'POST': | |
form = Recipe_form(request.POST or None, request.FILES or None) | |
formset = ImageFormSet(None, None, queryset=Recipe_images.objects.none()) | |
if form.is_valid() and formset.is_valid(): | |
instance = form.save(commit=False) |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous"> | |
<title>Recipe Form</title> | |
{{ form.media }} | |
</head> | |
<body> | |
{% if messages %} |
This file contains 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
#home.html | |
<!--Timeline header area start --> | |
<form action="." method="post" name="category_form"> | |
{% csrf_token %} | |
<div class="post-list-header"> | |
<span class="post-list-title">Latest stories</span> | |
<select class="frm-input" name="category_name" id="category_name"> | |
<option value="dummy">select category</option> |
This file contains 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
~/Downloads:~$ git clone -b extended --single-branch https://github.com/lwfinger/rtlwifi_new.git | |
~/Downloads :~$ cd rtlwifi_new | |
~/Downloads/rtlwifi_new :~$ make | |
~/Downloads/rtlwifi_new :~$ sudo make install | |
~/renjith:~$ sudo reboot |
This file contains 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
import time | |
class Account: | |
def __init__(self): | |
self.style = {'1':"sporty", '2':"gimmick", '3':"casual", '4':"kpop", '5':"simple"} | |
self.price = {'1':5, '2':10, '3':15, '4':20, '5':25} | |
def stock(self): | |
stock = {'sporty':5,'gimmick':5,'casual':5,'kpop':5,'simple':5} | |
for digit in enter_quantity: | |
for styles in enter_item: |
This file contains 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
$(document).ready(function(){ | |
$("#your-dropdown-id").change(function(){ | |
var drid = $(this).val(); | |
$.ajax({ | |
url: 'getUsers.php', | |
type: 'post', | |
data: {value:drid}, | |
dataType: 'json', | |
success:function(response){ | |
// add the json response into html values |
This file contains 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
Create Virtualenv with Python3 | |
============================== | |
1. mkvirtualenv --python=/usr/local/bin/python3 multichat | |
2. workon multichat | |
3. pip3 install ipython | |
This file contains 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 __future__ import unicode_literals | |
from django.contrib.auth.models import User | |
from django.contrib.auth.models import AbstractUser | |
from django.db import models | |
GENDER = (('F','Female'),('M','Male')) | |
# Create your models here. | |
class Proffession(models.Model): |
NewerOlder