Anonymous
https://docs.djangoproject.com/en/2.0/ref/csrf/
Anonymous
Check the above documentation to get more information about this topic, I think no matter the Django version in this case
Django Bot
>> Links - Building Modern Web Apps with Python, Django Rest Framework and Angular 2+ - Django — WebFaction Software Documentation - Getting Started with Django — WebFaction Software Documentation - Using pyvenv (venv) With Django on WebFaction. :: Solid Ether - Django Development | DigitalOcean - 课程介绍 · Django企业开发实战教程 - Essential Image Optimization
Jordan
Hey there, I want to host podcast on my site. And have them be able to play them on my django app. how would i go about doing this??
Aslam
#ask how do i deploy web service using django ??
inchidi
#ask how do i deploy web service using django ??
you can use nginx with uwsgi or gunicorn
Aluma
hey, someone good with celery? I'm tryin to use Group to run jobs async I used this code example: http://docs.celeryproject.org/en/latest/userguide/canvas.html#groups the jobs runs job.apply() but I want to run it with job.apply_async().. and when I use job.apply_async() its blocks forever even when all the tasks done
Aluma
(it seems like the problem is that celery don't know that the job done)
Aslam
why do I get this warning message ? WARNINGS: ?: (urls.W002) Your URL pattern '/' has a route beginning with a '/'. Remove this slash as it is unnecessary. If this pattern is targeted in an include(), ensure the include() pattern has a trailing '/'. ?: (urls.W002) Your URL pattern '/add' has a route beginning with a '/'. Remove this slash as it is unnecessary. If this pattern is targeted in an include(), ensure the include() pattern has a trailing '/'. ?: (urls.W002) Your URL pattern '/edit' has a route beginning with a '/'. Remove this slash as it is unnecessary. If this pattern is targeted in an include(), ensure the include() pattern has a trailing '/'.
Aslam
if remoe that slash I not be able to open that url and got eror
Aslam
thats my code I just start learning django/ptyhon i've never code with python before
Aluma
it should look like this: articals.urls: url(r'^add$', views.articales_add, name='articales-add'),
Aluma
app.urls: url(r'^articales/', include(whatever)),
Aslam
I know that if django version 1.x I go urls but this a path not urls so how if I just used a path not url()
Aslam
btw i use 2.x django
Aluma
ah lel i don't upgrade yet to django 2. but it should work too as long as I know.
Aslam
so $ its mean / ?
Aluma
its a regex sign to "here the pattren end"
Aluma
'/' is not a path
Aluma
the path is everything after the slash, an empty path is just ''
inchidi
this one correct, what error you get from this code?
inchidi
the 'articles' should be 'articles/' tho
Aslam
'/' is not a path
so if in 1.x homepage or index will be r'$' so how i implement this index into a path instead of just a /
Aslam
the 'articles' should be 'articles/' tho
if articles/ what should I put in articles app whic is index like '/'
inchidi
Aslam
I have not try empty string I'll try now
Aslam
if you want to use regex in django 2, use re_path() instead path()
this very usefull but I think I'll try path first because I'm using 2.0 and deafult is a path 😁
inchidi
I have not try empty string I'll try now
as far as i remember, you can see note about that from newly generated urls.py at the comments at top of the file
Aslam
I've delete it my friend he
inchidi
its "/" or "" i guess
Aslam
solved now with emprty string for index and with ending slash of aticles/ thanks @inchidi @LummieX
inchidi
nice
Aluma
❤️
Aslam
can someone explain why / it's so important why not like laravel or other frameworks want to exist / or not. its doesnt matter
Aluma
thats how the http packet looks like
Aluma
GET / HTTP/1.1 when '/' means 'give me the home directory'
Aluma
GET HTTP/1.1 is not a valid http request. some frameworks mention this slash and some not. it's like, we all know that when you send a packet its always start with a slash, so it doesn't matter if you mention it or not.
Aluma
django says "its clearly that ill add it myself"
Aslam
thank you very much very helpful knowledge 😁
Aluma
❤️
Django Bot
>> Jobs - Senior Software Engineer
David
Hello, I have serialized to json my model with serializers.serialize('json', my_query, use_natural_foreign_keys=True) But my models have a datetime field, and when serialized, it gives me a format that contains the timezone in it. My question is: where do I format that field? In the query or with the serializer?
Django Bot
>> Jobs - Analytics Engineer >> Blogs - Building Modern Django Web Applications with React and Django Rest Framewor
Django Bot
>> Links - Django multitenancy using Postgres Row Level Security - Schinckel.net - How to Reset Migrations - Building Modern Django Web Applications with React and Django Rest Framewor - Using both Python 2 and 3 in Windows - Ultimate NGINX reverse proxy to WordPress / PHP / Python / Django / Golang - healthchecks.io - Monitor Cron Jobs. Get Notified When Your Cron Jobs Fail - Simple orderable menus for Wagtail - JSON-RPC in Python with Django - Jsonrpc – Django - Building a Remote Procedural Call (RPC) endpoint with the Django Rest Frame
Iman
Hello, I'm newbie in django and I wanted to know whats the best option for the web server of django I have read som docs and forums about the pros and cons of some of them but actually l'm confused somehow
Iman
Django offer to use mod_wsgi but I've heard that uWSGI or gunicorn with nginx is a good option too
Iman
And i wanted to know is there anyway to use django with LSWS too ?
Django Bot
>> Links - RoutablePageMixin URLs which include "." are not routable · Issue #3653 · w - custom django i18n backends PR - django-nose — django-nose 1.4.5 documentation - GitHub - bkjones/django-taxonomy: A django app to support whatever classifi - Techarena51.com - How to migrate your Blog from Wordpress to Django
Komang
And i wanted to know is there anyway to use django with LSWS too ?
Interesting lsws is alternative for apache, because apache big resource consuming
Komang
I will try to running lsws
Django Bot
>> Links - Django 2.0 Tutorial for Beginners - Testing with nose — nose 1.3.7 documentation - open-paperless: Scan, index, and archive all of your paper documents - python - Serving a request from gunicorn - Stack Overflow - Django REST Pandas
Iman
you can try bjoern with nginx
which one is better uWSGI or gunicorn ?
inchidi
which one is better uWSGI or gunicorn ?
i know this may be annoying but if you are new to this things dont think too much, just pick one and go. they both great and not hard to migrate from one to other.
inchidi
but overall, uwsgi somehow more configurable than gunicorn
Anonymous
well you don't have to configure much anyway
Anonymous
I'll suggest gunicorn and just forget
Anonymous
gunicorn support multiprocessing and greentlets
Iman
Thanks for your comments
Iman
I ran nginx with gunicorn and superviser running it
Anonymous
👍
Django Bot
>> Links - Django: Running management commands inside a Docker container | Abu Ashraf - Django Logging, The Right Way | Lincoln Loop - Copy-on-write friendly Python garbage collection – Instagram Engineering - Try Django 2.0 in your browser
Swarup
can't find view module on pycharm letest version?
Anonymous
Create one
Anonymous
When pycharm creates a new django project
Anonymous
It doesn't create a view.py file in the app of the project
inchidi
wew is that common? pycharm doesnt create those but django startapp does, doesnt it?
Anonymous
Nope
Anonymous
Actually pycharm does
Anonymous
But not django
Anonymous
😂
inchidi
really? lol never realize that