Re: Automatic subdomain for each user

2021-12-29 Thread Tim Chase
On 2021-12-29 15:02, Sherif Adigun wrote: > I am faced with a requirement where each user is required to use > the application under his own subdomain. Whenever a user registers, > he gets username.domain.com and he can add staff, manage reports, > etc under his subdomain. > > What is the best

Re: How can I scale my application to different teams ?

2021-11-30 Thread Tim Chase
On 2021-11-30 02:11, Kumar Gaurav wrote: > How Can I group the users and show the contents related to them > only. You presumably have some sort of User model and have added some sort of Group model. Depending on your business logic, either a User can belong to one-and-only-one group in which

Re: can Django replace PHP ?

2021-06-28 Thread Tim Chase
On 2021-06-27 21:20, Krishna Adhikari wrote: > *can we solve all kinds of web application problems with Django > without learning PHP ?? * > *or PHP also recommended.* For just about aspect, either they're interchangeable, or I find that Python/Django wins (readability, library consistency,

FastCGI with recent Django?

2020-12-13 Thread Tim Chase
At one point in history long past, Django 1.8 supported FastCGI via flup https://docs.djangoproject.com/en/1.8/howto/deployment/fastcgi/ but it was slated to be removed in 1.9 and there seem to be no further docs I can disinter about running Django in a FastCGI environment (all other resources I

Re: Hosting

2019-05-25 Thread Tim Chase
On 2019-05-24 23:19, Prakash Borade wrote: > Friends tell me is hostgator.in server support django or not. Hostgator used to be a decent company until they were bought out by EIG, a parent company with a reputation of buying up good hosting companies and turning them into a bucket of suck. They

Re: 1 project, X app = X subdomains (Django, Apache)

2019-05-23 Thread Tim Chase
On 2019-05-23 06:22, Jakub Jiřička wrote: > I want to ask you if someone has solved how to prove that is > possible the applications in one project run in different > subdomains? > > I have 1 project (projekt.cz) and provide of 3 applications (app1, > app2, app3) and I would like to get on my vps

Re: Website slowed down drasticaly

2019-05-06 Thread Tim Chase
On 2019-05-06 00:20, Saurabh Adhikary wrote: > The point is , there are no major change that was deployed on to > the code since Dec'18. > As I did mention that there has been some minor load increase of > our users in the new year since Jan, but the change is not > significant. (Originally we

Re: Wich OS for develop?

2018-01-02 Thread Tim Chase
On 2018-01-02 22:23, Julián Melero Hidalgo wrote: > Wich OS is better to develop with django? Ideally, develop on the same platform you plan to deploy on. If you don't want to develop on the same platform, the closer you are to your development platform, the easier time you'll have of it. So if

Re: Decrypting Password

2017-12-14 Thread Tim Chase
On 2017-12-13 23:08, hardiksara...@gmail.com wrote: > I want to decrypt the encrypted the password formed in django is > there any way please help me It's considered a bad (horrible, really) security practice to store passwords that you can retrieve. I'll grant that some of the Mailman lists

Re: Enable https for a production django application

2017-12-06 Thread Tim Chase
o be a viable option for free certs before Let's Encrypt but now there's really no reason to have self-signed certs. -tkc On 2017-12-04 07:57, Tim Chase wrote: > On 2017-12-04 01:15, BIJAL MANIAR wrote: > > Do we need to purchase SSL certificate? Any links on that would be > >

Re: Enable https for a production django application

2017-12-04 Thread Tim Chase
On 2017-12-04 01:15, BIJAL MANIAR wrote: > Do we need to purchase SSL certificate? Any links on that would be > helpful. There are two types of cert: DV ("Domain Validation" merely lets you know that you're securely talking with the domain you think you are) and EV ("Extended Validation" where

Re: Hosting a django/python website/web app

2017-11-03 Thread Tim Chase
On 2017-11-03 09:20, Basilaik wrote: > I have completed my my website using django/python, and got a > hosting account with hostgator, i tried uploading it to the cpanel, > but i dont know how to do the configuration. > has any one ever hosted a website done with django on cpanel? While I've not

Re: ValueError: invalid literal for int() with base 10:

2017-07-26 Thread Tim Chase
On 2017-07-26 11:52, Alexander Joseph wrote: > "*ValueError: invalid literal for int() with base 10:*" after I > made a field in my models.py a ForeignKey. Below is my models.py The problem lies in this line: > new_invoice_num = int(last_invoice_num) + 1 For some reason

Re: sqlite3 database encrytion for Django.

2017-05-08 Thread Tim Chase
On 2017-05-08 18:26, Melvyn Sopacua wrote: > > What would you gain by encrypting it? > > Three things: > 1) If the file gets deleted, Django does not recreate it with that > mode. Solvable by using a dedicated directory instead of the above. I'm not sure I see this as a benefit, but if rogue

Re: sqlite3 database encrytion for Django.

2017-05-06 Thread Tim Chase
On 2017-05-05 11:51, agajesh...@atompower.com wrote: > I want to encrypt my sqlite3 database such that it cannot be > accessed without a key. I came across "sqlcipher" tool which > provides encryption for sqlite3 database, but I couldn't find > enough support to make it work from django. > > It

Re: Link to download

2017-05-03 Thread Tim Chase
On 2017-05-02 19:11, Antonis Christofides wrote: > response = HttpResponse(csvfile.read(), content_type='text/csv') Beware that, if your content can get huge (some of our reports can run to hundreds of megabytes), you might want to investigate something like the "sendfile" alternatives or spew it

Re: Postgres SQL vs SQLite vs MS SQL vs MY SQL

2016-12-22 Thread Tim Chase
On 2016-12-22 03:56, NoviceSortOf wrote: > Our DB requirements though are complicated by the need to work with > Asian languages, Chinese, Japanese and so on as well as European > languages. If you are genuinely interested in MS-SQL Server, I would spin up a simple test server and bang against

Re: Drawing with Django

2016-11-13 Thread Tim Chase
On 2016-11-13 21:55, ludovic coues wrote: > It's barely related to django. > > If all you want is to make annotation, it's fairly easy and you > don't really need canvas and it's mainly javascript, which is > independent from django. > First, display your image. Moreover, this sounds like a

Re: Using version control with django

2016-08-23 Thread Tim Chase
On 2016-08-23 12:42, Rich Shepard wrote: >I want to track django projects with subversion. (Single > developer, local, so svn is better suited than the distributed git > and mercurial.) I used subversion both as a solo developer and as part of a team, and have migrated to a DVCS for both

Re: Why does Django allow Circular Model Relation

2016-02-19 Thread Tim Chase
On 2016-02-19 07:29, Eddilbert Macharia wrote: > Hello vadim when would such a relationship be needed I'm curious Think of a hierarchy at a company. Most employees have a supervisor. So your table would reference the supervisor in the same table: class Employee(models.Model): name = ...

Re: reading CSV file with non ASCII characters

2016-02-06 Thread Tim Chase
On 2016-02-06 03:06, elcaiaimar wrote: > import unicodecsv as csv > > csvfile=open("mediosdigitales.csv") > > reader = csv.DictReader(open("file.csv", "rb")) > reader = csv.reader(csvfile, encoding='utf-8', delimiter=',') > for row in reader: > titulo=row['titulo'] > pais=row['pais'] >

Re: how do I .............?

2016-01-13 Thread Tim Chase
On 2016-01-13 10:43, Steve Burrus wrote: > how do I connmect to the Django server on the command line? You can use a command-line browser: lynx http://localhost:8000 links http://localhost:8000 elinks http://localhost:8000 links2 http://localhost:8000 w3m http://localhost:8000

Re: Input using barcode scanner

2015-12-04 Thread Tim Chase
On 2015-12-04 07:14, Akash Tomar wrote: > I want to take input in my html page using the barcode scanner. How > do i do this in django???..do i need some additional module or > package to do so?..or django itself is strong enough to do > that...please help me with a sample code for implementing

Reducing redundancy in tests, logged-in vs. not-logged-in

2015-11-16 Thread Tim Chase
Are there best practices for writing tests where every case has a "not logged in" and a "logged in" pairing? I'm finding myself writing too much redundant test-code where the only difference is whether the user is anonymous (and thus the test should fail) or logged in with appropriate rights (and

Re: following 302s in WebTest form.submit() (was Best practices for writing functional tests to exercise forms?

2015-11-13 Thread Tim Chase
On 2015-11-13 10:22, Carl Meyer wrote: > As far as I know, you have to call `.follow()` on the response, > which follows the redirect and returns the next response. Is that > what you mean by "manually follow every redirect"? It's manual in a > sense, but there is a convenience method to make it

Re: following 302s in WebTest form.submit() (was Best practices for writing functional tests to exercise forms?

2015-11-13 Thread Tim Chase
On 2015-11-09 12:41, Tim Chase wrote: > On 2015-11-06 01:09, Carl Meyer wrote: > > [1] https://pypi.python.org/pypi/WebTest > > [2] https://pypi.python.org/pypi/django-webtest > > Just to follow up, django-webtest has been pretty much exactly what > I was looking for. T

Re: Best practices for writing functional tests to exercise forms?

2015-11-09 Thread Tim Chase
On 2015-11-06 01:09, Carl Meyer wrote: > [1] https://pypi.python.org/pypi/WebTest > [2] https://pypi.python.org/pypi/django-webtest Just to follow up, django-webtest has been pretty much exactly what I was looking for. Thanks! -Tim -- You received this message because you are subscribed to

Re: Best practices for writing functional tests to exercise forms?

2015-11-08 Thread Tim Chase
On 2015-11-06 01:09, Carl Meyer wrote: > I recommend the WebTest package [1], along with django-webtest [2] > to adapt it for use with Django. > > [1] https://pypi.python.org/pypi/WebTest > [2] https://pypi.python.org/pypi/django-webtest Thanks for your suggestions, Carl. I'll check them out as

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Tim Chase
On 2015-11-04 18:39, Gergely Polonkai wrote: > An even more fine grained solution may be using an HTML parser like > beautifulsoup. However, if your site's functionality depends on > client side features like JavaScript, Selenium may be a better > alternative. My code doesn't rely on any

Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Tim Chase
Beginning a new project, I'd like to include functional testing in addition to my unit tests. What are recommended best practices for exercising form-classes? I was hoping to do something like c = django.test.Client() results = c.get(page_url) frm = SomeForm() # pseudo-code for desired

Re: Django deployment

2015-09-15 Thread Tim Chase
On 2015-09-15 22:02, Michiel Overtoom wrote: > > I keep hearing that Django deployment is unnecessarily > > difficult. > > Who says this? And what are the reasons they give for it? I wouldn't say it's *unnecessarily* difficult, but compared to "dump a pile of PHP files on your FTP site", it's

Re: What I need to know to be a Django full stack developer?

2015-09-04 Thread Tim Chase
On 2015-09-04 12:21, Luis Zárate wrote: > I don't know why I was thinking that a Django full stack developer > was a Django hacker o guru that know a lot of things related with > Django, but now I am disappointed about this term. The stack is the layers between the hardware and the end user. For

Re: What I need to know to be a Django full stack developer?

2015-09-04 Thread Tim Chase
On 2015-09-04 19:37, Arindam sarkar wrote: > On Fri, Sep 4, 2015 at 9:29 AM, Luis Zárate wrote: >> what I need to know to be a full stack developer? > > 1. Python > 2. Django > 3. html At this point, you should have a working dev-server up and running 3.3 Apache/nginx/gunicorn/etc (web server

Re: utf-16le encode generic view object_list

2015-05-21 Thread Tim Chase
On 2015-05-21 13:04, JHeasly wrote: > I've got a function-based generic view that I want to return a > utf-16le encoded response (for use as an InDesign tagged text file; > the utf-16le is what InDesign wants). I've got it working here > , but

Re: Two types of users, how would I authenticate them?

2015-05-09 Thread Tim Chase
On 2015-05-09 15:52, Tom Evans wrote: > I would simplify things, have just one type of user, who can be > associated with 1:N companies and 1:N schools. A user is an employer > if they are associated with at least one company, and a user is a > student if they are associated with at least one

Re: JSON data

2015-05-07 Thread Tim Chase
On 2015-05-07 22:32, Thorsten Sanders wrote: > Am 07.05.2015 17:37, schrieb Tim Chase: >> Can you provide sample JSON data that others can use >> for testing? Which version of Python are you using and which >> Python JSON library are you using? > > The version of

Re: JSON data

2015-05-07 Thread Tim Chase
On 2015-05-07 13:56, palansh agarwal wrote: > processing of json is slow. It takes considerable amount of time to > process data after calling the API. You seem fairly confident in this. Do you have the timing statistics? Can you provide sample JSON data that others can use for testing? Which

Re: JSON data

2015-05-06 Thread Tim Chase
On 2015-05-07 02:14, palansh agarwal wrote: > I am making a django app in which I require to read json data from > an external API and display data, But it's working very slowly. Any > suggestions to speed up the process will be appreciated. which part is slow? the API, the processing of the

Re: How to represent a calendar month as a field in django models

2015-05-04 Thread Tim Chase
On 2015-05-03 14:35, Matthys wrote: > I posted the question also on stackoverflow: > > http://stackoverflow.com/questions/30017229/how-to-represent-month-as-field-on-django-model > > The question is for situations where a model instance relates to a > specific month, but not to a specific day.

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Tim Chase
On 2015-04-20 16:01, François Schiettecatte wrote: > I did a little research on this and found cpulimit, you can also > use nice and renice, Yes, nice/renice and their I/O friend ionice (in my Debian installation, it's part of the "util-linux" package) work quite nicely. It's the memory-limiting

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Tim Chase
On 2015-04-20 13:54, François Schiettecatte wrote: > Peter, why do you want to limit memory and CPU usage? To prevent > someone from killing the machine ? I know I've wanted it to help prevent malicious data that could suck up my RAM and push things into swap. Absent "ulimit -a", I've had to

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Tim Chase
On 2015-04-20 13:13, François Schiettecatte wrote: > You don’t say what platform you are running on, but on linux/unix > you can use ulimit, see http://ss64.com/bash/ulimit.html I've wanted this occasionally, but "ulimit -m" doesn't appear to work on most modern Linux installations. See

Re: Trying to avoid using the "eval" command/statement

2015-04-15 Thread Tim Chase
On 2015-04-15 09:45, Henry Versemann wrote: > My problem is since the logic won't know which tables will be in > the incoming list I need to try to reference the entries in each > table using some kind of evaluated version of a variable containing > the name of each table, as I iterate through the

Re: models, peeking to next record - maybe

2015-02-09 Thread Tim Chase
On 2015-02-07 22:05, Vijay Khemlani wrote: > The direct solution would be something like this in your view > > events = Event.objects.order_by('event_date') > > event_tuples = [] > last_date_seen = None > > for event in events: > if last_date_seen: > date_difference = event.date -

Re: django select extremely slow on large table

2015-01-22 Thread Tim Chase
On 2015-01-22 17:14, Joris Benschop wrote: > Thanks you for your response > Unfortunately, yes, the 1.5b records is not something I have > control over. [snip] > WHERE "PROD_SCHEMA"."MARKER"."MARKID" = :arg0 Just out of curiosity, do you have an index on MARKER.MARKID ? And if so, is it

Re: Best way to test handle optional FKs in model __str__?

2015-01-17 Thread Tim Chase
On 2015-01-17 12:01, Vijay Khemlani wrote: > I don't think there is a way in Python to do that directly > > you could have a utility method that catches the exception, for > example > > def get_fk_field(obj, fk_field): > try: > return getattr(obj, fk_field) > except

Re: Serving mov file with Django

2014-12-27 Thread Tim Chase
On 2014-12-27 10:29, Hanley Hansen wrote: > I'm using the simple backend: > > SENDFILE_BACKEND = 'sendfile.backends.xsendfile' Your initial email mentions running Apache. Are you seeing this on an Apache server, or are you seeing it on the development server? Also, how are you connecting Django

Re: Serving mov file with Django

2014-12-27 Thread Tim Chase
On 2014-12-27 10:29, Hanley Hansen wrote: > That makes sense. I've tried using sendfile but i'm not getting the > behavior I expect. > > return sendfile(request, path, attachment=True) Does it do what you want if you remove the "attachment=True"? -tkc -- You received this message because

Re: Serving mov file with Django

2014-12-27 Thread Tim Chase
On 2014-12-27 08:00, Hanley Hansen wrote: > I want to serve an mov file on the file system with Django the way > Apache would. IBe managed to serve the file as a download but I'm > looking to stream it so it plays in browser. I want to avoid > setting up a alias in Apache. Though it's a static

Re: How to set up a junction table in Django

2014-12-17 Thread Tim Chase
On 2014-12-17 06:34, Ben Gorman wrote: > Notice the NULL value. This basically says "Game 2" consists of > player 2 *and one undetermined* player. This functionality is what > I need to replicate in Django. This is what I tried. > > Models.py > > class Player(models.Model): > player_name =

Re: ANN: Django website redesign launched

2014-12-17 Thread Tim Chase
On 2014-12-16 19:34, Jannis Leidel wrote: >> On 16 Dec 2014, at 18:37, Tim Chase wrote: >> if remote-font-loading is disabled, certain icons don't come out >> intelligently. To demonstrate what would happen if the font-file >> was unavailable, you can use Firefox, go

Re: Devils advocate question

2014-12-16 Thread Tim Chase
On 2014-12-17 00:14, Cal Leeming wrote: > One thing to note, DigitalOcean is truly awesome but it is a > no-frills service. You get an API and raw performance at dirt cheap > pricing, everything else you have to handle yourself. I'd call it "cheap pricing", not "dirt cheap pricing" since PHP

Re: Devils advocate question

2014-12-16 Thread Tim Chase
On 2014-12-16 13:15, Sayth Renshaw wrote: > With django what benefit do I get for the extra build time over > Drupal or Rails. Configuration I assume but real world benefits not > my/our joy of configuration. You're asking about two separate products. Over Rails, the feature-sets are fairly

Re: ANN: Django website redesign launched

2014-12-16 Thread Tim Chase
> As you can imagine, there will be bugs, so please bear with us and > report issues to the issue tracker at > https://github.com/django/djangoproject.com/issues I appreciate the clarification/distinction between Django-Users and Django-Developers mailing-lists. I don't remember them being this

Re: Test client to a redirect requiring a login doesn't set redirect_chain properly? [2nd follow-up]

2014-12-03 Thread Tim Chase
On 2014-11-30 11:04, Collin Anderson wrote: > As of django 1.7, the admin will redirect to a separate login page > (whatever url reverse('admin:login') returns). > > https://github.com/django/django/commit/be0ad62994a340ad54a0b328771931932a45a899 Shouldn't this reach for

Re: Test client to a redirect requiring a login doesn't set redirect_chain properly? [2nd follow-up]

2014-11-28 Thread Tim Chase
On 2014-11-27 20:32, Tim Chase wrote: > As a bit of follow-up information, if I use runserver and browse to > the view, it redirects me to /admin/common/region/add/ but it > displays as the login screen. Am I missing why this wouldn't do a > redirect to my named login URL? A car

Re: Test client to a redirect requiring a login doesn't set redirect_chain properly?

2014-11-27 Thread Tim Chase
On 2014-11-27 20:15, Tim Chase wrote: > However my test fails with: > > AssertionError: Response redirected to > 'http://testserver/admin/common/region/add/', expected > 'http://testserver/accounts/login/?next=/admin/common/region/add/' > > Where am I going wrong? Do

Test client to a redirect requiring a login doesn't set redirect_chain properly?

2014-11-27 Thread Tim Chase
I have a view that can redirect to /admin/common/region/add/ but that url (being an admin page) should require login (right?). My test that logs-in works as expected. However, when I try to do an assertRedirects() without logging in first, the assertRedirects() doesn't seem to follow through to

Re: Preventing race conditions when submitting forms

2014-11-25 Thread Tim Chase
On 2014-11-25 07:57, Paul Johnston wrote: > Consider an e-commerce site, where Alice and Bob are both editing > the product listings. Alice is improving descriptions, while Bob is > updating prices. They start editing the Acme Wonder Widget at the > same time. Bob finishes first and saves the

Re: Obtaining content from Git

2014-11-24 Thread Tim Chase
On 2014-11-24 11:49, martin f krafft wrote: > also sprach Tim Chase <django.us...@tim.thechases.com> [2014-11-24 > 11:19 +0100]: > > urlpatterns = patterns('', > > url(r'^blob/([0-9a-f]{40})/$', > > 'myapp.views.render_blob', ...), ) > > … this is straig

Re: Obtaining content from Git

2014-11-24 Thread Tim Chase
On 2014-11-24 10:06, martin f krafft wrote: > It could come from Git! After all, Git is really a database by > itself, just like the filesystem could be viewed as a database. [snip] > Furthermore, I'd actually like to post-process the data. The Git > repo would contain reStructuredText files and

Re: django on ubuntu

2014-11-22 Thread Tim Chase
On 2014-11-22 18:01, John wrote: > read up on virtualenv and do everything in a virtual python > environment. I can't second John's advice strongly enough. I started programming in Python over a decade ago and just finally broke down and investigated virtualenv/virtualenvwrapper ~2yrs ago and it

Re: Multiple versions of python on linux server

2014-11-03 Thread Tim Chase
On 2014-11-03 08:07, robert brook wrote: > I do not have the luxury to create a virtual environment because of > the constraints of this organization. Just making sure that you're aware of the difference between a virtual environment and a virtual machine. A virtual machine is a full abstraction

Re: Rotate the CSRF token on every request

2014-11-01 Thread Tim Chase
On 2014-11-01 08:32, Zach Borboa wrote: > Rotating the CSRF token on every request is probably not a great > idea. Tokens will become invalidated when multiple tabs are open. I've used sites that do this and it infuriates me to no limit. Unless absolutely mandated to use them for $JOB, it's a

Re: Which Version of Django

2014-09-30 Thread Tim Chase
On 2014-09-30 09:28, Mark Caglienzi wrote: > I agree with other advices to start with Django 1.7. > Django is very stable and the new functionalities are always > introduced in a very sane way. I haven't seen any discussion of the deployment platform. I would also recommend 1.7 for green-field

Re: LIMIT 21 on primary key lookups

2014-09-14 Thread Tim Chase
On 2014-09-14 13:23, James Bennett wrote: > This was something that could bite any user of Django with large > enough QuerySets, so the behavior was changed in upstream Django to > only show 20 objects. [snip] > This means that repr() on a QuerySet will never instantiate huge > numbers of

Re: User to Model relationship- implement a "like" feature on a Model

2014-08-25 Thread Tim Chase
On 2014-08-25 17:00, amarshall wrote: > Hmm, That may work. I should have also noted one thing. I'm > actually using Django as the backend for mobile application. Both > *Android* and iOS. So I'd like to do something like this, in the > simplest matter: > > pseudocode: > > get

Re: PostgreSQL, queries, speed

2014-06-17 Thread Tim Chase
On 2014-06-17 11:04, Russell Keith-Magee wrote: > On Tue, Jun 17, 2014 at 9:25 AM, Lachlan Musicman wrote: > > Now reading about indexes I can't believe I've not used them > > previously. > > Indicies are definitely your friend - *especially* on > PostgreSQL. :-) I've found

Re: PostgreSQL, queries, speed

2014-06-16 Thread Tim Chase
On 2014-06-17 10:08, Lachlan Musicman wrote: > The problem is that even with a relatively small number of parts > (<5000) and only 4 currencies (USD, AUD, EUR, GBP) we are seeing > page rendering slow down as each of those queries is sent off to be > worked out. A couple things occur to me: -

Re: What happens when secret key is lost?

2014-05-21 Thread Tim Chase
On 2014-05-21 16:44, Erik Romijn wrote: > > Could you elaborate on how such remote-code execution would > > happen? > > If you use Django's cookie-based sessions[1], knowledge of the > SECRET_KEY allows an attacker to forge a cookie with session data. > Forging sessions is bad enough, but if

Re: What happens when secret key is lost?

2014-05-20 Thread Tim Chase
On 2014-05-20 21:34, Erik Romijn wrote: > > The question is, what happens when I lose it - when it's used for > > password hash salt, doesn't that mean if it's lost, all users > > have to reset their password, don't they? > > If it were used for that, that would indeed be the scenario. >

Ordering guarantees on BoolenFields?

2014-05-10 Thread Tim Chase
Does Django guarantee that, if an ordering is specified on a BooleanField of a model, that it will order the same way across supported databases? E.g. class MyModel(Model): active = BooleanField() name = CharField(...) class Meta: ordering = [ "-active",

Loading data in migrations

2014-04-26 Thread Tim Chase
According to [1] """ [automatically loading initial data via fixtures is d]eprecated since version 1.7: If an application uses migrations, there is no automatic loading of fixtures. Since migrations will be required for applications in Django 1.9, this behavior is considered deprecated. If you

Re: Django and SSL

2014-04-24 Thread Tim Chase
On 2014-04-24 17:55, Mike Dewhirst wrote: > I suppose it depends on your site. In my case it was Apache rather > than nginx and pretty much all I had to do was establish a redirect > so any url with http://blah.blah went to https://... instead. If you're redirecting to HTTPS regardless of the URL

Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-27 Thread Tim Chase
On 2014-01-27 14:44, damondevi...@gmail.com wrote: > Why then adopt Django (or web2py) for a new project today, instead > of going pure JS? > > I am a big Python fan in terms of design and principles, If you like JS as a language, then it makes sense to do everything in JS. However, I prefer

Re: django with no relational db?

2014-01-22 Thread Tim Chase
On 2014-01-22 09:07, Rafael E. Ferrero wrote: >> I will have web pages, d3.js, authenticated users and sessions. > > Are you tried nikola ? maybe works for > you... its for flatpages. While I will say that I love a lot of things about Nikola, it doesn't meet the OP's

Re: What to learn first?

2013-12-25 Thread Tim Chase
On 2013-12-25 11:34, sahil13...@iiitd.ac.in wrote: > I wanted to ask that what should I learn first = wxPython or > Django?(Being a beginner in python) What do you want to develop: desktop applications or web applications? Django is predominantly for web applications, while wx/qt/tk is

Re: How do I test my Django App on my Phone

2013-12-09 Thread Tim Chase
On 2013-12-09 17:28, Timothy W. Cook wrote: > I suggest setting up a URL using no-ip.org or similar service. > No-ip.org is free at this level and works great, at least on Ubuntu > and CentOS. I haven't tried other OS's. This Tim agrees with that Tim. :-) It's one thing to go through finding

Re: How do I test my Django App on my Phone

2013-12-09 Thread Tim Chase
On 2013-12-09 10:44, Muhammad Ali wrote: > Instructions I found online (such as this one: ) say that I should > plug the phone to the computer through a USB and run: manage.py > runser 0.0.0.0:8000 and visit this IP address via my phone's > browser. But it doesn't work and instead returns an

Re: Freelance Django Developer

2013-10-30 Thread Tim Chase
On 2013-10-30 11:37, Team UK wrote: > We are looking for a freelance Django developer to join our team. > Please email us if you are interested to know more. You might get more interest if you provided some details about *where* you're looking to hire geographically, or if you'd accept remote

Preferred virtualenv layout for Django projects

2013-10-17 Thread Tim Chase
How do folks prefer to layout their Django projects when using virtualenv? Do you do either of the following, or something else? Method 1: (project & apps at same level) ~/tmp$ virtualenv my_proj ~/tmp$ cd my_proj ~/tmp/my_proj$ . bin/activate (my_proj)~/tmp/my_proj$ pip install django # ...

archival patterns/mixins?

2013-10-03 Thread Tim Chase
I've been trying to reduce some code in a new project, and I have a number of objects where I have the main class, and an archival version of the same class, something like def Thing(Model): last_updated = DateTimeField(...) who_updated = ForeignKey(User) field1 = ... field2 =

Re: Can I make changes in Django without having to recompile everything?

2013-08-21 Thread Tim Chase
On 2013-08-21 07:21, Johann wrote: > Please tell me if this is true. I'm deciding on Django, asp.net, > or Java. > > If I use asp.net or java and I want to make a change to the > controller, I have to recompile the class or project, right? Alas, that's one of the reasons that drove me from Java

Re: create random string for username

2013-07-20 Thread Tim Chase
On 2013-07-18 20:53, Sivaram R wrote: > While saving these forms instance,is it possible to create a > random string for username field.How to do this,any sample would be > great choice. You can. Assigning random usernames isn't usually considered a very nice thing to do to users, but assuming

Re: Reserved word issue?

2013-07-17 Thread Tim Chase
On 2013-07-17 11:14, Nigel Legg wrote: > def on_interaction(self, consumer, interaction, hash): ... > result.sm_Link = interaction['interaction']['link'] ... > Looking at the server log (development server) I get > result.sm_Link = interaction['interaction']['link'] > KeyError: 'link' >

Re: How to divide my apps? Good practices?

2013-06-21 Thread Tim Chase
On 2013-06-21 09:29, galgal wrote: > But I can see now that there will be a massive amount of models. [snip] > I will have at least 15 models in it and I think it will > increase in some time Just as an aside, having worked developing a lot of business/"enterprise" applications, 15 models is a

Re: Poll tutorial: running the command 'python manage.py runserver' produces an error

2013-05-25 Thread Tim Chase
On 2013-05-25 12:40, Kokas wrote: > Hello > > When I run the initially created project using the command 'python > manage.py runserver' gives me > Error: [Errno 10013] A from-the-hip guess is that you're running on a machine (such as Linux/BSD/Mac) where ports <1024 are considered privileged,

Re: Accessing django development server using internet

2013-05-09 Thread Tim Chase
On 2013-05-09 09:21, Rafael E. Ferrero wrote: > you can do like Tim says if you want to share your project with > your local network if you want to share with the world then you are > talking about a "production" server. I personally would even be comfortable putting it online (non-local network)

Re: Accessing django development server using internet

2013-05-07 Thread Tim Chase
On 2013-05-07 08:38, Kakar wrote: > I have my project in my pc, and on python manage.py runserver, i > can view it on my browser. But how to view from other computer or > on the internet and not locally?... How to make my pc a server to > view it from over the internet? While it's not generally

Re: save as

2013-03-19 Thread Tim Chase
On 2013-03-19 18:42, Larry Martell wrote: > https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ which > says to use the Content-disposition header to trigger the save as. > I've done this, but I don't get a save as dialog box. The file is > just downloaded to a download dir with the name I

Re: Django + Raspberry PI

2013-03-06 Thread Tim Chase
On 2013-03-06 18:43, dgregor...@gmail.com wrote: > I am developing a pinewood derby race manager to run on Django on > the RPi. I am using sqlite. With an intro sentence like that and the lilliputian dimensions of the RPI, I half expected you to say that you ran it *on the pinewood derby race car

Re: storing large amounts of text in the DB

2013-01-11 Thread Tim Chase
On 01/11/13 00:35, Mike wrote: My users will upload text documents ranging from hundreds to thousands of words. At the moment I store the text in a TextField. Is this going to cause a performance problem in the future or would it be better to store the text on the file system and put a file

Re: How to make a url pattern that catch any url ?

2012-11-28 Thread Tim Chase
On 11/28/12 14:19, Loai Ghoraba wrote: > I just go it, it is > > url(r'^download/(?P.*)$', 'faculty.views.Main.download_file'), Just be careful to normalize the resulting path so that people don't do things like http://example.com/download/../../etc/passwd Fortunately, the standard library

Re: Invalid properties don't throw errors?

2012-11-23 Thread Tim Chase
On 11/23/12 15:31, Aaron C. de Bruyn wrote: > Python 2.7.3 (default, Aug 1 2012, 05:14:39) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > (InteractiveConsole) u = User.objects.get(pk=1) u.user = 'test' > > No error. It should

Re: A very basic question with Django

2012-10-10 Thread Tim Chase
On 10/10/12 13:29, Tomas Ehrlich wrote: > If you know what's CGI, feel free to answer the original question: > "Could Django be deployed using CGI?" Yes, it can be done[1]. No, it's not usually a good idea. -tkc [1] http://joemaller.com/1467/django-via-cgi-on-shared-hosting/

Re: A very basic question with Django

2012-10-10 Thread Tim Chase
On 10/10/12 01:09, Tomáš Ehrlich wrote: >> A2: I admit that I don't know exactly what CGI means, but you >> actually can deploy Django using FastCGI. I'm using WSGI, >> which is recommended method right now. Please checkout >> documentation for more details >>

Re: Newbie Project Setup and Terminology Questions

2012-09-12 Thread Tim Chase
On 09/12/12 09:56, Cal Leeming [Simplicity Media Ltd] wrote: > Be aware, the below structure works perfectly for us It might help if you include what your $PYTHONPATH is set to, so one knows which directories are expected to be available for importing. -tkc -- You received this message

Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries

2012-09-08 Thread Tim Chase
On 09/08/12 14:45, Jason wrote: > thank you for your responses. I think, following your advice, I'll have to > abandon my attempts to handle this in the template, and sort this out in > the views instead. While it's *possible* to implement the logic in the template, it (1) is inefficient and

Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries

2012-09-07 Thread Tim Chase
On 09/07/12 16:06, Jason Whatford wrote: > P.s. Tim, my data structure isn't that malleable. It's > essentially I query my appengine datastore, and that retrieves a > list of the data models, each of which can be treated as a dict. > The dicts are used in a few different ways in the view - only >

Re: Seeing if a variable value is within a dictionary key value within a list of dictionaries

2012-09-07 Thread Tim Chase
On 09/07/12 13:06, Jason wrote: > I'm using django 1.2 and am attempting to get the following code to work. > > private_folder_details = [{"folderId":"", "name": "The folder > name"},{"folderId":"1221", "name": "The other folder name"}] > private_folders = [{"id":""},{"id":""}] > >

  1   2   3   4   5   6   7   >