Best Python code snippet using localstack_python
partners.py
Source:partners.py
...13 return render_template('editor_bp/partners.html', partners=partners, title='ÐаÑÑнеÑÑ')14@blueprint.route('/add_partner', methods=['GET', 'POST'])15@roles_required(['editor', 'admin'])16@logger.catch()17def add_partner():18 if request.method == 'POST':19 name = request.form['name']20 url = request.form['url_address']21 if name == '':22 flash('Ðе бÑло введено название Ñайла...')23 return redirect(url_for('editor.add_partner'))24 if url == '':25 flash('Ðе бÑл введен адÑÐµÑ ÑÑÑлки...')26 return redirect(url_for('editor.add_partner'))27 if Path(request.files['file'].filename).suffix not in files_suffixes:28 flash('РаÑÑиÑение Ñайла не "jpg" или не бÑл оÑпÑавлен Ñайл.')29 return redirect(url_for('editor.add_partner'))30 image = request.files['file'].read()31 partner = Partners(name=name, url=url, image=image)...
urls.py
Source:urls.py
1from django.urls import path, include2from . import views3urlpatterns = [4 path('', views.home, name='home'),5 path('about/', views.about, name='about'),6 path('accounts/signup/', views.signup, name='signup'),7 path('health/', views.health_index, name='health_index'),8 path('health/<int:health_id>/', views.health_detail, name='health_detail'),9 path('health/create/', views.HealthCreate.as_view(), name='health_create'),10 path('health/<int:pk>/update/', views.HealthUpdate.as_view(), name='health_update'),11 path('health/anonymous/', views.anonymous, name='anonymous'),12 path('entry/', views.entry_index, name='entry_index'),13 path('entry/<int:entry_id>/', views.entry_detail, name='detail'),14 path('entry/create/', views.FormCreate.as_view(), name='form_create'),15 path('entry/<int:entry_id>/assoc_partner/<int:partner_id>/', views.assoc_partner, name='assoc_partner'),16 path('entry/<int:entry_id>/unassoc_partner/<int:partner_id>/', views.unassoc_partner, name='unassoc_partner'),17 path('entry/<int:pk>/update/', views.EntryUpdate.as_view(), name='entry_update'),18 path('entry/<int:pk>/delete/', views.EntryDelete.as_view(), name='entry_delete'),19 path('entry/<int:entry_id>/add_partner/', views.add_partner, name='add_partner'),20 # Pick a Location with an Entry(M:M)21 path('entry/<int:entry_id>/picked_location/<int:location_id>/', views.picked_location, name='picked_location'),22 # Unpick a location 23 path('entry/<int:entry_id>/location_unpicked/<int:location_id>/', views.unpicked_location, name='unpicked_location'),24 path('location/', views.LocationList.as_view(), name='location_index'),25 path('location/<int:pk>/', views.LocationDetail.as_view(), name='location_detail'),26 path('location/create/', views.LocationCreate.as_view(), name='location_create'),27 28 path('location/<int:pk>/update/', views.LocationUpdate.as_view(), name='location_update'),29 path('location/<int:pk>/delete/', views.LocationDelete.as_view(), name='location_delete'),30]...
main.py
Source:main.py
...3import asyncore4a = omegle.OmegleClient()5b = omegle.OmegleClient()6#c = OmegleClient()7a.add_partner(b)8#a.add_partner(c)9b.add_partner(a)10#b.add_partner(c)11#c.add_partner(a)12#c.add_partner(b)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!