Stream

Join this community to post or comment
1
1
DjangoJobs.Net's profile photo
Add a comment...

Dragon Mana

Links & Videos  - 
6
2
John Thomas's profile photoJanis “JP” Apsitis's profile photo
Add a comment...
 
Hi everyone,
I'm learning django, and when I created a new model "Cliente", and I did a register on admin, but raised an exception.
exception: Cliente no has a object of urls

Anyone know something about this?

Thanks.
1
Douglas Mendes's profile photoVladan Grubešić's profile photo
11 comments
 
+Douglas Mendes Np, glad to help.
Add a comment...
 
django-meta vs django-seo2

Which one better for search engine optimization on site?
1
Add a comment...

A Maurice

Questions  - 
 
need help about this : I have two models

1- Class Pence
2- class Category:
pence= models.ForeignKey(Pence)

so I want a default category to be created on Pence object is creation

How can I do that. thanks 
1
Viktor Matys's profile photoA Maurice's profile photo
3 comments
 
thanks for your help. it worked...!
Add a comment...

Mr Young

Questions  - 
 
I'm building an app that I plan to use with Ubuntu 16.04, python 3.5 and Django 1.9. How should I best emulate this future state system? 
93 votes  -  votes visible to Public
Ubuntu 16.04 alpha/beta
29%
Ubuntu 14.04
34%
Ubuntu 15.10
25%
Other (comment)
12%
2
Martin Sand's profile photoMr Young's profile photo
11 comments
 
I'm building a proof of concept right now on a raspberry pi B+ running Debian Jessie. It actually performs pretty well. 
Add a comment...
1
Add a comment...
1
1
DjangoJobs.Net's profile photo
Add a comment...

Glenn Reed

Questions  - 
 
Are all these steps required to upgrade to a newer django version?

This is based on the answers I got from https://plus.google.com/u/0/107115930223467416941/posts/gKs9JjFgDdF

Based on my experience so far I have it down to these steps:

1. Backup your entire django database in case the whole process goes South (excuse the pun).

2. Make a copy of your project directory

3. In the folder copy create a new virtual environment. Install pip, python, etc and activate it.

4. Install all the packages dependencies with something like:
"pip install -r requirements.txt". Using something like pip uninstall remove django and then install the next django version upgrade.

5. Make a copy of the database for the new project. (Straightforward for sqlite3, a bit trickier for MySQL and probably also postgresql because now you need a different settings.py file. Lets hope we can do this without accidentally stomping on the wrong database.)

5. Try running django and find all 3rd party django package dependencies which fail. Upgrade those packages and re-test django.

6. Go back to the old project folder and old database.

7. Create yet another virtual environment for testing this upgrade on previous version of django. (Yeah, apparently we need to do this because migrations might fail otherwise.)

8. If upgrade is successful, (we're probably in the poo if it isn't) then run the model migrations (manage.py migrate)

9. Copy (or refresh) the database again for the new project with the old projects now including the new migration data.

10. Create another virtual environment for the new project, run migrations again on the copied database (just in case).

11. Re-test the new version of Django

Then of course there are additional steps that some say are very important like reading the release notes of every package you upgrade and not only the final version but every single intervening version of the package, even if there are a hundreds of them!! You also might end up looking inside django migration files just to make sure the database looks like what you think it is.

When I think of how wordpress upgrades are so much simpler, even with plugins, I am starting to wonder if the Django upgrade process is a bit over the top? Are there no streamline improvements that can't be made to this currently extremely lengthy and involved process?

1
Add a comment...

Glenn Reed

Questions  - 
 
Django Migrations make package dependencies scary!!

I am now taking Django 1.8 for a test drive by carefully upgrading an existing Django 1.7 project in a separate folder. I already got caught out once because in order to get it to work for Django 1.8 I had to upgrade some packages, specifically django-registration-redux and Django-guardian. The versions I used for django 1.7 didn't use migrations. Their upgrades did. This had interesting consequences with migrations because now suddenly migrations and other stuff failed. The migrations failed because they complained about pre-existing tables existing within the database. So in order to get around the problem I ran migrate with the --fake-initial command line option which is technically the wrong thing to do. Why? Well, how do I know if the database schema of the packages has changed between upgrades? I looked through the 0001_initial.py files for both packages and they don't have appeared to change. However I realised what a dicey process this is. I suppose the right thing to do would be to drop the tables that it complained were existing. This might work for a development or test database but am I really supposed to do this in a production environment? Or is there some very hard pedantic "best practices" position where Django 1.8 projects should only use django packages with migrations? To me this feels like an accident waiting to happen.

I suppose the contra argument would be that syncdb doesn't solve this problem either. You would still have to export the data from the table, drop it, run syncdb and then reimport the data. However, it some how seemed less daunting when things went wrong. I guess the problem is cheifly in going from non migration packages to migrated packages. Not staying in one domain or the other. Has anyone found a good strategy for coping with these in a production workflow?
2
1
Glenn Reed's profile photoMike Lee's profile photo
7 comments
 
Based on +Bas ten Berge 's answer, does that mean all django package dependencies need to be upgraded to latest versions before attempting to upgrade Django itself?  Is that the accepted best practice here?
Add a comment...

About this community

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

Hisham Najam

Questions  - 
 
Hi guys,

I am Serializing a form data using the form clean() method, before saving it to MongoDB.

My question is how to deserialize the data? Which form or field method should I overload?

1
Add a comment...
 
Hi,
I have a outdated django-cms version on my webserver. Now my website is ready to go online (after a long time). And I want to #update it. But I got only a lot of errors.

The I started a new test installation and try to keep it up to date. After update I got a lot of errors to (but others).

Is there a "simple guide" #howto keep a #django project (in that case #django-cms) up to date?
1
Martin Sand's profile photoDavid Hoffmann's profile photo
5 comments
 
Hi +Martin Sand,
sorry that I need so much time to answer. I don't know how to find the versions of the current installations. Now I found theese directories in the virtualenv directory:
- Django 1.7.3
- CMS 3.0.9

I know that I am using python 2.7.

+Iacopo Spalletti told me that I have to use some migrations. And I found this page: https://django-cms.readthedocs.org/en/develop/upgrade/3.1.html . I testet the first steps. And it might work. But to use some of this migrations manually for every update is not so user firendly .. I think .. 
Add a comment...

Ra Mänd

Newbies  - 
 
Yes, got my instance running. Also wrote down how I did it. Coming from Drupal and trying some Django. Have had interest in Python the same way I had interest in Drupal 5-7 years ago.
If you plan to use Python for your web backend then you might want to consider Django as there are many good libraries that you need for web development.
3
1
Matthew Usher's profile photo
Add a comment...
 
I don't know why this is not working.

It worked when I did it with previous versions of Django.
1
Cyril Kemalov's profile photoMartin Torre Castro's profile photo
2 comments
 
Thanks, but I knew already and I'm using the new package name
Add a comment...

VUTSAL SINGHAL

Questions  - 
 
Can anyone please direct me to tutorials regarding how to set up social login (especially Google auth2 or Google+) in Django 1.8. The tutorials that I got by basic Google search didn't help me much (maybe they are for previous Django version)
( I am a beginner by the way)
1
Sanjay Pradeep's profile photoVUTSAL SINGHAL's profile photo
2 comments
 
+Sanjay Pradeep thanks a lot
Add a comment...

Muhammad Ahmed

Questions  - 
 
Which is Django "Long Term Support" version this time? 
1
Sanjay Pradeep's profile photoMuhammad Ahmed's profile photo
8 comments
 
Thanks +Sanjay Pradeep 
Add a comment...

John Brasher

Discuss & Suggestions  - 
 
Django Unleashed by Andrew Pinkham is the book I wish I'd had earlier last year.

If your a beginning or intermediate Django user you should look into this book.

The author takes you through a complete build of a website while holding your hand from beginning to end.
I especially liked the links to the github source code so you can see exactly what the code looks like at that specific point.
When your going along and your entering code and it doesn't work exactly like it should this gives you a way to see the "correct answer"
and help you find those misspelled keywords/variables.

I also very much like how the author walks you through basic code which works just fine and then shows you how to refactor the code to make it even better and more DRY (Don't Repeat Yourself).

This book uses Django 1.8 (and you should too, for this book) but the author also identifies differences between 1.8 and earlier versions, things that have caused me problems in the past.

At over 800 pages this is the best tutorial on Django I've found and I'm enjoying it immensely.

I hope you find Django Unleashed as useful as I am.

http://www.informit.com/store/django-unleashed-9780321985071
8
2
Gavin Swanson's profile photoJorge Alberto Díaz Orozco's profile photoAhmed Sheipani (Shumbashi)'s profile photoMatthew Usher's profile photo
2 comments
 
Would love to have it
Add a comment...
 
So I am working on a noticeboard app in django.
I have two models...the Board and the Notice models.
A board can contain many notices 
A notice can be added to one or more boards.

I can see the notices and the boards, how do I go about accessing the notices posted under a particular board?

Please check my models, if there is a way to make it better..I am open to any advice.
2
Bernard parah barje's profile photoMr Young's profile photo
5 comments
 
The tutorial on the Django Project site goes over your design pattern almost exactly. Check that out
Add a comment...
 
Django Manger VS QuerySet?
1
Add a comment...
 
 
Learn Python Programming!
Subscribe, Share and Support!
#python #tutorial  
2
Add a comment...