📜 ⬆️ ⬇️

News of our online courses: updated course "Web-technologies" and added "Statement of tasks for software development"

image


The updated Web-technology course on the Stepik platform now supports the latest version of Django and the ability to develop in both Python 2 and Python 3. The course instructors are Dmitry Smal and Dinar Sabitov, web programmers from the Mail.Ru Group game direction. On March 2, we restart the " Task for Software Development " without deadlines so that you can complete the courses at a convenient time and get certificates. The course instructor is Dmitry Bezugly, the general director of System Approach, a business analyst and system analyst.


Stepik is an online course platform. Most of them are open only in the allotted time - this encourages indecisive participants to sign up. The course is divided into modules that need to pass on time. Deadlines increase student motivation. Not all are doing well - on average, 9% of students receive certificates. The first course from Mail.Ru Group opened on September 1, 2015. From this point on, 67,600 people signed up for us, to whom we issued 5,300 certificates. The most popular course of all time is “ Web-technologies ”. 12,400 people registered for it, which is twice the average. Therefore, we are trying to improve the course and make it even more convenient.


About the course "Web-technology"


We created “ Web-technologies ” to introduce new programmers to the world of web and backend development in Python. In the course we talk about the schemes of servers. We place particular emphasis on backend development using the Django framework. We also provide the basics of front-end development: HTML, CSS, JS, and in additional chapters we discuss Ajax technology and the delivery of real-time messages.


Course assignments are different: in one place you choose the correct answer, in the other you enter it in a special field, in the third place you write a program. Tasks for programming are interrelated. Throughout the course, we step by step complement the question and answer service - a simplified stack overflow. First, we configure nginx and gunicorn, then deploy the Django application, which we are gradually refining.


About update details


In the "Web-technologies" there are tasks that must be performed on a virtual machine. Results are controlled by automated tests. Often, tests make HTTP requests to the user's application that is loaded on the virtual machine. We analyze the answers and understand whether the task is solved correctly.


But in many tasks this is not enough. For example, we test application models and check that it has all the necessary fields and managers defined. In this case, we upload our script to the virtual machine, next to the code that needs to be tested.


Until recently, Django 1.6 was installed on a virtual machine, and we ran all the tests with Python 2.7. We have received many complaints that Django is too old and that people want to use Python 3. Therefore, we rewrote our scripts so that they work correctly with Django versions 1.6—1.10. And for the tests themselves, two interpreters are now available. First, tests are run with Python 2, and in case of errors, with Python 3.


What you need to know when upgrading from Django 1.6 to 1.10


In order to facilitate the transition to a newer version of Django, we have prepared a small list of problems that you will most likely encounter during the upgrade. A key change in Django 1.7 is support for database migrations. The manage.py has migrate and makemigrations for working with migrations. The syncdb been removed in Django 1.9. You can read more about how migrations work in the documentation .


Also in Django 1.7, the application loading mechanism has been significantly changed. If you have standalone scripts that use the environment variable DJANGO_SETTINGS_MODULE , then you must explicitly initialize the application in them by calling django.setup() . This does not apply to scripts executed through management commands.


In version 1.7, a new project verification system has appeared. The validate command has been removed, the check command has replaced it. It helps to detect problems and gives tips on fixing them.


In version 1.8, the AbstractUser.last_login field can be null . And in Django 1.10, the length of AbstractUser.username increased to 150 characters. If you use AbstractUser in your project, do not forget to write a migration to change the fields. Migration for django.contrib.auth.User already exists, you only need to perform migrate .


Also in version 1.10, the django.conf.urls.patterns() method, which was used to create templates for urlpatterns . Now urlpatterns can be assigned to the usual list . More information about incompatible changes can be found in the official documentation:



What you need to know when moving from Python 2 to 3


If you want to try Python 3, read about the main differences that you should pay attention to. In the new version of the language, the print statement has been replaced by the print() function. The dictionary methods for items() , keys() and values() now return iterators. The old methods iteritems() , iterkeys() and itervalues() no longer supported. Also, the has_key() method has been removed from the dictionaries; instead, the in operator is required. The xrange() function xrange() excluded, since in the new version range() performs its tasks.


Changed and numeric types. Starting in Python 3, the long and int types are combined into one - long . Its values ​​no longer have a trailing L character, so the repr() function will not output it. Another important innovation is the replacement of integer division via the / operator. Now this operation will return a float number.


In Python 3, the str type is used to store text, and bytes is used to store binary data. It is worth noting that these types cannot be combined, otherwise a TypeError error will TypeError . To convert one type to another, you can use the functions str.encode() and bytes.decode() . The built-in basestring type is deleted.


When comparing unordered types, a TypeError exception will now be returned. The method of comparing user objects is no longer supported, so you need to use the __lt__() function to sort, and __eq__() and __hash__() for comparison. The builtin.sorted() and list.sort() functions have stopped accepting the cmp argument, which provides a comparison function, and the key replaced it.


The raw_input() method is renamed to input() . Python 2's input() function is equivalent to eval(input()) . Removed execfile() method. Instead of execfile(fn) you can use exec(open(fn).read()) .


A more detailed list of Python 2 and 3 differences can be found here .


Registration for the course


To register for the course, follow the link . We remind you that starting from March 2, we are opening the course “ Setting a Software Development Task ” without deadlines. We have other IT-courses: programs on Java, C / C ++, Hadoop and algorithms. View the full list here . Good luck in learning web technologies!


')

Source: https://habr.com/ru/post/323056/


All Articles