zafer faruk
Hi guys. I have a problem to my project. This problem keylogger on the my form page. It is smooth at first run but when form reload again key pressing result is increased meaninglessly.
zafer faruk
can you help me?
Xavier
that's why use redirect
zafer faruk
I have to run the keylogger algorithm 10 times on the same form page. Because I want to compare two passwords and get the entered password time
Artur
hello everybody! how can i select max id from model????
Xavier
hello everybody! how can i select max id from model????
Just order by reverse id, and take the top one. Model.objects.all().order_by("-id")[0]
Syed
Hello, I have a model form that has a ManyToMany field, I'd like to have in the many to many selection only some of the other table values, how could I do it?
In django many to many field create seperate table. So u have to query from new table which is generated by many to many fields
A
class PerfilUsuario(Base): autor = models.OneToOneField(get_user_model(), verbose_name='Autor', on_delete=models.SET_NULL, null=True) descricao = models.TextField('Descreva seu perfil', max_length=5000) avatar = StdImageField('Avatar', upload_to=get_file_path, variations={'thumb': {'width': 50, 'height': 50, 'crop': True}}) class Meta: verbose_name = 'PerfilUsuario' verbose_name_plural = 'PerfilUsuarios' def __str__(self): return self.autor
Mahi_16
I nee to send 10000 request per second to the server. Django can process huge request in a second. If it's possible can you share me any reference link or Videos. Thank you 😊.
Anonymous
Its a bootstrap/ css error
Hii, is it due to the module bootstrap3 for django or the bootstrap CDN that I am linking from the internet...
Anonymous
Hi I want to use index() function in django templates How can do that?😞
saran
Hi I want to use index() function in django templates How can do that?😞
Didn't get you? If you can want to get into some view, please check template tag in django.
Alessio Balderi
Can I use on_delete on ManyToManyField?
A Kumar
Can anyone tell why SQLite3 access denied?
Taku
Iam creating channels using Django
Taku
I have installed channesls_redis
Taku
But iam getting an error
Taku
In connection
Taku
Can anyone help?
Mr
I have installed channesls_redis
Did you start redis server ??
Taku
How it is started?
Xavier
Can I use on_delete on ManyToManyField?
no, it's no use cuz thats the point of many to many field
Xavier
Hi I want to use index() function in django templates How can do that?😞
https://stackoverflow.com/questions/13376576/how-can-i-use-a-variable-as-index-in-django-template one small google search gave the answer
محمد دلشاد
no, it's no use cuz thats the point of many to many field
yes and if you want to achieve you must write codes in views by youself or you can use signals there.
Taku
Did you start redis server ??
Thanks I have resolved it
Xavier
What do u mean?
https://stackoverflow.com/questions/3937194/django-cascade-deletion-in-manytomanyrelation this will explain better
Taku
How?
I have forgot to install redis server
Taku
So it gave me connection problem
محمد دلشاد
no u cant, there is no on_delete param in many to many
can't we write own codes for deletion of elements from manytomanyfields?
Xavier
can't we write own codes for deletion of elements from manytomanyfields?
that one can do but he asked "on_delete" specifically
محمد دلشاد
that one can do but he asked "on_delete" specifically
ya ya this is why i said to achieve that feature you have to write ur own view codes
Xavier
ya ya this is why i said to achieve that feature you have to write ur own view codes
ah yes sorry i misunderstood you yes one can write a view to achieve it but on_delete do on exist on many to many and apart fom that the goal of many to many field is that it links to many field so why use ondelete
محمد دلشاد
ah yes sorry i misunderstood you yes one can write a view to achieve it but on_delete do on exist on many to many and apart fom that the goal of many to many field is that it links to many field so why use ondelete
its okk a very small query except of integration of different apis or languages what are the features we can learn in core django except filters,rest,payment gateway integration,basics like form models and all
محمد دلشاد
yeah i have implemented everything there except payment gateway which will be integrated in my next project
Xavier
yeah i have implemented everything there except payment gateway which will be integrated in my next project
ah nice here too on my current project i am implementing the payment and gateway
محمد دلشاد
what would you prefer if i go to learn channels ? like requirements, focusing points and so does resources.
Xavier
payment and gatewae?
ye gatwae of da wae ;)
Anonymous
i know from php that inside template I can use php script like <?php myStr='hello' php>. Can i do something similar in django template? It uses jinja syntax so is there that kinda a way I can declare some temporary variables and use them? Thank you in advance
محمد دلشاد
{% with x="Hello" %} {{ x }} {% endwith %}
new
I install channels-redis but I get this error👇 ConnectionRefusedError :[Errno111] connect call failed ('127.0.0.1', 6379) So what I do next?
new
""" Django settings for ch project. Generated by 'django-admin startproject' using Django 3.0.5. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'e0p(s+ed#^*4e4y*n8_3b0^ye0x$%*8_()r$a(_)3glybp@%ay' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'channels', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'chat', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'ch.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'ch.wsgi.application' ASGI_APPLICATION = 'ch.routing.application' CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { "hosts": [('127.0.0.1', 6379)], }, }, } # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/'
new
""" Django settings for ch project. Generated by 'django-admin startproject' using Django 3.0.5. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'e0p(s+ed#^*4e4y*n8_3b0^ye0x$%*8_()r$a(_)3glybp@%ay' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'channels', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'chat', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'ch.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'ch.wsgi.application' ASGI_APPLICATION = 'ch.routing.application' CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { "hosts": [('127.0.0.1', 6379)], }, }, } # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/'
Is anything wrong in my settings.py
new
No
What I do to start it?
new
What I do to start it?
I use Android mobile
devops
Has anyone info about git rebase command
devops
I wanna learn it
devops
For which reason it's use as in doc it's not clear
Vidu
version: "3" services: msqldb: image: mysql:8.0.20 environment: MYSQL_ROOT_PASSWORD: vdsforeverr MYSQL_PASSWORD: vdsforeverr MYSQL_DATABASE: restaurantratingsystem ports: - "3315:3306" dj: container_name: dj build: django command: python manage.py runserver 0.0.0.0:80 volumes: - ./django:/code ports: - "80:80" depends_on: - msqldb
Vidu
With mysql work bench, I tried connect with docker mysql server using host name 'msqldb' as specified in docker-compose file. But it did not work. It only works with host name , 'localhost'. What can be the issue?
Игорь
servicename is used only to connect containers together, from host machine only declared ports available mapped on localhost.
Vidu
@ne0d1n Thank you for helping me.. Then, from several tutorials, and questions I have referred, they have used service name as the host name. This is one of them. Am I getting something wrong? https://dragonprogrammer.com/dockerized-django-api-angular-tutorial/
Rony
in django, how can i show online user list in the tamplate? i tried to use {% if user.is_autheticate %}{% endif %} but it doesn't work. it's just a blog site
Jesus
I want to build a big web app, task management tool, with all sort of features including ML. I was thinking on using Django and its templates but I heard of Django restframework and ReactJs together, do you have any thoughts on this?
Jesus
It's up to u If you are the only developer, it's not an easy job to maintain to different apps ( FE + BE ) fully decoupled
At the moment I am by myself, but the ideal thing is to have a team. Since I am aiming to have a team, I wanted to make it that way. I have already built a prototype of the app but I ended up using AJAX and lots of plain JavaScript. That made me think if I should move to a JS framework that works well with Django. I had a look to Restframework and seems promising. I would like to know what you guys would do in this situation as I am not an expert
Luis
tell me a cheap and good django hosting
Mirco
At the moment I am by myself, but the ideal thing is to have a team. Since I am aiming to have a team, I wanted to make it that way. I have already built a prototype of the app but I ended up using AJAX and lots of plain JavaScript. That made me think if I should move to a JS framework that works well with Django. I had a look to Restframework and seems promising. I would like to know what you guys would do in this situation as I am not an expert
Even if you choose a js library, you will write plain js so the first thing is learn as much as u can the language before any library/framework If your plan is to expand, yup it could be a nice idea to start by decoupling but it will be "hard" for you at the beginning because you need to maintain and develop two separate apps
Doragonsureiyā
tell me a cheap and good django hosting
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box write down the same words you asked here Step 4: Read the firsts results
Luis
!search
I'm searching. I just wanna know what you guys use.
Anonymous
Hello guys I'm deploying Django app on heroku server. In local sever the app is running like a charm. but when migrating to the heroku server it showing no module name "rest_framework". I tried everything from stackoverflow but didn't help.
Anonymous
Any help will be greate