Answer the question
In order to leave comments, you need to log in
A couple of Python questions about plugins?
Guys, hello.
Relatively not long ago I "moved" from php to python and of course, the first thing that catches your eye is the connection of modules.
I am writing training applications in django and it happens that a huge number of modules / decorators / classes and so on accumulate in one view.
Even if this view is divided into several small ones, a decent number of modules still remain. After php is not customary.
And actually the first question, is it possible to somehow make everything in django "auto-connect" itself??
I have an idea, this is to make a separate file, put all the modules that are needed there and just include one line in all files, but it seems to me that this will slow down the work.
And the second question. How best to connect modules.
1c.
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
def main1(request):
return render(request, 'client/client.html', {})
def main2(request):
return render(request, 'client/client.html', {})
from django.shortcuts import render, redirect
def main(request):
return render(request, 'client/client.html', {})
from django.contrib.auth.models import User
def main(request):
#тут используется User
return render(request, 'client/client.html', {})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question