cj
but, at the end of the day, it's up to you whatever tools to use if they float your boat
cj
but just in some edge cases
cj
still, you should go first for Nginx+Gunicorn
cj
try them both combos and decide yourself which one to use
Mario
And the Django process running inside of venv right?
cj
And the Django process running inside of venv right?
totally right, always use venvs ... also if you have some free time, try the containers way (Docker and similar)
cj
Ok, I'll check that, but, what's his advantage?
you can deploy/develop it anywhere without having to care which OS you're using
Mario
you can deploy/develop it anywhere without having to care which OS you're using
Yes I know that. In this case I'll work only with Ubuntu. So, specific for Django using docker have any advantage?
cj
Yes I know that. In this case I'll work only with Ubuntu. So, specific for Django using docker have any advantage?
if you're doing a one-rockstar-developer project doing and managing everything, maybe no; but, if you work with a team, then yes, the said advantage of not caring about the OS and things —it doesn't matter if it's Django or any other framework and/or programming language—
DoT
anyone tell me the reference for converting whole website in one lang to another lang
DoT
nah , i want to write code in django to translate
Pasha
Why Django Debug Toolbar is not displayed in app even with properly configured settings: DEBUG = True INTERNAL_IPS = [ "127.0.0.1", ]
cj
Why Django Debug Toolbar is not displayed in app even with properly configured settings: DEBUG = True INTERNAL_IPS = [ "127.0.0.1", ]
those are not specific configuration for debug toolbar, you should show the configuration parameters specifically for the debug toolbar
Pasha
INSTALLED_APPS = [ 'polls.apps.PollsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', ] urls.py: from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path("polls/", include("polls.urls")), path('__debug__/', include('debug_toolbar.urls')) ]
voiceless
How to backup database in django?
Afshin👀
hi friends how can i write html tag for call this function and urls for user any one knows?
Afshin👀
def invite_link(request): invite_code = ''.join(random.choices(string.ascii_uppercase + string.digits, k=8)) return f"/register?invite={invite_code}&inviter={request}"
Afshin👀
I called invite_link but it does not work
Rahat
Delete an object automatically after 5 minutes
Rahat
Please tell me
Doragonsureiyā
Delete an object automatically after 5 minutes
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
Maxim
Please tell me
we can't read minds
Morteza
Motasem
Please tell me
celery beat
Soham
I want to use components based architecture for my django projects, there is any way to do it most efficiently?
Asad Ullah
what is the diff between psycopg and psycopg2
Asad Ullah
i wanted to connect postgresql database to my django project
Victor
Delete an object automatically after 5 minutes
You can use celery or cron job too
Rahat
You can use celery or cron job too
Send me documents already use celery
Rahat
Not happening
Victor
Send me documents already use celery
https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html
Bandar
Hi guys how are you doing? I am working on project that involves third-party api call. I like separation of concern. In my Django project I have a view that takes in “POST” request and return response Before the response retuned I have function that calls third api call and apply some logic Function name “get_result” Should I include this function in the view or should I put in in separate file and would that violate the MVC pattern Thank you !
Afshin👀
user = User.objects.get(username=username) why this is not work
Doragonsureiyā
user = User.objects.get(username=username) why this is not work
If you need help, don't just say "not working", explain in detail what's not working the way you expect it to
Afshin👀
when i run and try to register this code send error to screen like this Forbidden (403) CSRF verification failed. Request aborted.
Afshin👀
In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django’s CSRF mechanism has not been used correctly. For POST forms, you need to ensure: Your browser is accepting cookies. The view function passes a request to the template’s render method. In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL. If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data. The form has a valid CSRF token. After logging in in another browser tab or hitting the back button after a login, you may need to reload the page with the form, because the token is rotated after a login. You’re seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed. You can customize this page using the CSRF_FAILURE_VIEW setting.
Afshin👀
Create a view
I have a view and i write this code in view
fateme
hi guys. I have three models named image, product, and slider. Slider and also product can have several images . Therefore, in the image model, I need to have a foreign key to slider and a foreign key to product, in addition to an imagefield field. My question is how should I set upload_to for this imagefield so that slider images go into a folder named /slider and product images go into a folder named /product. Can anyone help please?
John Doe
Hello everyone. How I can change this error in jinja2? 'for' statements should use the format 'for x in y': for j in i.text.split('\n')
Unknöwn
I need a clear and concise guide on how to explicitly render all the fields of a form in HTML templates. Inside my models.py file I have a model class Customer, I proceeded to creating a new file forms.py and created a form class CustomerForm inside it by extending the forms.ModelForm. By default all the fields I have chose to render in my HTML template does, but I want to make certain fields required such that users must provide information to the field. I have tried and checked several resources I couldn't get this done. What is the best approx to achieving this task?
Binary
How to do this
Duong Chan Troi
How to add all app directory to a folder
Doragonsureiyā
How to add all app directory to a folder
What are you talking about?
Duong Chan Troi
What are you talking about?
I want to make my web directory structure like this: project_root/ manage.py mysite/ myapps/ app1/ app2/
Duong Chan Troi
I don't know how to make my project find those apps
Charly
I don't know how to make my project find those apps
instead of call them on settings "app1" call it myapps.app1
Charly
these are python modulesif you dont know what python modules maybe you need to review python basics concepts before going to django
cj
I don't know how to make my project find those apps
just add the path in your INSTALLED_APPS list, like: INSTALLED_APPS = [ ... "myapps.app1", "myapps.app2", ... ]
cj
Shouldn't named apps for that folder?
you can name it the way you want, I guess you should read Charly's message: https://t.me/django/245857
Charly
Unless you have a very good reason to disable csrf better just do the setup properly
Mahdi
Guys, Is there any no code web design platforms like webflow that can be integrated with django backend? I'm trying to use webflow but it's not that easy
A
django hosting sites, any help
Farzin
Hello everyone, I need to add an extra field in my model serializer that needs to show all objects from another model as a multichoice field for user so user could select any option that want, but I used couple of ways, all of them threws error, how can i do that?
Tatiana
Hi All🤚 Have any knowledge about creation docx (also filing tags in spec places from input ) and converting it into pdf.Important (or better) some libraries that are not running(using) Microsoft word in server A lot of thanx Blessing to everyone that can help (links ,please )🙏🙏🙏
Oleh
Hello guys, how can i set scheduled task in django? I need execute some actions after 1 day exactly
Armond
raise self._reap_last_connection_workflow_error(error) pika.exceptions.amqpconnectionerror When run rabbitmq How do i fix?
Asad Ullah
i am confuse in between using cbv or fbv! can anyone tell me in which i can get more control on my project code?
Devang
When I import tinymce.model Some error is occurs
Devang
How can I solve this
Devang
Error is Import "tinymce.models" could not be resolved pylance
preethi
What are the basic libraries required for a django api project
Muflone
What are the basic libraries required for a django api project
there are no requiremetns, Django itself can provide APIs DRF is recommended
Charly
!what