Muflone
if me, you or another crazy would want to use the hotels app, it just needs to be included in the application. hopefully hotels should be indipendent on its own
Muflone
plus I have an api apps for the things related to the android app, which in turn need to import anything else in the project
Muflone
rest api for an android app
George
Ah, i guessed
Muflone
I'm sorry, I know my english is not good enough, but it's not my first language 😝
George
Well ty
Muflone
np
Ayushman
Ehat r advantage of django over flask?
Ayushman
should we considrr django for very small backend program?
Hernan
Yes it work Thanks What ❓ actually eval do?
please, read this about eval function http://vipulchaskar.blogspot.com/2012/10/exploiting-eval-function-in-python.html
cj
Ehat r advantage of django over flask?
think about Django as a full featured Lamborghini car with everything on it working, you just have to learn how to drive the car (and how to use each of its pieces); and with Flask, you can have the same car —if you want, or build another one—, but you have to build each piece one by one and learning about each piece in the process🤷🏻‍♂️ both Django and Flask are good for web development, you just have to have clear requirements of what you want to do to choose the right one for your case.
Maz
Ehat r advantage of django over flask?
Want to really understand how Django works? Start with Flask. 😊
Maz
should we considrr django for very small backend program?
Depends...but its probably overkill. Use Flask or FastAPI
Yacov
Someone has worked with the facebook api, I need to list all my campaings...
Doragonsureiyā
If someone Has a north to help me, thank you
looks like you need an offtopic group, please continue this conversation at @pythonofftopic
Yacov
! offtopic
Actualli I wanted help with how tô do that with python
Yacov
Haa, ok, but my project is in django
Mirco
Haa, ok, but my project is in django
If you don't specify it we cannot know that
Doragonsureiyā
Haa, ok, but my project is in django
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so move to @PythonOfftopic group and ask there.
✙Yaroslav
i am using PasswordChangeView, PasswordChangeView using registration/password_change_form.html. In the template is present help_text. How do you translate this help_text to my language? is it even possible?
Sweetie
I am trying to learn vue and add some nice looking frontend to my django apps. Some tutorials simply imported vuejs library and used a script tag to create vue app inside templates. While some builds separate frontend and backend with webpack and node and a lot of things babel and things I do not know of. I only know python, django, html css and very basic js. What is the difference between directly importing vue library in template and using the vueApp vs whole seperate vue webpack as separate frontend. Which tutorials shall I follow to make my django + vue app
Cesar
I am trying to learn vue and add some nice looking frontend to my django apps. Some tutorials simply imported vuejs library and used a script tag to create vue app inside templates. While some builds separate frontend and backend with webpack and node and a lot of things babel and things I do not know of. I only know python, django, html css and very basic js. What is the difference between directly importing vue library in template and using the vueApp vs whole seperate vue webpack as separate frontend. Which tutorials shall I follow to make my django + vue app
I've been in this situation, well I'm actually are... If you are not familiar with any JS framework and don't have a lot of time to learn. Don't do it. You should do 1 of two things 1- stick to Django + templates and using vuejs (library) inside your templates 2- focus on Django with rest framework and leave the job of front end to someone else ... Could be a freelancer or a partner
Nitish
why there is need of token authentication please any one clear my doubt
Nitish
what is the actually need and use of token authentication
SG
what is the actually need and use of token authentication
Django provide high security to POST request to site
SG
So token authentication is needed
SG
But if you want then you can remove it from settings
SG
but how it works
It recognise the POST request and Database operation and check that the request is coming from allowed user not from other improper user to restrict site hacking
SG
Is check the CSRF token
Nitish
ok ok
SG
ok ok
If you didn't get then DM me. I will try to give detailed information
Nitish
ok thanks
Rajesh
https://del.dog/amutekufic.txt
Rajesh
Can anybody help me with this?
Rajesh
Urlpattern error
Rajesh
Solved
Rajesh
Thanks btw
Igor
Hello! I recently started using docker and Postgres. Everything seemed to work, but I don’t understand how can I get information from Postgres in Django? (Before that I used SQLite) Code in settings.py: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'user', 'PASSWORD': 'password', 'HOST': 'postgres', # set in docker-compose.yml 'PORT': 5432 # default postgres port } } Code in docker-compose.yml: postgres: image: 'postgres: latest' volumes: - ./postgres-data:/var/lib/postgresql/data ports: - "5432: 5432" environment: POSTGRES_USER: user POSTGRES_PASSWORD: password
Igor
hmm, are you sure? Its local host, is not it?
Igor
On my pc. Ok, I'm going to try now))))
Igor
does ur django app run in container?
hmmm, how can i get this info? I am noob in docker ahahha. docker-compose ps: Name Command State Ports --------------------------------------------------------------------------------------------------- shpplace_postgres_1 docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp shpplace_redis-cacher_1 docker-entrypoint.sh --por ... Up 6379/tcp, 0.0.0.0:6380->6380/tcp shpplace_redis_1 docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp shpplace_web_1 ./docker-entrypoint.sh Up 0.0.0.0:80->80/tcp
Igor
shpplace_web_1 - maybe it is django app?)))
Muslim
shpplace_web_1 - maybe it is django app?)))
then "docker logs shpplace_web_1"
Igor
Should I send you all the logs? it is a cup of code: Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). April 01, 2020 - 13:07:52 Django version 3.0.3, using settings 'shp_place.settings' Starting ASGI/Channels version 2.4.0 development server at http://0.0.0.0:80/ Quit the server with CONTROL-C.
Igor
then it works fine
When I go into postrges and enter \с "name db" and then \dt i get , «I did not find any relations».
Igor
but I have to get the django models structure
Igor
======Таки ждем, пока постгра поднимется====== <——— postgres answer curl: (52) Empty reply from server Таки дождались........... ======Накатываем миграции====== <——— migrations answer No changes detected Operations to perform: Apply all migrations: admin, auth, back, contenttypes, sessions Running migrations: No migrations to apply. ======Стартуем сервер====== <——— server answer Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). April 01, 2020 - 14:02:30 Django version 3.0.3, using settings 'shp_place.settings' Starting ASGI/Channels version 2.4.0 development server at http://0.0.0.0:80/ Quit the server with CONTROL-C.
Igor
it is code in entrypoints.sh: echo "======Таки ждем, пока постгра поднимется======" while ! curl http://postgres:5432/ 2>&1 | grep '52' do echo "Таки ждем....." sleep 1 done echo "Таки дождались..........." echo "======Накатываем миграции======" python manage.py makemigrations python manage.py migrate echo "======Стартуем сервер======" python manage.py runserver 0.0.0.0:80
Igor
sorry for russian. If you dont understand i can explain
Igor
it seems to be good
Igor
realy)))) aaahah
Muslim
realy)))) aaahah
then u can check if models exist in docker-compose exec shpplace_web python manage.py shell
Igor
sudo docker-compose exec shpplace_web_1 python3 manage.py shell ERROR: No such service: shpplace_web_1 hmmmmmm
Igor
shpplace_web_1 ./docker-entrypoint.sh Up 0.0.0.0:80->80/tcp <— but it exists
Igor
version: '3.1' services: web: build: ./ command: ./docker-entrypoint.sh volumes: - ./:/web ports: - "80:80" depends_on: - postgres redis: image: "redis:alpine" ports: - "6379:6379" redis-cacher: image: "redis:alpine" command: --port 6380 ports: - "6380:6380" postgres: image: 'postgres:latest' volumes: - ./postgres-data:/var/lib/postgresql/data ports: - "5432:5432" environment: POSTGRES_USER: user POSTGRES_PASSWORD: password
Muslim
docker-compose exec web python manage.py shell
Igor
ohh e sorry
Igor
emm, console open me the python shell..... sudo docker-compose exec web python manage.py shell Python 3.7.7 (default, Mar 11 2020, 00:27:03) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>>
Igor
maybe, maybe.... i could be wrong with postgres volumes in .yml...
Muslim
Igor
hmmm, okeey. Than, what can i write for example?(sorry, i am a little bit stupid).
Muslim
Igor
can i write you in telegram? not in this room?