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
George
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
George
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
George
Well ty
Muflone
np
Ayushman
Ehat r advantage of django over flask?
Ayushman
should we considrr django for very small backend program?
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.
Anonymous
Amen
Anonymous
Yacov
Someone has worked with the facebook api, I need to list all my campaings...
Yacov
Mirco
Yacov
! offtopic
Actualli I wanted help with how tô do that with python
Mirco
Yacov
Haa, ok, but my project is in django
Yacov
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
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
SG
So token authentication is needed
SG
But if you want then you can remove it from settings
Nitish
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?
Muslim
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?)))
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.
Muslim
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
Muslim
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
Muslim
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)
>>>
Muslim
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?
Muslim