A registration function. The function of accessing the registered url, url is to read the user names and passwords of 500 users from the excel file, read out a piece of data, run the create_user function at a time to create a user, but this will cause t...
define in models.py jiezhi_date = models.DateTimeField (blank = True, null = True, db_index = True, verbose_name = _ (u information cutoff )) in the template: < div style= "color:-sharpA8B1BA; " class= "text " > deadline: {{form.jiezhi_date}}...
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...
could you tell me what s wrong with my form? Why can t the data be submitted? <form class="ui form" method="post" action="{% url users:my_recharge %}"> {% csrf_to...
according to the book "python programming from introduction to practice ", after modifying the models.py, execute the command python manage.py makemigrations learning_logs, to report an error and ask for advice. model.py Code from django.db import...
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....
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...
We know that there are good ways to localize data such as localStorage,sessionStorage in HTML5. So what are some convenient ways to localize data in Django? ...
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...
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...
(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 ; ...
We know that on a server, we can install python, django, etc., and then run our django project. But why do you usually install virtualenv : first? yum --enablerepo=epel -y install python-virtualenv then install these software packages in virtualenv ...
run this command root@VM-0-14-debian:~ webvue-sharp gunicorn-w 1 webvue.wsgi:application-b 127.0.0.1 webvue.wsgi:application 9090-t 30 as follows: [2018-04-02 17:56:58 +0000] [9374] [INFO] Starting gunicorn 19.7.1 [2018-04-02 17:56:58 +0000] [9374] [I...
For the project of django, direct command to run at 0.0.0.0 9090 is OK nginx reverse proxy is used to access static resources of 127.0.0.1purl 9090. my configuration is like this location { proxy_pass http: 127.0.0.1:9090;...
"task1": "http: localhost:8000 api task1 ", "task2": "http: localhost:8000 api task2 ", "task3": "http: localhost:8000 api task3 ", requestapi? "big_job": "http: localhost:800...
wrote a blog, tags has to be loaded every page, so use template inheritance, inherited there is no data, is there any good way? I can think of a global variable or decorator. Does Django have a better solution? ...
as shown in the figure, a simple add and query operation takes up to 1 second [environment: windows + python3 + django2]. (the amount of data in PS: is not much, and todo_list has only 2 rows of data, which is still so slow.) def get(request): -...
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,...
query the data in this way user_add1 = UserAddress.objects.filter(id=int(add_id)) then serialize json_data = serializers.serialize("json", user_add1, ensure_ascii=False) return json return HttpResponse(json.dumps(json_data), content_t...
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...