├── images ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-38.pyc │ │ └── 0001_initial.cpython-38.pyc │ └── 0001_initial.py ├── tests.py ├── views.py ├── __pycache__ │ ├── apps.cpython-38.pyc │ ├── admin.cpython-38.pyc │ ├── models.cpython-38.pyc │ └── __init__.cpython-38.pyc ├── apps.py ├── admin.py ├── forms.py └── models.py ├── account ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-38.pyc │ │ ├── 0001_initial.cpython-38.pyc │ │ └── 0002_auto_20220610_0854.cpython-38.pyc │ ├── 0001_initial.py │ └── 0002_auto_20220610_0854.py ├── tests.py ├── __pycache__ │ ├── admin.cpython-38.pyc │ ├── apps.cpython-38.pyc │ ├── forms.cpython-38.pyc │ ├── models.cpython-38.pyc │ ├── urls.cpython-38.pyc │ ├── views.cpython-38.pyc │ ├── __init__.cpython-38.pyc │ └── authentication.cpython-38.pyc ├── apps.py ├── admin.py ├── authentication.py ├── models.py ├── forms.py ├── urls.py ├── views.py └── posts ├── bookmarks ├── __init__.py ├── __pycache__ │ ├── urls.cpython-38.pyc │ ├── wsgi.cpython-38.pyc │ ├── __init__.cpython-38.pyc │ └── settings.cpython-38.pyc ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── db.sqlite3 ├── media ├── cool.png └── users │ └── 2022 │ └── 06 │ ├── 10 │ ├── party.png │ ├── smile.png │ └── laughing.png │ └── 09 │ └── cool.png ├── .vscode └── extensions.json ├── staticfiles ├── src │ └── hacking.png └── css │ └── style.css ├── templates ├── registration │ ├── password_reset_email.html │ ├── password_reset_complete.html │ ├── logout.html │ ├── password_reset_done.html │ ├── password_change_done.html │ ├── password_reset_form.html │ ├── password_change_form.html │ ├── password_reset_confirm.html │ └── login.html ├── account │ ├── register_done.html │ ├── register.html │ ├── edit.html │ ├── dashboard.html │ └── profile.html └── base.html └── manage.py /images/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /account/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bookmarks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /account/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /account/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /images/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /media/cool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/media/cool.png -------------------------------------------------------------------------------- /images/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "bibhasdn.django-html" 4 | ] 5 | } -------------------------------------------------------------------------------- /staticfiles/src/hacking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/staticfiles/src/hacking.png -------------------------------------------------------------------------------- /media/users/2022/06/09/cool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/media/users/2022/06/09/cool.png -------------------------------------------------------------------------------- /media/users/2022/06/10/party.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/media/users/2022/06/10/party.png -------------------------------------------------------------------------------- /media/users/2022/06/10/smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/media/users/2022/06/10/smile.png -------------------------------------------------------------------------------- /media/users/2022/06/10/laughing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/media/users/2022/06/10/laughing.png -------------------------------------------------------------------------------- /images/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/images/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/forms.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/forms.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /bookmarks/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/bookmarks/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /bookmarks/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/bookmarks/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /images/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/images/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /images/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/images/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /images/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/images/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /bookmarks/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/bookmarks/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /bookmarks/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/bookmarks/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /account/__pycache__/authentication.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/__pycache__/authentication.cpython-38.pyc -------------------------------------------------------------------------------- /images/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/images/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /account/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /account/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /images/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/images/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /images/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ImagesConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'images' 7 | -------------------------------------------------------------------------------- /account/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'account' 7 | -------------------------------------------------------------------------------- /account/migrations/__pycache__/0002_auto_20220610_0854.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rashidov21/bookmarks/HEAD/account/migrations/__pycache__/0002_auto_20220610_0854.cpython-38.pyc -------------------------------------------------------------------------------- /templates/registration/password_reset_email.html: -------------------------------------------------------------------------------- 1 | Someone asked for password reset for email {{ email }}. Follow the link below: {{ protocol }}://{{ domain }}{% url "account:password_reset_confirm" uidb64=uid token=token %} Your username, in case you've forgotten: {{ user.get_username }} -------------------------------------------------------------------------------- /templates/registration/password_reset_complete.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% block title %}Password reset{% endblock %} {% block content %} 2 |

Password set

3 |

Your password has been set. You can 4 | log in now

5 | {% endblock %} -------------------------------------------------------------------------------- /images/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Image 3 | # Register your models here. 4 | 5 | 6 | @admin.register(Image) 7 | class ImageAdmin(admin.ModelAdmin): 8 | list_display = ['title', 'slug', 'image', 'created'] 9 | list_filter = ['created'] 10 | -------------------------------------------------------------------------------- /account/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Profile, Followers 3 | 4 | # Register your models here. 5 | 6 | 7 | @admin.register(Profile) 8 | class ProfileAdmin(admin.ModelAdmin): 9 | list_display = ['user', 'date_of_birth', 'photo'] 10 | 11 | 12 | admin.site.register(Followers) 13 | -------------------------------------------------------------------------------- /templates/account/register_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% block title %}Welcome{% endblock %} {% block content %} 2 |
3 |

Welcome {{ new_user.first_name }}!

4 |

Your account has been successfully created. Now you can log in.

5 |
6 | {% endblock %} -------------------------------------------------------------------------------- /templates/registration/logout.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% block title %}Logged out{% endblock %} {% block content %} 2 |
3 |

Logged out

4 |

5 | You have been successfully logged out. You can

6 | log-in again 7 |

8 |
9 | {% endblock %} -------------------------------------------------------------------------------- /templates/registration/password_reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% block title %}Reset your password{% endblock %} {% block content %} 2 |
3 |

Reset your password

4 |

We've emailed you instructions for setting your password.

5 |

If you don't receive an email, please make sure you've entered the address you registered with.

6 |
7 | Home 8 |
9 | {% endblock %} -------------------------------------------------------------------------------- /bookmarks/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for bookmarks project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookmarks.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /bookmarks/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for bookmarks project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookmarks.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% block title %}Password changed{% endblock %} {% block content %} 2 |
3 |
4 |

Password changed

5 |

Your password has been successfully changed.

6 |
7 | Back to home 8 |
9 |
10 | {% endblock %} -------------------------------------------------------------------------------- /templates/account/register.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% load crispy_forms_tags %} {% block title %}Create an account{% endblock %} {% block content %} 2 |
3 |

Create an account

4 |

Please, sign up using the following form:

5 |
6 | {{ user_form|crispy}} {% csrf_token %} 7 |
8 |

9 |
10 |
11 | {% endblock %} -------------------------------------------------------------------------------- /templates/registration/password_reset_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %}{% load crispy_forms_tags %} {% block title %}Reset your password{% endblock %} {% block content %} 2 |
3 |

Forgotten your password?

4 |

Enter your e-mail address to obtain a new password.

5 |
6 | {{ form|crispy }} 7 |

8 | {% csrf_token %} 9 |
10 |
11 | {% endblock %} -------------------------------------------------------------------------------- /templates/registration/password_change_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %}{% load crispy_forms_tags %} {% block title %}Change your password{% endblock %} {% block content %} 2 |
3 |

Change your password from user : {{user.username}}

4 |

Use the form below to change your password.

5 |
6 | {{ form|crispy }} 7 |
8 |

9 | {% csrf_token %} 10 |
11 |
12 | {% endblock %} -------------------------------------------------------------------------------- /templates/account/edit.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %}{% load crispy_forms_tags %} {% block title %}Edit your account{% endblock %} {% block content %} 2 |
3 |

Edit your account

4 |

You can edit your account using the following form:

5 |
6 | {{ user_form|crispy }} {{ profile_form|crispy }} {% csrf_token %} 7 |
8 |

9 |
10 |
11 | {% endblock %} -------------------------------------------------------------------------------- /images/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from .models import Image 3 | 4 | 5 | class ImageCreateForm(forms.ModelForm): 6 | 7 | class Meta: 8 | model = Image 9 | fields = ('title', 'url', 'description') 10 | widgets = { 11 | 'url': forms.HiddenInput, 12 | } 13 | 14 | def clean_url(self): 15 | url = self.cleaned_data['url'] 16 | valid_extensions = ['jpg', 'jpeg'] 17 | extension = url.rsplit('.', 1)[1].lower() 18 | if extension not in valid_extensions: 19 | raise forms.ValidationError( 20 | 'The given URL does not match valid image extensions.') 21 | return url 22 | -------------------------------------------------------------------------------- /account/authentication.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import User 2 | 3 | 4 | class EmailAuthBackend(object): 5 | """ 6 | Authenticate using an e-mail address. 7 | """ 8 | 9 | def authenticate(self, request, username=None, password=None): 10 | try: 11 | user = User.objects.get(email=username) 12 | if user.check_password(password): 13 | return user 14 | return None 15 | except User.DoesNotExist: 16 | return None 17 | 18 | def get_user(self, user_id): 19 | try: 20 | return User.objects.get(pk=user_id) 21 | except User.DoesNotExist: 22 | return None 23 | -------------------------------------------------------------------------------- /staticfiles/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | font-family: "Poppins", sans-serif; 5 | list-style: none; 6 | text-decoration: none; 7 | box-sizing: border-box; 8 | } 9 | 10 | a { 11 | text-decoration: none !important; 12 | } 13 | 14 | html, 15 | body { 16 | height: 100%; 17 | margin: 0; 18 | } 19 | 20 | section { 21 | margin: 20px 0px 30px 0px; 22 | } 23 | 24 | #content { 25 | min-height: 100%; 26 | } 27 | 28 | 29 | /* #header { 30 | width: 100%; 31 | height: 80px; 32 | background-color: cadetblue; 33 | color: white; 34 | display: flex; 35 | justify-content: space-around; 36 | align-items: center; 37 | } */ 38 | 39 | .logo { 40 | font-size: 1.5em; 41 | } -------------------------------------------------------------------------------- /templates/registration/password_reset_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %}{% load crispy_forms_tags %} {% block title %}Reset your password{% endblock %} {% block content %} 2 |
3 |

Reset your password

4 | {% if validlink %} 5 |

Please enter your new password twice:

6 |
7 | {{ form|crispy }} {% csrf_token %} 8 |

9 |
10 | {% else %} 11 |

The password reset link was invalid, possibly because it has already been used. Please request a new password reset.

12 | {% endif %} 13 |
{% endblock %} -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookmarks.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /images/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | from django.db import models 3 | from django.conf import settings 4 | 5 | 6 | class Image(models.Model): 7 | user = models.ForeignKey(settings.AUTH_USER_MODEL, 8 | related_name='images_created', 9 | on_delete=models.CASCADE) 10 | title = models.CharField(max_length=200) 11 | slug = models.SlugField(max_length=200, blank=True) 12 | users_like = models.ManyToManyField( 13 | settings.AUTH_USER_MODEL, related_name='images_liked', blank=True) 14 | url = models.URLField() 15 | image = models.ImageField(upload_to='images/%Y/%m/%d/') 16 | description = models.TextField(blank=True) 17 | created = models.DateField(auto_now_add=True, 18 | db_index=True) 19 | 20 | def __str__(self): 21 | return self.title 22 | -------------------------------------------------------------------------------- /templates/account/dashboard.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% block title %}Dashboard{% endblock %} {% block content %} 2 |
3 |

Dashboard

4 |

Welcome to your dashboard.

5 |

Welcome to your dashboard. You can edit 6 | your profile or change your 7 | password.

8 |
9 | 16 |
17 | 18 | Your profile 19 | 20 |
21 | {% endblock %} -------------------------------------------------------------------------------- /account/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.6 on 2022-06-09 05:53 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Profile', 19 | fields=[ 20 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('date_of_birth', models.DateField(blank=True, null=True)), 22 | ('photo', models.ImageField(blank=True, upload_to='users/%Y/%m/%d/')), 23 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 24 | ], 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /account/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | from django.conf import settings 4 | # Create your models here. 5 | 6 | 7 | class Profile(models.Model): 8 | user = models.OneToOneField(User, 9 | on_delete=models.CASCADE) 10 | followers = models.PositiveIntegerField(default=0) 11 | follows = models.PositiveIntegerField(default=0) 12 | date_of_birth = models.DateField(blank=True, null=True) 13 | photo = models.ImageField(default='media/cool.png', upload_to='users/%Y/%m/%d/', 14 | blank=True) 15 | 16 | def __str__(self): 17 | return f'Profile for user {self.user.username}' 18 | 19 | 20 | class Followers(models.Model): 21 | user = models.OneToOneField( 22 | User, on_delete=models.CASCADE) 23 | another_user = models.ManyToManyField( 24 | User, related_name='another_user') 25 | 26 | def __str__(self): 27 | return self.user.username 28 | -------------------------------------------------------------------------------- /templates/registration/login.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% load crispy_forms_tags %} {% block title %}Log-in{% endblock %} {% block content %} 2 |
3 |

Log-in

4 | {% if form.errors %} 5 |

6 | Your username and password didn't match. Please try again. 7 |

8 | {% else %} 9 |

Please, use the following form to log-in:

10 | {% endif %} 11 |
12 |
13 | {{ form|crispy }} {% csrf_token %} 14 | 15 |
16 |

17 |
18 | 19 |

You have not an account ? 20 | Register now. 21 |

22 |

23 | Forgotten your password ?Reset password 24 |

25 |
26 | 27 |
28 | {% endblock %} -------------------------------------------------------------------------------- /account/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.contrib.auth.models import User 3 | 4 | from .models import Profile 5 | 6 | 7 | class LoginForm(forms.Form): 8 | username = forms.CharField() 9 | password = forms.CharField(widget=forms.PasswordInput) 10 | 11 | 12 | class UserRegistrationForm(forms.ModelForm): 13 | password = forms.CharField(label='Password', 14 | widget=forms.PasswordInput) 15 | password2 = forms.CharField(label='Repeat password', 16 | widget=forms.PasswordInput) 17 | 18 | class Meta: 19 | model = User 20 | fields = ('username', 'first_name', 'last_name', 'email') 21 | 22 | def clean_password2(self): 23 | cd = self.cleaned_data 24 | if cd['password'] != cd['password2']: 25 | raise forms.ValidationError('Passwords don\'t match.') 26 | return cd['password2'] 27 | 28 | 29 | class UserEditForm(forms.ModelForm): 30 | class Meta: 31 | model = User 32 | fields = ('first_name', 'last_name', 'email') 33 | 34 | 35 | class ProfileEditForm(forms.ModelForm): 36 | class Meta: 37 | model = Profile 38 | fields = ('date_of_birth', 'photo') 39 | -------------------------------------------------------------------------------- /bookmarks/urls.py: -------------------------------------------------------------------------------- 1 | """bookmarks URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | from django.conf import settings 19 | from django.conf.urls.static import static 20 | 21 | urlpatterns = [ 22 | path('admin/', admin.site.urls), 23 | path('accounts/', include('account.urls')), 24 | path('', include('django.contrib.auth.urls')), 25 | path('social-auth/', include('social_django.urls', namespace='social')), 26 | ] 27 | if settings.DEBUG: 28 | urlpatterns += static(settings.MEDIA_URL, 29 | document_root=settings.MEDIA_ROOT) 30 | -------------------------------------------------------------------------------- /account/migrations/0002_auto_20220610_0854.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.6 on 2022-06-10 03:54 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 12 | ('account', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name='profile', 18 | name='followers', 19 | field=models.PositiveIntegerField(default=0), 20 | ), 21 | migrations.AddField( 22 | model_name='profile', 23 | name='follows', 24 | field=models.PositiveIntegerField(default=0), 25 | ), 26 | migrations.CreateModel( 27 | name='Followers', 28 | fields=[ 29 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 30 | ('another_user', models.ManyToManyField(related_name='another_user', to=settings.AUTH_USER_MODEL)), 31 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 32 | ], 33 | ), 34 | ] 35 | -------------------------------------------------------------------------------- /images/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.6 on 2022-06-09 09:51 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Image', 19 | fields=[ 20 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('title', models.CharField(max_length=200)), 22 | ('slug', models.SlugField(blank=True, max_length=200)), 23 | ('url', models.URLField()), 24 | ('image', models.ImageField(upload_to='images/%Y/%m/%d/')), 25 | ('description', models.TextField(blank=True)), 26 | ('created', models.DateField(auto_now_add=True, db_index=True)), 27 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images_created', to=settings.AUTH_USER_MODEL)), 28 | ('users_like', models.ManyToManyField(blank=True, related_name='images_liked', to=settings.AUTH_USER_MODEL)), 29 | ], 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /account/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from django.contrib.auth import views as auth_views 3 | from . import views 4 | 5 | app_name = 'account' 6 | 7 | urlpatterns = [ 8 | # post views 9 | # path('login/', views.user_login, name='login'), 10 | path('', views.dashboard, name='dashboard'), 11 | # register 12 | path('register/', views.register, name='register'), 13 | path('profile/', views.profile, name='profile'), 14 | path('follow/', views.follow_user, name='follow'), 15 | #login and logout 16 | path('login/', auth_views.LoginView.as_view(), name='login'), 17 | path('logout/', auth_views.LogoutView.as_view(template_name='registration/logout.html'), name='logout'), 18 | path('edit/', views.edit, name='edit'), 19 | # change password urls 20 | path('password_change/', 21 | auth_views.PasswordChangeView.as_view(), 22 | name='password_change'), 23 | path('password_change/done/', 24 | auth_views.PasswordChangeDoneView.as_view(), 25 | name='password_change_done'), 26 | # reset password urls 27 | path('password_reset/', 28 | auth_views.PasswordResetView.as_view(), 29 | name='password_reset'), 30 | path('password_reset/done/', 31 | auth_views.PasswordResetDoneView.as_view(), 32 | name='password_reset_done'), 33 | path('reset///', 34 | auth_views.PasswordResetConfirmView.as_view(), 35 | name='password_reset_confirm'), 36 | path('reset/done/', 37 | auth_views.PasswordResetCompleteView.as_view(), 38 | name='password_reset_complete'), 39 | ] 40 | -------------------------------------------------------------------------------- /templates/account/profile.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} {% load crispy_forms_tags %} {% block title %}Profile{% endblock %} {% block content %} 2 |
3 |

Profile

4 |
5 |
6 | 7 |
8 |
9 |
10 |

11 | Usrname : {{ user.username }} 12 |

13 |

Name :{{ user.first_name }}

14 |

Email :{{ user.email }}

15 |

Date of Birthday :{{ user.profile.date_of_birth }}

16 |
17 |
18 | Followers: {{user.profile.followers }} 19 | Following: {{user.profile.follows }} 20 | 21 | 22 |
23 | Unfollow 24 | 25 | Follow 27 | 28 |
29 |
30 |
    31 |

    Following users

    32 | {% for follower in user.followers.another_user.all %} 33 |
  • 34 | {{follower.username}} 35 |
  • 36 | {% endfor %} 37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | {% endblock %} -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | {% load crispy_forms_tags %} 3 | 4 | 5 | 6 | 7 | {% block title %}{% endblock %} 8 | 9 | 12 | 13 | 17 | 22 | 23 | 24 | 62 |
63 | {% if messages %} 64 |
    65 | {% for message in messages %} 66 | {{ message }} 67 | {% endfor %} 68 |
69 | {% endif %} 70 | {% block content %}{% endblock %} 71 |
72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /bookmarks/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for bookmarks project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.2.6. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.2/ref/settings/ 11 | """ 12 | 13 | import os 14 | from pathlib import Path 15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 17 | BASE_DIR = Path(__file__).resolve().parent.parent 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'django-insecure-g8*vm(!$x4943&r5zxg2qgg14(=u%ckp2&f9%r8fxx+_+rm7f2' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = ['mysite.com', 'localhost', '127.0.0.1'] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 'account', 42 | 'crispy_forms', 43 | 'social_django', 44 | 'images' 45 | 46 | ] 47 | CRISPY_TEMPLATE_PACK = "bootstrap4" 48 | MIDDLEWARE = [ 49 | 'django.middleware.security.SecurityMiddleware', 50 | 'django.contrib.sessions.middleware.SessionMiddleware', 51 | 'django.middleware.common.CommonMiddleware', 52 | 'django.middleware.csrf.CsrfViewMiddleware', 53 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 54 | 'django.contrib.messages.middleware.MessageMiddleware', 55 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 56 | ] 57 | 58 | ROOT_URLCONF = 'bookmarks.urls' 59 | 60 | TEMPLATES = [ 61 | { 62 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 63 | 'DIRS': [BASE_DIR / 'templates'], 64 | 'APP_DIRS': True, 65 | 'OPTIONS': { 66 | 'context_processors': [ 67 | 'django.template.context_processors.debug', 68 | 'django.template.context_processors.request', 69 | 'django.contrib.auth.context_processors.auth', 70 | 'django.contrib.messages.context_processors.messages', 71 | ], 72 | }, 73 | }, 74 | ] 75 | 76 | WSGI_APPLICATION = 'bookmarks.wsgi.application' 77 | 78 | 79 | # Database 80 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases 81 | 82 | DATABASES = { 83 | 'default': { 84 | 'ENGINE': 'django.db.backends.sqlite3', 85 | 'NAME': BASE_DIR / 'db.sqlite3', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | AUTHENTICATION_BACKENDS = [ 109 | 'django.contrib.auth.backends.ModelBackend', 110 | 'account.authentication.EmailAuthBackend', 111 | ] 112 | 113 | AUTH_USER_MODEL = "auth.User" 114 | 115 | LOGIN_REDIRECT_URL = '/accounts/' 116 | LOGIN_URL = '/accounts/login' 117 | LOGOUT_URL = '/accounts/logout' 118 | 119 | EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' 120 | # Internationalization 121 | # https://docs.djangoproject.com/en/3.2/topics/i18n/ 122 | 123 | LANGUAGE_CODE = 'ru' 124 | 125 | TIME_ZONE = 'Asia/Tashkent' 126 | 127 | USE_I18N = True 128 | 129 | USE_L10N = True 130 | 131 | USE_TZ = True 132 | 133 | # Static files (CSS, JavaScript, Images) 134 | # https://docs.djangoproject.com/en/3.2/howto/static-files/ 135 | 136 | STATIC_URL = '/static/' 137 | STATIC_ROOT = os.path.join(BASE_DIR, 'static') 138 | MEDIA_URL = '/media/' 139 | MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 140 | 141 | STATICFILES_DIRS = ( 142 | os.path.join(BASE_DIR, 'staticfiles')), 143 | 144 | # Default primary key field type 145 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field 146 | 147 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 148 | # name = "John" 149 | # surname = "Doe" 150 | # print(name + surname) # John Doe 151 | -------------------------------------------------------------------------------- /account/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse, HttpResponseRedirect 2 | from django.urls import reverse 3 | from django.shortcuts import render, redirect 4 | from django.contrib import messages 5 | from django.contrib.auth.models import User 6 | from django.contrib.auth import authenticate, login 7 | from django.contrib.auth.decorators import login_required 8 | from .forms import LoginForm, UserRegistrationForm, UserEditForm, ProfileEditForm 9 | from .models import Profile, Followers 10 | # Create your views here. 11 | 12 | 13 | @login_required 14 | def dashboard(request): 15 | users = User.objects.filter(is_active=True) 16 | return render(request, 17 | 'account/dashboard.html', 18 | {'section': 'dashboard', "users": users}) 19 | 20 | 21 | def follow_user(request, user_name): 22 | # following user 23 | user = User.objects.get(username=request.user.username) 24 | # print(user) 25 | # will be followed user 26 | f_user = User.objects.get(username=user_name) 27 | # print(f_user) 28 | # following user followers 29 | user_follower = Followers.objects.get(user=user) 30 | 31 | # check followers 32 | if f_user not in user_follower.another_user.all(): 33 | user_follower.another_user.add(f_user) 34 | user_follower.save() 35 | 36 | print(user_follower.another_user) 37 | 38 | f_user.profile.followers += 1 39 | user.profile.follows += 1 40 | user.profile.save() 41 | f_user.profile.save() 42 | messages.add_message(request, messages.SUCCESS, 43 | "You successfuly following this user!") 44 | return redirect("account:profile", user_name=user_name) 45 | else: 46 | messages.add_message(request, messages.WARNING, 47 | "You followed this user!") 48 | return redirect("account:profile", user_name=user_name) 49 | 50 | 51 | def register(request): 52 | if request.method == 'POST': 53 | user_form = UserRegistrationForm(request.POST) 54 | if user_form.is_valid(): 55 | # Create a new user object but avoid saving it yet 56 | new_user = user_form.save(commit=False) 57 | # Set the chosen password 58 | new_user.set_password( 59 | user_form.cleaned_data['password']) 60 | # Save the User object 61 | new_user.save() 62 | Profile.objects.create(user=new_user) 63 | Followers.objects.create(user=new_user) 64 | return render(request, 65 | 'account/register_done.html', 66 | {'new_user': new_user}) 67 | else: 68 | user_form = UserRegistrationForm() 69 | return render(request, 70 | 'account/register.html', 71 | {'user_form': user_form}) 72 | 73 | 74 | def user_login(request): 75 | if request.method == 'POST': 76 | form = LoginForm(request.POST) 77 | if form.is_valid(): 78 | cd = form.cleaned_data 79 | user = authenticate( 80 | request, username=cd['username'], password=cd['password']) 81 | if user is not None: 82 | if user.is_active: 83 | login(request, user) 84 | return HttpResponse('Authenticated successfully') 85 | else: 86 | return HttpResponse('Disabled account') 87 | else: 88 | return HttpResponse('Invalid login') 89 | else: 90 | form = LoginForm() 91 | return render(request, 'account/login.html', {'form': form}) 92 | 93 | 94 | @ login_required 95 | def edit(request): 96 | if request.method == 'POST': 97 | user_form = UserEditForm(instance=request.user, data=request.POST) 98 | profile_form = ProfileEditForm( 99 | instance=request.user.profile, 100 | data=request.POST, 101 | files=request.FILES) 102 | if user_form.is_valid() and profile_form.is_valid(): 103 | user_form.save() 104 | profile_form.save() 105 | return HttpResponseRedirect("/account/profile/") 106 | else: 107 | user_form = UserEditForm(instance=request.user) 108 | profile_form = ProfileEditForm( 109 | instance=request.user.profile) 110 | return render(request, 111 | 'account/edit.html', 112 | {'user_form': user_form, 113 | 'profile_form': profile_form}) 114 | else: 115 | user_form = UserEditForm(instance=request.user) 116 | profile_form = ProfileEditForm( 117 | instance=request.user.profile) 118 | return render(request, 'account/edit.html', {'user_form': user_form, 119 | 'profile_form': profile_form}) 120 | 121 | 122 | @ login_required 123 | def profile(request, user_name): 124 | user = User.objects.get(username=user_name) 125 | 126 | is_followed = False 127 | # if user.followers.another_user 128 | 129 | return render(request, "account/profile.html", {"user": user}) 130 | -------------------------------------------------------------------------------- /account/posts: -------------------------------------------------------------------------------- 1 | Dunyodagi eng yaxshi xakerlar: TOP 5 ta barcha zamon ustalari 2 | 3 | 90-yillarning o'rtalariga qadar xakerlarning mavjudligi haqida kam odam bilar edi. Odamlarning kichik bir qismi kompyuterlarga ega edi va hukumat tizimlariga buzib kirish haqidagi gaplar ilmiy fantastika kabi qabul qilinar edi. 4 | 5 | Garchi ularning tarixi 70-yillarda birinchi shaxsiy kompyuterlar ommaga chiqarilgandan so'ng boshlangan bo'lsada, bosh qahramon Anjelina Joli bo'lgan "Hackerlar" filmining chiqishi bilan dunyo nihoyat "qattiqqo'l" yigitlar borligi haqida bilib oldi. 6 | 7 | Hikoya dastlab qayg'uli yakun bilan tugaydi deb hech kim o'ylamagan. Dastlab Tiger team jamoasi AQSh hukumati dasturiy ta'minoti xavfsizligini baholashi kerak bo'lgan bir nechta dasturchilar to'pladi. Bugungi kunda bunday xakerlar "white hat" deb ataladi. Ularning maqsadi xavfsizlik darajasini baholash uchun tizimga hujum qilishdir. 8 | 9 | Vaqt o'tishi bilan yomon xakerlar paydo bo'ldi - kulrang va qora xakerlar. Birinchisi o'yin-kulgi uchun, ikkinchisi esa foyda olish yoki tizimni yo'q qilish maqsadida xakerlik qiladi. 10 | 11 | 12 | 13 | Bugun biz xakerlik hujumlari orqali o'z nomini qozongan va butun dunyoga tanilgan 5 xakerlik guru'lari haqida gaplashamiz. 14 | 15 | № 1. Aaron Shvarts 16 | Aaron Shvarts axborot erkinligi uchun kurashgan dasturchi va ijtimoiy faol inson. Dasturlash olamining yosh dahosi Reddit ijtimoiy tarmog‘ining rivojlanishida ham ishtirok etgan. U bir necha yillardan beri barcha turdagi o'quv va axborot materiallaridan ochiq foydalanishni ta'minlash uchun kurashib kelmoqda. 17 | 18 | 19 | 20 | 2008 yilda u AQSh federal sudining ommaviy foydalanish xizmatidan juda ko'p hujjatlarni, 2010 yilda esa Massachusetsdagi eng yirik universitet kutubxonasidan 5 millionga yaqin ilmiy maqolani yuklab oladi. 21 | 22 | Uning barcha harakatlari jinoyat deb hisoblangan va 2011 yilda Aaron hibsga olingan. Unga jiddiy ayblovlar qo'yilgan, jumladan 50 yillik qamoq va bir million dollar jarima. 23 | 24 | 25 | 26 | 2013 yilda dasturchi o'z joniga qasd qildi. U o'limidan so'ng 2015 yilda shaxsiy daxlsizlikka qarshi pozitsiyasi uchun Internet shon-shuhrat zaliga kiritildi. 27 | 28 | № 2. Jinson Jeyms Ancheta 29 | Jinson Jeyms Ancheta - butun dunyo bo'ylab oddiy odamlar va yirik kompaniyalarning 400 000 dan ortiq kompyuterlarini qo'lga oladi va nazorat qiladi. Jinson bu ishlarini barchasini unga yaxshi pul keltiradigan reklama dasturlarini o'rnatish uchun va u keyingi hujumlar uchun boshqa xakerlarga "zombi kompyuterlarni" sotish uchun qilgan. 30 | 31 | 32 | 33 | Oddiy foydalanuvchilarning kompyuterlariga kirish uchun yosh xaker dasturiy ta'minotni o'rnatuvchi sifatida ishga joylashgan. 34 | 35 | 36 | 37 | O'zining xakerlik faoliyatida Ancheta odatiy "botnet" tarmoqlaridan foydalangan, shuning uchun u ulardan foydalanganligi uchun qamoqqa olingan dunyodagi birinchi odam bo'ldi. Qamoq muddati 5 yil edi. Yana Ancheta 75 ming dollar to‘lashi zarur bo'lgan. 38 | 39 | 3 raqami. Kevin Poulsen 40 | Kevin Poulsen yoki Dark Dante 17 yoshida UCLA tarmog'ini buzib kirgan. Ammo xavfsizlik xizmati yosh xakerni qamoqqa jo'nata olmadi, sababi u voyaga yetmagani bo'lgan. Ogohlantirishni olgach, Kevin ozodlikda edi. Hodisadan oldin ham, keyin ham u xakerlik bilan faol shug‘ullangan. 41 | 42 | Kevinning asosiy sevimli mashg'uloti telefon tarmoqlarini buzish bo'lgan. Bu ishlariga qo'shimcha: hukumat resurslariga kiberhujumlar (masalan, Pentagon tizimlari - APRANet), telekonferentsiyaga kirish, telefonlarni tinglash va boshqalar kiradi. Qayerda maxfiy ma'lumotlar va qiziqarli "nishon" bo'lsa, o'sha yerda tushunib bo'lmaydigan Dark Dante bor edi. Eng mashhur jinoyatlardan biri Los-Anjelesdagi KIIS-FM radiostansiyasining buzib kirishi bo‘lib, buning natijasida xaker avtomobil va ko‘plab qimmatbaho sovrinlarni qo‘lga kiritadi. 43 | 44 | 45 | № 4. Maykl Kals 46 | Maykl Kals bugungi kunda yaxshi fuqaro va xavfsizlik bo'yicha mutaxassis, o'tmishda esa kiberjinoyatchi. 2000-yil fevral oyida u dunyoning eng yirik kompaniyalari: Ebay, Amazon, Yahoo, CNN va Dellga qarshi bir qator DDoS hujumlarini (Denial of service - xizmat ko'rsatishni rad etish) uyushtirgan. U bu hujumni Revolta deb atadi, Revolta so'zi isyonni anglatadi. Xaker Yahoo-ni bir soat davomida to'liq o'chirib qo'yishga muvaffaq bo'ladi va uning uchun juda qiyin bo'lib chiqqan Dell'dan tashqari hamma tizimlar uzoqroq muddatga to'xtatildi. 47 | 48 | Mayklning xatti-harakatlari jamoatchilikning noroziligiga sabab bo'ladi va bu ishlar kiberxavfsizlik dunyosida jiddiyroq qonunlarning o'rnatilishiga olib keldi. 49 | 50 | 51 | 52 | Revolta hujumlari paytida Maykl 18 yoshda ham emas edi, shuning uchun unga atigi 8 oy qamoq jazosi berildi. 53 | 54 | № 5. Metyu Bevan va Richard Prays 55 | Metyu Bivan va Richard Prays o'tgan asr oxirida bir nechta harbiy tarmoqlarga buzib kirgan va bir necha yil avval Pentagon tarmog'iga kirib borgan va Koreyadan yadroviy qurolga kirishni istagan 2 nafar britaniyalik o'smirlar edi. O'smirlarning "pranklari" tufayli xalqaro mojaro (urush xavfi) avj oldi. Ammo keyin negadir ulardan barcha ayblovlar olib tashlandi. O'smirlar kiberjinoyatlari maxfiy tizimlar xavfsizligini yaxshilash uchun turtki bo'ldi. 56 | 57 | 58 | ####################################### 59 | Tez yozishni qanday o'rganish kerak? 60 | Kim klaviaturaga qaramasdan yozishni o'rganishni xohlamaydi?! Yuqori tezlikda yozish yozuvchilar, jurnalistlar, IT mutaxassislari va ofis xodimlari uchun muhim mahorat hisoblanadi. 61 | 62 | 63 | 64 | Teoriya 65 | 66 | Qoidaga ko'ra, har bir barmoq o'z tugmalari guruhi uchun javobgardir. Shunday qilib, ko'rsatkich barmoqlari klaviaturaning markaziy zonasini bosishi kerak, kattalar bo'sh joy uchun javobgardir va kichik barmoqlar ko'proq tugmalarni oladi, ammo ularning barchasi kundalik hayotda kamdan-kam qo'llaniladi. Qolgan barmoqlar nima uchun javobgar ekanligini rasmda ko'rish mumkin. 67 | 68 | 69 | Ushbu qoida 100 yil oldin stenograf Frenk MakGurrin tomonidan ixtiro qilingan "ko'rmay yozish" deb ataladi. Bu amaliyot vaqt o'tishi bilan yo'qolmaydigan mushaklar xotirasini rivojlantiradi, ya'ni bu mahorat siz bilan abadiy qoladi, hatto kamdan-kam hollarda ishlatsangiz ham. Odam anatomiyasidan bilamiz agar mushaklar xotirasiga biror bir ma'lumot yozilsa mushaklar uni abadiy eslab qoladi.Masalan mashina haydash vaqtida chap oyog'ingiz ma'lum bir vaqtda o'z-o'zidan uzatgish pedaliga ketadi. Bu mushaklar xotirasiga mashqlar orqali yozilgan ma'lumot tufayli shunday bo'ladi. 70 | 71 | Amaliyot 72 | 73 | Amaliyotdan yaxshiroq narsa yo'q, ayniqsa "ko'rmay yozish"ni o'zlashtirganingizda. O'rtacha, to'liq mashg'ulot 4 hafta davom etadi. Har kuni 20 daqiqadan ko'proq mashq qilsangiz, bu vaqtni qisqartirish mumkin. Asosiysi, mashg'ulotni yarmida to'xtatmaslik. 74 | 75 | O'rganish uchun TOP 3 ta onlayn xizmatlar 76 | 77 | Typerun.top - "ko'rmay yozish"ni o'rgatish uchun klassik onlayn xizmat. Unda ko'p funktsional imkoniyatlar yo'q, hamma narsa sodda va intuitiv. Turli xil murakkablikdagi va turli tillarda treninglar mavjud. Bundan tashqari, ingliz, nemis va boshqa tillarni, jumladan, dasturlash tillarini o‘rganish uchun lug‘atlar mavjud. 78 | 79 | 80 | 81 | Typingstudy - bu 15 ta darsdan iborat bo'lgan 100 dan ortiq tillardagi to'liq ta'lim tizimi. Xizmatda yozish tezligini tekshirish, natijalar statistikasi va shaxsiy yutuqlar mavjud. Ro'yxatdan o'tmasdan mashq qilsa bo'ladi, ammo cheklangan funksionallik bilan. Jarayonni yengillashtirish uchun 4 ta o'yin mavjud bo'lib, unda siz o'z mahoratingizni mashq qilishingiz va ongingizni rivojlantirishingiz mumkin. 82 | 83 | 84 | 85 | RapidTyping - "ko'rmay yozish"ni o'rgatish uchun mo'ljallangan. Mavjud funktsiyalar - guruh mashg'ulotlari, rivojlanish va natijalar statistikasi. Bu yerda siz yozish tezligini sinab ko'rishingiz va o'z mahoratingizga ko'ra qiyinchilik darajasini tanlashingiz mumkin. 86 | ##################################### 87 | Rebyata, blogimiz boshlanishida Python tilini bilish deyarli har bir inson uchun nima uchun muhimligini muhokama qilgan edik. Lekin bunga qanday erishiladi? Bunga ushbu tilning aniq afzalliklari tufayli erishiladi va ularning ro'yxati: 88 | 89 | 1. Krossplatformalilik. Python da yozgan dasturingiz Windows, Linux va Mac OS da ham ishlaydi. 90 | 91 | 2. Mutlaqo universal: amaliy dasturlar, veb-dasturlash, jarayonlarni avtomatlashtirish uchun barcha turdagi skriptlar, mikrokontroller dasturlash, mashina tilini o'rganish, katta ma'lumotlarni tahlil qilish, o'yinlar. Bundan tashqari boshqa sohalarda ham Pytonda dastur tuzish mumkin. 92 | 93 | 3. Boshqa dasturlash tillari Java va C++ dan farqli ravishda dasturlarni yozishning yuqori tezligi. 94 | 95 | 4. Ko'p sonli tayyor bepul kutubxonalar (modullar). Tasvirga ishlov berish kerakmi? YouTube’ga yuklangan video haqidagi barcha ma’lumotlarni (like/dislike lar, ko‘rishlar soni, teglar, sarlavha, yuklangan sana va hokazo) olish kerakmi?Biz uchinchi tomon kutubxonasini birinchi qatorda ko'rsatamiz va shunchaki tayyor funktsiyalardan foydalanamiz. Biz kutubxonani ulaymiz, funktsiyani chaqiramiz va hamma narsa tayyor. 96 | 97 | 5. Turli dasturlarda ba'zi vazifalarni avtomatlashtirish uchun o'z plaginlarini, modullarini yozish uchun foydalaniladi, jumladan: Blender, GIMP, Unreal Engine 4 va boshqa ko'plab. 98 | 99 | 6. Hamma joyda, jumladan, yirik kompaniyalarda qo'llaniladi: Google, Yandex, Facebook, Mail.ru, NASA, IBM, Instagram va boshqalar. Natijada, bu til katta kelajakka ega va hozirda Python dasturchilariga talab yuqori. 100 | 101 | 7. Veb da yaxshi ishlaydi. Ha, u C++ dan past, lekin PHP dan yuqori, bu oxir-oqibat uni Internet loyihalarini yaratishda ancha mashhur qildi (masalan, Wargaming xizmatlari Pythonda yozilgan). 102 | 103 | 8. Birinchi til uchun ajoyib variant.Bu bejiz emas, barchamizga ma'lum, bolalarning hozirgi avlodiga endi Turbo Paskal (bizning avlodni dasturlash tili bo'lgani kabi) yoki Basic emas, balki Python tili o'rgatilmoqda. Bu til bola dasturlashga kirib kelishi uchun past kirish plankasini beradi.Minimal bilimlar orqali dastur tuzish uchun xizmat qiladi. 104 | 105 | Bu juda ajoyib til, shuning uchun Python haqiqatan ham hech bo'lmaganda kompyuterlar bilan shug'ullanadigan har bir kishiga ma'lum bo'lishi kerak. 106 | 107 | Bugunga xozircha shu! 108 | 109 | 110 | Hamkorlikda ishlash uchun 10 ta insturment 111 | Masofadan turib ishlash uchun va jamoaviy ish uchun kerak bo'ladigan 10 ta muhim vositalarni siz uchun to'pladik. 112 | 113 | 🎨 Veb-dizayner uchun 100 ta eng yaxshi vositalar 114 | 1. Invision - bu dizayn guruhlari uchun oddiy prototip yaratish va hamkorlik qilish vositasi. 115 | 116 | 2. GoVisually - loyihalaringiz bo'yicha mijozlarning fikr-mulohazalarini yig'ishning eng yaxshi usullaridan biri. 117 | 118 | 3. Red Pen - eng tezkor qayta aloqa vositasidir. 119 | 120 | 4. Mural - dizaynerlar va ishlab chiquvchilar uchun hamkorlik vositasi. 121 | 122 | 5. Asana - jamoangiz bilan loyihalarni baham ko'ring, ko'ring va muhokama qiling 123 | 124 | 6. Design Drop - tasvirlarni belgilang va ularni hamkasblar bilan baham ko'ring. 125 | 126 | 7. Cage - bu jamoalar va mijozlar bilan hamkorlik qilish uchun asboblar paneli. 127 | 128 | 8. Bounce – har qanday veb-saytda fikr almashishning qiziqarli va oson usuli. 129 | 130 | 9. Proofhub - loyihalaringizni samarali boshqaring. 131 | 132 | 10. Lingo - Vizual aktivlar kutubxonalarini yarating va ularni jamoangiz bilan baham ko'ring. Faqat MacOS uchun lekin 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | --------------------------------------------------------------------------------