Stream

Join this community to post or comment
 
I am trying to merge two web sites together. One is django, the other is cgi perl. I want to use django's auth system.

Can I exec the cgi program from inside django and return the output as a page? What about cookies, posted value and doc headers?
1
Jose Galvez's profile photoStuart Holliday's profile photo
6 comments
 
+Jeremy Mordkoff depends exactly what the thing is doing. Googling for authentication microservices shows it is a relatively common problem with several (complex) solutions. It doesn't look like django makes things easy. You may be able to just have the django pass on the request and response, inefficient as this is - I.e. add URL handler, use requests to get the result from Perl, then return the result. 
Add a comment...
 
Hi! I have trouble with Django table inheritance =(
Fo example we have base concrete model Place and child Restaurant.
From 'place' object we can get restaurant by place.restaurant (as mentioned in documentation).
What if we have also Pub, Bar children with multi-table inheritance?

And problem: we have model Waiter with relation on Place. How we can get all concrete 'places' (Restaurant, Pub, etc) from 'waiter' object (ex. our waiter can work in few places :)). Can we cat model names of those children from waiter object?
Models¶. A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you're storing. Generally, each model maps to a single database table. The basics: Each model is a Python class that subclasses django.db.models.Model .
1
John Dean's profile photoMaksym Mospanenko's profile photo
7 comments
 
I created two properties for filtering by attribute existing (hasattr). In meta we don't have any information because fk on base model.
Thank you for help =) It helps me
Add a comment...

James Ellis

Newbies  - 
 
Udemy Coupon 40% Learn Web Programming in Django and Python Building Projects and Websites
3
Add a comment...

Yasser Shah

Discuss & Suggestions  - 
 
Real Time Cool Django Web Development, Live Now https://www.livecoding.tv/taddeimania/
17
5
Benjamin Perez's profile photo
 
great!
Add a comment...

Anurag Jain

Links & Videos  - 
 
Sitemap is a very important piece of information for any website which help search engines index your website. Generating sitemaps is pretty easy for a static website, but not so easy for dynamic views.
There is a good news for django users as django has built in sitemap generation framework which makes this task very easy. Read this article to know how to generate sitemaps for your django app
http://bookofstranger.com/implementing-sitemaps-in-django-for-dynamic-and-static-urls/
Sitemap is a very important piece of information for any website which help search engines index your website. Its a simple XML file having information about all the urls of your website with prior…
8
Add a comment...
An accurate, keyword-rich description about 150 characters
6
1
Add a comment...
 
Many want to learn Django REST Framework because REST seems to be the cool new thing. Why SHOULD you want to learn REST?
5
Mohamed Kawia's profile photoDouglas Mendes's profile photo
3 comments
 
course is very useful. I like it. Thanks +Chris Bartos .
Add a comment...

Sofia Kelly

Links & Videos  - 
 
Learn Python Django From Scratch
Udemy Coupon 30% Learn Python for the web with this in-depth Python Django course.
6
1
Add a comment...

Cristian Vasta

Off Topic  - 
 
Coding for Entrepreneurs: Learn Python, Django, and More.
#python #Django
Udemy Coupon 31% A Programming Class for Non-Technical Founder(s). Learn Django- the #1 Python Frameworks, APIs, HTML, CSS, + Payments.
6
Add a comment...

Mr Young

Questions  - 
 
Hi all. I'm running Django 1.8 from virtualenv, and I'm trying to call a module from a shell script. How do I access Django modules in a virtual env from outside it?
3
Darrick Allen's profile photoMr Young's profile photo
8 comments
 
Thanks +Darrick Allen​
Add a comment...

About this community

The Web framework for perfectionists with deadlines. www.djangoproject.com

John Dean

Questions  - 
 
 
Ok, need help. What is your preferred way of setting up your template directory or directories?

I have read Two Scoops and Tango With Django both have a different way of doing it. My project will have like 15ish apps that will be plug-able for other projects.

Please select 1 or leave a comment about other ways you'd go about it.

Thanks for you help!
54 votes  -  votes visible to Public
project_root/templates
26%
project_root/app/template/
44%
project_root/app/template/app
30%
1
Thomas Krüger's profile photoMax Seifert's profile photo
4 comments
 
+Daniel Quinn I tend to do stuff like
"project_root/app/template/<prefix>_base.html" to avoid name conflicts. Still, I strongly agree with +Thomas Krüger , as he provides really good explanation on usage and semantics.
Add a comment...
 
Instagram currently features the world’s largest deployment of the Django web framework, which is written entirely in Python. We initially…
4
2
Add a comment...

Sofia Kelly

Links & Videos  - 
11
2
Benjamin Perez's profile photo
 
great! Thanks
Add a comment...
 
 
You anyone looking for a python/django job? 100% remote! Give me a shout!
1
Add a comment...
 
 
After reading django tutorial I decided to create a small registration app for my church's youth program.

I have 4 models.

Zone - name and address
Area - name, address and zone(foreign key)
Parish - name, address and area(foreign key)

Every parish is under an area and every area is under a zone but there names aren't unique.

Attendance - zone, area and parish (foreign keys) and other fields.

I created a form with the Attendance model which will be used for registering people.


The problem now is when the page loads, drop down box for zone, area and parish are all filled with values in database but what I want is that after page loads only zone drop down box should be filled and after selecting a zone the drop down box for area should be filled with only the areas under that zone. If the zone is changed, the area drop down box should also refresh to load only areas under the new zone. Same thing should happen for parish drop down box.

The reason I want to do it that way is so as to eliminate mistakes which can be made i.e selecting a parish which belongs to another area or an area which belongs to another zone.

How can I achieve this? I'm using django model form instead of writing the html code for the form manually.


Thanks.
2
Mattia Procopio's profile photoEmmanuel Akinpelu's profile photo
15 comments
 
+Mattia Procopio I'll take a look at it. What about the form? How can I dynamically give the form a model since the form will have to use different models for different programs or I'll have to write my own html codes instead of using django forms?
Add a comment...
 
Hi... everyone... i am new at django.. and i am having no idea how to implement a add to cart facility in my project.. of a normal ecomm... please help me..
1
Vikas Sharma's profile photo
8 comments
 
I will definitely 
Add a comment...
 
Hello.

To our interesting project at #Google we are looking #python/#django developers with strong algorithmic skills. Also we are hiring #java (back-end) and #javascript (front-end) developers.

Possible locations of Google offices for these positions: #Poland and #Czech Republic.

If you feel yourself as strong petson who will pass the interview - feel free to contact me to start interview process.
2
Add a comment...

Cody Jack

Links & Videos  - 
 

Never coded before? No problem. We've worked with over 120,000 students just like you.
Udemy Coupon 31% A Programming Class for Non-Technical Founder(s). Learn Django- the #1 Python Frameworks, APIs, HTML, CSS, + Payments.
5
Add a comment...

Douglas Mendes

Questions  - 
 
Hi Everyone!
I want know, how to build a application with django and angularjs. How can i integrate a frontend so beautiful and fast with angular, and a clear code and easily understandable framework based on python that is django. I hope that my colleagues of community can indicate me a web site when have any tutorial or ebook for this.

Thanks.
3
Chris Bartos's profile photoDouglas Mendes's profile photo
5 comments
 
thanks everyone. I'll try your recomendations.
Add a comment...

Anurag Jain

Links & Videos  - 
 
Optimizing database queries is one of the most important ways to reduce load on your database server and also speed up the website
Check out this post to know various methods to achieve the same
http://bookofstranger.com/optimizing-django-orm-queries-for-best-performance/
12
Add a comment...