Ronald
Did anyone else find Django Rest Framework to have quite a tough learning curve? I learnt Django quite quickly 2 years ago and I’ve been developing with it for some time now. I’m now learning React for frontend and I’d very much like to use DRF to serve my backend api, but dang it’s got quite a learning curve I feel.
Ronald
maybe I should just get past the learning curve. haha
Guilherme Kenzo
eeehhh.... I guess, if you already know Django, learning DRF is just a piece of cake... 🤔 when I discovered DRF, I learnt it in 2 days or so
Well, I started with drf with no previous knowledge of django and found that the documentation (from both projects) were sufficient for a beginner
Guilherme Kenzo
Well, I started with drf with no previous knowledge of django and found that the documentation (from both projects) were sufficient for a beginner
A beginner to django, that is. I think that the concepts of rest apis might be weird for someone that is not used to them
cj
2 days? 😏
yes, I found DRF back in 2013 if I'm not wrong it took me 2 days or so to learn it, it's not that's hard
cvam
A question ) why there is always a change in syntax when update the version of python it will create a mess in the future and and lots of struggle . why
Mirco
A question ) why there is always a change in syntax when update the version of python it will create a mess in the future and and lots of struggle . why
In py2 you can use __future__ module to use "future" syntax , so when you upgrade the version you won't have the mess you're talking about And there's 2to3 that can help ya so much
F.
In py2 you can use __future__ module to use "future" syntax , so when you upgrade the version you won't have the mess you're talking about And there's 2to3 that can help ya so much
Wish there was a syntax change software or executable for django especially when updating to a new version of django or even downgrading to test out some ancient feature or reusable app. If the devs at django can do this, I believe even google would be tempted to change their entire backend.... To django of course🙂
Anonymous
Anonymous
which link?
https://docs.djangoproject.com/en/2.0/intro/
inchidi
oh okay
Anonymous
oh okay
👍
F.
On official docs you always find a section to upgrade without much pain
Think of an upgrade from Django==1.8.5 to Django==2.0
Mirco
Think of an upgrade from Django==1.8.5 to Django==2.0
Yeah I know I was trying at United Nations to upgrade from 1.8 to 1.11 and it wasn't so easy
inchidi
2
then dont worry, i think you just took wrong tutorial
F.
Yeah I know I was trying at United Nations to upgrade from 1.8 to 1.11 and it wasn't so easy
u see ..... I can begin to imagine my case. backwards compatability should be made a tradition in every language out there...... another priceless feature that makes GIT so successful. IMHO ..... django makes the work of upgrading purposely difficult and discouraging. In a way it makes the latest stable releases of django so much less interesting or exciting. If there was backwards compatability in django, every release would be another exciting story to tell. Look at JavaScript. That one's almost a sad story. There are programs that do a lot of checks and syntax adjustement for older code to be run on newer compilers. All this really basically exist because of lack of backward compatability If any of you guys know a language that's loyal to their origins but at the same time has room for improvement, please let me know. All this syntax upgrade and frustrating hours refactoring just because of a new version isn't where we shoould be in the 21st Century. Some might see me as a lazy developer. Aren't we all that way? If we weren't we'd be wix.com developers.... 😂😂
cvam
inchidi
It was the official docs 😢
you learnt python 2 from official docs 2 years ago?
R
u see ..... I can begin to imagine my case. backwards compatability should be made a tradition in every language out there...... another priceless feature that makes GIT so successful. IMHO ..... django makes the work of upgrading purposely difficult and discouraging. In a way it makes the latest stable releases of django so much less interesting or exciting. If there was backwards compatability in django, every release would be another exciting story to tell. Look at JavaScript. That one's almost a sad story. There are programs that do a lot of checks and syntax adjustement for older code to be run on newer compilers. All this really basically exist because of lack of backward compatability If any of you guys know a language that's loyal to their origins but at the same time has room for improvement, please let me know. All this syntax upgrade and frustrating hours refactoring just because of a new version isn't where we shoould be in the 21st Century. Some might see me as a lazy developer. Aren't we all that way? If we weren't we'd be wix.com developers.... 😂😂
I don’t see it as such a big problem and think django developers take lot of care about backward compatibility... anyways, you can just have your test suite and run it with tox for example to try that everything works on new versions before pushing changes to production, even, my point of view is that if there was a bad design decision or some big improvement that can be solved by creating a new version with backward incompatible changes but with significant improvements to the software as for example happened with channels, py2 to py3 or lets say django urls to path, it should be welcome and seen as good news from a developer point of view as not doing it just makes you keep having a worse language/framework/library to develop with
F.
Everything that is changed is properly documented, if you upgrade ur version regularly, there is almost no changes you have to do in ur source, even you can see what will be deprecated in next versions https://docs.djangoproject.com/en/2.1/internals/deprecation/
I'm just 6 months old in django. I'm sure with time, my negative notions and misinterpretations would be relatively corrected. But all the resources shared here are valuable. Very valuable.
R
https://www.aeracode.org/2018/02/02/channels-20/ read this for example, he explains why backwards incompatible changes were needed for django channels, and how much he tried to avoid it, etc
F.
There were more resources and books available for 1.8 and scarce resources for the latest version as at that time. There's an abundance of 1.8 material. 1.8 was basically the best material wise to learn from. With time.... seeing the difference between 1.8 and 2 makes an upgrade at all look like a mountain
Anonymous
I use non-english characters in my urls (other language) Browser shows urls correctly For example mysite.com/store/<other language> But when I email a url or print url in console it's wrong and like mysite.com/store/%D9%BE%D9%86 How can I solve this? I have no idea What should I search for
Anonymous
Maybe serialising issue
Anonymous
I can solve it like this But it's just a trick. List = url.split('/') And join items of list except last one. For last one I use slug that I have to make the url and email or do what ever with that string But as I said it's not a solution. It's a trick
Anonymous
Is there any updated django tutorial site in 2019
cj
Is there any updated django tutorial site in 2019
https://docs.djangoproject.com/en/2.2/intro/tutorial01/
cj
thank me later 🙂
Anonymous
Thanks Brother
Akay
Anyone tell me that how can i fully customise django admin like a good CMS. For instance like charts, navigation something like WordPress.... One other thing that for this purpose default admin work after customise or i have to write myown admin panel.
Doug
Wagtail was ok but not right
F.
Wagtail was ok but not right
what's wrong with wagtail? I'm curious... Currently learning django-cms
Doug
I just didn't like how it functioned. It seemed to be better for a small site and I needed something different.
Doug
Older version, it was probably 6 months ago when I evaluated it.
F.
hmmmmm... still looks pretty recent to me
Akay
I wanna make a side for general people to collect their data and calculated for them.... And side by side blog to content marketing stuff... Expected Traffic is High and the data is also kind of person type like money, tax or share market related
Ronald
I've been playing wagtail for some time now cause I thought of using it for a client's site as he wanted to be able to post articles etc. It works, but I'm just not too fond of the post editor.
Ronald
So I'm contemplating installing Ghost on the side and just pull the posts via its api to the django site.
R
But which one you used?
R
Im using StreamField and personally I find it amazing, I can give so many options to content editors such as multiple rows, carousels, card lists, etc
Ronald
But which one you used?
Oh I used rich text field. Will try out streamfield shortly
R
Basically, inside StreamField ur content editor can use as many RichTextFields as he wants combined with other Blocks that you have defined and styled for him
R
Although I dont like to give editors so much ‘power’ to get decisions regarding the design and content structure, to get an idea of how powerful is StreamField, I think is worth taking a look to CoderedCMS to see how they managed to allow the editor to use all bootstrap components via StreamField https://github.com/coderedcorp/coderedcms
syedj
Django" invalid http host header you need to add ip to allowed host"
syedj
If i put my ip in allowed host its working fine
syedj
I have to add it in my docker container.
syedj
In Vm
syedj
What shouldn be in allowed host in this case
syedj
Not working with 0.0.0.0:8000
Anonymous
Not working with 0.0.0.0:8000
try adding localhost
syedj
try adding localhost
Not working tried localhost also
syedj
Tried putting * in allowed host
Anonymous
I'm using CreateView to create a post Django.views.generic.edit.CreateView How can I make a field optional?
Mirco
I'm using CreateView to create a post Django.views.generic.edit.CreateView How can I make a field optional?
make the field into your Post model blank=True or your Form field required=False it depends on how you are handling it
Mirco
I'm using CreateView to create a post Django.views.generic.edit.CreateView How can I make a field optional?
https://docs.djangoproject.com/en/2.2/ref/forms/fields/#required one reference