Я не понимаю откуда Django собирает эти файлы.
import os
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.join(PROJECT_PATH, "media")
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECT_PATH, "static")
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(PROJECT_PATH, "dev_static"),
)
class Value_calc():
def __init__(self):
self.sum_data = ''
self.statement_data = 'value_1'
from app.services.forms import Calck, Value_calc
@bp.route('/calc', methods=['GET', 'POST'])
def calc():
form = Calck()
data_form = Value_calc() # экземпляр хранилища значений form
calc_validate(form, data_form)
return render_template('calc.html', form=form)
def calc_validate(form, data_form):
if form.validate_on_submit():
state_fee = form.gscalc_arbitr(form.sum.data, form.statement.data)
flash(state_fee)
data_form.sum_data = form.sum.data
data_form.statement_data = form.statement.data
return redirect(url_for('services.calc'))
else:
form.sum.data = data_form.sum_data
form.statement.data = data_form.statement_data
return form.sum.data, form.statement.data
class AddResponseForm(forms.ModelForm):
class Meta:
model = Response
fields = ('body', 'project')
widgets = {'project': forms.HiddenInput()}
form = AddResponseForm(request.POST)
if form.is_valid():
response = form.save(commit=False)
response.user = request.user
response.save()
class DirectoryItemSerializer(serializers.ModelSerializer):
def create(self, validated_data):
directoryId = validated_data['directory'].id
isActive = True
code = validated_data['code']
directoryItems = DirectoryItem.objects.filter(directory=directoryId, is_active=isActive, code=code)
if directoryItems.count() != 0:
item = directoryItems[0]
if item.name == validated_data['name'] and item.short_name == validated_data['short_name']:
raise EntityExistException()
else:
item.is_active = False
item.save()
return DirectoryItem.objects.create(**validated_data)
else:
return DirectoryItem.objects.create(**validated_data)
class Meta:
model = DirectoryItem
fields = '__all__'
git reset --soft HEAD~1
git commit --amend