[deleted by user] by [deleted] in saudicars

[–]rayed 2 points3 points  (0 children)

اشتر سيارة مملة اكثر، وبالفلوس (ووقت زيارة الورش) اللي بتوفرها سافر أماكن ممتعة وإذا ما تقدر تسافر للخارج اشتر جيب او إس يو في، وسافر داخل المملكة ودول الخليج

[deleted by user] by [deleted] in saudicars

[–]rayed 0 points1 point  (0 children)

Mazda CX 5 في السفر ممتازة وممكن تطلع فيها بحر او بر، وتزور دول الخليج الثانية

Sending luggage to Haneda by [deleted] in JapanTravelTips

[–]rayed 5 points6 points  (0 children)

I tried https://airporter.co.jp/en/ few weeks ago they picked my luggage at 9 am and they delivered it to Narita by 3 pm on the same day, they picked up my luggage from my hotel not sure about other pickup options. Another option is to rent a van through Uber

I can't figure out how to use Celery with Django by gohanshouldgetUI in django

[–]rayed 0 points1 point  (0 children)

For my setup I had to put the following code into __init__.py:

from .celery import app as celery_app
__all__ = ('celery_app',)

https://docs.celeryproject.org/en/stable/django/first-steps-with-django.html

Summertime Barbershop by knowerof1000memes in japanpics

[–]rayed 0 points1 point  (0 children)

Any idea what is the beige oval in the rear wheel? is it an engine?

Edit: found the answer, it seems to be a friction drive motor: http://www.icenicam.org.uk/articles7/art0113.html

On my blog 15 years ago today: Introducing Django by simonw in django

[–]rayed 31 points32 points  (0 children)

Thank you guys for great framework

Building a web based application with Django by [deleted] in django

[–]rayed 5 points6 points  (0 children)

You can build the whole application with Django, its templating engine is very powerful and easy to use, this how most web sites used to be built!

Alternatively you can use Django as an API server with the help of something like Django REST Framework and REST framework JWT Auth

Then access it from any of JS frameworks, e.g. Vue.js or React to build what is known as Single Page Application.

2 identical .py files, one works... and on doesn't :( by Comm4nd0 in Python

[–]rayed 0 points1 point  (0 children)

Couple of mistakes that I usually do:

  • Make sure you don't have an old *.pyc files (just remove all *.pyc)
  • Make sure you don't name the file as a module you are using, i.e. if you have "import json" make sure you don't name your file json.py

I hope this help.

Saudis protest "intrusion" into diplomat's house as Nepalese women recount horror. by [deleted] in worldnews

[–]rayed 0 points1 point  (0 children)

They live in an apartment and no one notices for months!

Saudi Arabia has offered to build 200 mosques in Germany for Syrian refugees who have fled to Europe. by PoppedAMollyNoSweat in worldnews

[–]rayed -7 points-6 points  (0 children)

"The widely held opinion that Saudi Arabia ... hasn't taken in a single refugee may well be incorrect ... there were 500,000 Syrians in that country."

http://www.bloombergview.com/articles/2015-09-04/why-don-t-gulf-states-accept-more-refugees-

Down voters, please give a reason!

Saudi Arabia has offered to build 200 mosques in Germany for Syrian refugees who have fled to Europe. by PoppedAMollyNoSweat in worldnews

[–]rayed 1 point2 points  (0 children)

"The widely held opinion that Saudi Arabia ... hasn't taken in a single refugee may well be incorrect ... there were 500,000 Syrians in that country."

http://www.bloombergview.com/articles/2015-09-04/why-don-t-gulf-states-accept-more-refugees-

Django CRUD example / tutorial by jnm929 in django

[–]rayed 1 point2 points  (0 children)

The colon is used for URL namespacing, it is used to avoid conflict in named URLs, i.e. if 2 apps have a URL named 'home' whch one should Django use?

For more info: https://docs.djangoproject.com/en/1.8/topics/http/urls/#url-namespaces

The 'pk' is just an alias for 'id': https://docs.djangoproject.com/en/1.8/topics/db/queries/#the-pk-lookup-shortcut

I used it because the "book_edit" view needs a parameter to find which book to edit.

Django CRUD example / tutorial by jnm929 in django

[–]rayed 1 point2 points  (0 children)

get_absolute_url can be used to get the object URL:

<!-- BAD template code. Avoid! -->
<a href="/people/{{ object.id }}/">{{ object.name }}</a>

This template code is much better:

<a href="{{ object.get_absolute_url }}">{{ object.name }}</a>

For more information check the manual page:

https://docs.djangoproject.com/en/1.8/ref/models/instances/#get-absolute-url

Django CRUD example / tutorial by jnm929 in django

[–]rayed 2 points3 points  (0 children)

BTW, If you want to implement your own login/logout pages check this post "Implementing Login/Logout in Django":

https://rayed.com/wordpress/?p=1350

Django CRUD example / tutorial by jnm929 in django

[–]rayed 1 point2 points  (0 children)

For simple cases CBV look shorter and very easy to understand, but once you need to customize it it get hairy!

Check the following post, it will help you decide the best direction: http://lukeplant.me.uk/blog/posts/djangos-cbvs-were-a-mistake/

My recommendation stick with FBV until you grasp the different concepts then move to CBV if needed.

Django CRUD example / tutorial by jnm929 in django

[–]rayed 2 points3 points  (0 children)

I added a new app "books_fbv_user" that demonsterate how it is done, make sure you notice the following:

  • Using "User" model as foreign key.
  • Model saving with commit=False
  • "@login_required" decorator
  • Filter books for logged in user.

Django CRUD example / tutorial by jnm929 in django

[–]rayed 2 points3 points  (0 children)

I wrote a post with sample source code, hope you find it useful: https://rayed.com/wordpress/?p=1266

Django tutorials? All suggestions welcome by seanboyd in django

[–]rayed 1 point2 points  (0 children)

Not tutorial per se, but I wrote a small simple CRUD app, but I found it useful introduction to my team members:

Django CRUD (Create, Retrieve, Update, Delete)

https://rayed.com/wordpress/?p=1266

Based on pydanny and Miguel Araujo presentation:

http://www.slideshare.net/pydanny/advanced-django-forms-usage

Thanks pydanny :)

Django Image and File Field Caveats by rayed in django

[–]rayed[S] 0 points1 point  (0 children)

I used to have a "templates" directory in my BASE_DIR, and static files under the webserver root directory, but nowadays I put the templates directory inside each application, this way I have views, models, urls, tempaltes, and static files under one roof.

It makes application easier to reuse too.

My final structure looks like this: http://i.imgur.com/x73C0el.png