Mirco
Hello all. How can i do import * dynamically like this? VARIABLE = library from VARIABLE import *
https://docs.python.org/3/library/importlib.html have a look here
Mirco
😀😀
Anonymous
how to inserte a session value to a data base ??
Jimmies San
how to inserte a session value to a data base ??
https://docs.djangoproject.com/en/2.0/topics/http/sessions/#using-database-backed-sessions
Klim
😀😀
importlib.import_module('example.submodule'), but how can i do "from example.submodule import *"?
Mirco
importlib.import_module('example.submodule'), but how can i do "from example.submodule import *"?
module = importlib.import_module('example.submodule') module.__all__with __all__ you have the same logic of *
Django Bot
>> Links - henriquebastos/python-decouple: Strict separation of config from code.
Bekzod
Hello everyone. Is django good choice for highload project with websockets or I should choose other framework? Thanks in advance
N S
Hi guys i cant truncate the table having manytomany fields can you tell me how to do it
N S
I have manytomany field i cant truncate its value
N S
The truncate sql query fails when i try to truncate
Anonymous
{% for body in article %} {% if len(body)>50 %} {{ body }} {% endif %} {% endfor %}
Jimmies San
{% for body in article %} {% if len(body)>50 %} {{ body }} {% endif %} {% endfor %}
filters are better , like truncate https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#truncatewords
Jimmies San
Use for loop before if
and btw the if doesn't impact on performance, a loop... it does.
Anonymous
Who uses heroku here. I deployed, and it served application error, after the Heroku logs --tail command, the error is quite much I don't understand
Meera
my django app run on local .... but when i host it on heroku it only shows root/admin/ not other usls working.
Anonymous
Have you connected to a database?
Meera
how can i connect it ?
Meera
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'forlotus', 'USER': 'postgres', 'PASSWORD': 'admin', 'HOST': '127.0.0.1', 'PORT': '5432', } }
Meera
my database dictionary in settings.py
Mounikesh
see try installing dj_database_url in your django virtual environment
Mounikesh
import dj_database_url ENVIRONMENT = 'production' DEBUG = False ALLOWED_HOSTS = ['yourapp.herokuapp.com'] DATABASES['default'] = dj_database_url.config( default='DATABASE_URL_HERE' )
Mounikesh
and add this to your setting file
Meera
import dj_database_url ENVIRONMENT = 'production' DEBUG = False ALLOWED_HOSTS = ['yourapp.herokuapp.com'] DATABASES['default'] = dj_database_url.config( default='DATABASE_URL_HERE' )
DATABASES['default'] = dj_database_url.config( default='DATABASE_URL_HERE' ) can i directly copy paste it ? or should i knwo my 'DATABASE_URL' ...and if so.. how can i know my database url
Mounikesh
directly copy paste
Mounikesh
DATABASE_URL is automatically added by Heroku upon PostgreSQL database installation. So after this you need need to add the SECRET_KEY:
Mounikesh
https://simpleisbetterthancomplex.com/tutorial/2016/08/09/how-to-deploy-django-applications-on-heroku.html
Meera
directly copy paste
done....re deployed...same error
Mounikesh
i guess the error might be from django app not on the heroku side ,ok post the error log file and did you run migrate command
Mounikesh
in case of url mismatch
Mounikesh
then this should be the error
Mounikesh
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/api/status
N S
Truncate query fails in table containing manytomany fields how do i solve it
Sharif
hi, I need help
Sharif
I do not understand
A
I do not understand
probably, you make mistake on regular expression.
A
lol. read documentations bro
A
or try to read this https://tutorial.djangogirls.org/ru/
Mounikesh
post the code of main urls.py
Sharif
worked
Sharif
thanks
Sayan
Did you push your migration folder from local repo?
Jimmies San
english only please
Django Bot
>> Jobs - Python/Django developer (remote): Rebuild backend for VOD website >> Links - Guide to using Django with Zappa - Understanding Django Channels · Arun Ravindran's Blog and Showcase
Django Bot
>> Jobs - Senior Back-End Developer
Anonymous
hi
Django Bot
>> Links - Guia para Deploy Django Python 3 - Fernando Alves
Django Bot
>> Links - Home Page - Reddit Shredder
syam
Why is the url file so crowded. .
Sharif
Why is the url file so crowded. .
I do not understand your question
Anonymous
is anyone knows how to scrap an api using webpage in python?
Mounikesh
Soup
😅
Django Bot
>> Links - Celery and Django and Docker
Anonymous
i just try to scrap from site: redmart.com
Anonymous
it uses api's
Anonymous
please do i install django-bootstrap4, or i just download bootstrap 4 local files
Anonymous
so i couldn't get any scrapy datas from it.
inchidi
what is the pros and cons of both
if you think the package help you, then use it. the cons only if the package buggy, then you add bugs to your project.
Anonymous
hmm, thanks
Anonymous
so i couldn't get any scrapy datas from it.
You can also scrape it using Scrapy framework if it is complex
r0b0t
has anyone styled a weasyprint pdf before? I need help! 😔😔😔😔
Django Bot
>> Links - python - How to force migrations to a DB if some tables already exist in Dj
Django Bot
>> Links - Intro to Django - OverIQ.com
Sharif
Today, the planet Mars is approaching the Earth, and see the sky. It looks like a red star
Anonymous
Django Bot
>> Links - The Ultimate Tutorial for Django REST Framework: CRUD (Part 1) - Blog About
Django Bot
>> Links - django/djangobench: Harness and benchmarks for evaluating Django's performa
Anonymous
I need to integrate payment on my Django App, what can I use How can I go about it