-
Session problem of Django
blog s article like function, like once + 1, use session to record the current user problem point is: if you like article 1, article 2 will indicate that it has been supported. The reason is to judge that session how to realize that articles cannot b...
-
Centos7shell postgres login failed
Baidu said that there is a problem with the verification method in the file var lib pgsql 9.5 data pg_hba.conf, but the reason for changing the verification method is to use the command psql-U postgres-d mydjango-p 5432-h 127.0.0.1 to log in directl...
-
About the inaccessibility of the website (https+nginx+dns parsing)
in order to obtain Tencent Cloud s ssl certificate, enter the URL domain name after modifying the non-Wanwang domain name registered by Aliyun.
the website cannot be accessed. Has anyone encountered ?
nginx is normal: [root@iZwz9hbv3lrr68d8bo5dvp...
-
About what token doesn't understand.
at present, we are writing the api interface, which is the interface provided for the mobile end, so why do we add a token? when we set the user name and password for the user? And the document also says to verify it in the way of token? Isn t it okay t...
-
Django reset password
as shown in the picture of the program, user.set_password ( data [ password ] ) also verifies that the output is True, but check to the database and find that the password has not changed. What is the reason? but if you do this in the database,...
-
Type object 'Meta' has no attribute' model'
(venv3_ETC) [root@iZwz9hbv3lrr68d8bo5dvpZ goods]-sharp python views.py Traceback (most recent call last): File "views.py ", line 5, in < module >
from .serializer import GoodsSerializer
ModuleNotFoundError: No module named _ main__.serializer ; ...
-
Django model create reported an error
class Article (models.Model):
id=models.BigAutoField(primary_key=True)
title=models.CharField(max_length=32)
publishtime=models.DateTimeField(auto_now_add=True)
catalogs=models.ForeignKey(to= Catalog )
tags=models.ManyToManyField( Tag )
-sharp cont...
-
With regard to the error about the introduction of modules in the same directory, the custom module cannot be read by django,2.0 's setting.pyri installed _ APPS?
sys.path.insert(0,BASE_DIR) , sys.path.insert(0,os.path.join(BASE_DIR, db_tools ))sys.path.insert(0,os.path.join(BASE_DIR, apps ))sys.path.insert(0,os.path.join(BASE_DIR, extra_apps ))
:shell
from goods.models import Goods
:python models.py:Tra...
-
Unknown column 'snippets_snippet.owner_id' in' field list'
excuse me, I have a User serialization class. The model used in the class is set owner = models.ForeignKey ( auth.User , related_name= snippets ) in the User,Snippet model. Performing database migration does not report an error, but there is no such...
-
About using pycharm to choose the default interpreter under ubuntu
python2 and python3.5, are already included under ubuntu. I installed 3.6 myself, so I chose 3.6 to configure the interpreter under pycharm, but did not actually execute python3.6. For example, if I execute python on the command line, the default is 3.6....
-
How to set the field default value of another model in django based on the field value of another model
one of my model has a field value that needs a default value, such as
class Earnings(models.Model):
earing_num=models.DecimalField(default=)
but the setting of the default value depends on a field value of another model
class Product(models.Model...
-
How to set permissions for a single field in a model in django rest framwork
I want to set permission, for a separate field in an API. If the user has permission, it will be displayed, and if there is no permission, it will not be displayed. What should I do? ...
-
The uwsgi + djano head request causes the request not to respond.
the server is written by nginx + uwsgi + djano, the project is relatively old, and it has been found to be unresponsive recently. After investigation, it is found that the uwsgi queue is slow and full, eliminating the problem of excessive number of reque...
-
The problem of authenticate () function in auth Module in django
this module is used to authenticate users
from django.contrib.auth import authenticate
A few days ago, you can use user = authenticate (username=username, password=password) to return a user, but today you try to return None .
the following proble...
-
Django can't get the parameters of the POST request?
when using axios to send a POST request to the backend, the server cannot get the parameters that are included in the POST. the sending code of the front end is as follows:
Http({
method: POST ,
url: signup ,
data:{
username:th...
-
If you want to use django to develop a resume recruitment system, ask that corporate member and individual member. Is it better to use one User model or to design two?
want to use django to develop a resume recruitment system, ask which corporate member and individual member. Is it better to use one User model or to design two?
I have now created a new users app, class User (AbstractUser):
xxx
then the next s...
-
Is it possible to use qs.stringify to deal with object arrays? How does the Django backend get the data?
I want to transfer the array of objects to the background using post. This is how I pass it:
Http({
method: POST ,
url: addGroup ,
data:qs.stringify({
list :this.excelData
})
})
...
-
Pycharm failed to create Django project, why?
1 error such as screenshot
2 system: win10 + PyCharm 2017.2.3 x64 + python3.6.2 + Django2.04
...
-
The problem of form submission url under django
first log in to the ip:port login interface through form submission and execute the do_login function in view.py. If the login is unsuccessful, I want to jump to the original ip:port login, and carry the error message.
if I return via rerener (reque...
-
The render function of django can return several dictionary parameters
render (request, index.html , { index :index})
would you like to ask whether the dictionary type parameter of the index returned later can return more than one parameter at the same time?
for example,: render (request, index.html , { index :...