django-apps

django specific settings app

给你一囗甜甜゛ 提交于 2019-12-08 16:43:52
问题 I am working on a django app that needs a directory to download and store files. I want to keep my app reusable so I do not want to hard code the path of this directory. So I want to make this path a setting/a global variable that can be set up. Where could I put this setting/global variable? Is this kind of approach good ? http://blog.muhuk.com/2010/01/26/developing-reusable-django-apps-app-settings.html Thanks for your advice! 回答1: I use the following methodology: # some file in your app:

Django migrations and customizable reusable apps

徘徊边缘 提交于 2019-12-06 05:39:47
问题 I started writing my first reusable app about 3 weeks ago, and I'm having troubles to deal with migrations. I want some points of my app to be customizable. Thus I have a conf submodule that defines custom settings and assign the reasonable defaults that will fit most cases. This leads some of my model fields to look like this: attachment = models.FilePathField( path=conf.ATTACHMENTS_DIR, recursive=True) template_file = models.FileField( upload_to=conf.TEMPLATES_UPLOAD_DIR, blank=True) prefix

How register Flask Blueprints from config like apps in Django?

霸气de小男生 提交于 2019-12-06 02:37:24
How I can register Flask Blueprints from my config like apps in Django? I would like to define Blueprints in the configuration file, which will be automatically registered #config.py BLUEPRINTS = ( 'news', 'files', ) I actually have been sketching out something like that in a project tentatively named Hip Pocket . It's basically the same answer as @HighCat has given you, except it uses Python's packaging system rather than a config.py file (although it could be extended to autoload from a config file instead - issues and pull requests are most welcome.) So in Hip Pocket you'd do this (see hip

How to remove an app from a django projects (and all its tables)

时光毁灭记忆、已成空白 提交于 2019-12-05 21:56:46
问题 I want to remove an app from a django project. I want to remove the tables of the app the content-types foreign-key usages of these content-types Running manage.py migrate app_to_remove zero does not work: django.db.migrations.migration.IrreversibleError: Operation <RunPython <function forwards_func at 0x7ff76075d668>> in fooapp.0007_add_bar is not reversible I guess there are several migrations which are not reversible ... 回答1: First: Remove references in the code remove app_to_remove from

Django South: Creating schemamigration for more than one app

女生的网名这么多〃 提交于 2019-12-05 08:54:15
问题 I'M using django south on a bigger project, the only thing I don't like about it, that you can't create schemamigrations for all of your apps at once (I have a lot of apps that inherit from the same abstract model, if I change that base model there are alot of apps to migrate) - thought you can actually migrate all of them at once (using migrate --all). So I'd like to know if theres an easy solution for django south to handle a bunch of apps at once or if anyone has a nice script ready for

How to remove an app from a django projects (and all its tables)

故事扮演 提交于 2019-12-05 07:07:34
I want to remove an app from a django project. I want to remove the tables of the app the content-types foreign-key usages of these content-types Running manage.py migrate app_to_remove zero does not work: django.db.migrations.migration.IrreversibleError: Operation <RunPython <function forwards_func at 0x7ff76075d668>> in fooapp.0007_add_bar is not reversible I guess there are several migrations which are not reversible ... First: Remove references in the code remove app_to_remove from settings.INSTALLED_APPS remove other references in urls.py or other places Second: Clean the database Create

Django sub-applications & module structure

戏子无情 提交于 2019-12-03 07:03:42
问题 I am developing a Django application, which is a large system that requires multiple sub-applications to keep things neat. Therefore, I have a top level directory that is a Django app (as it has an empty models.py file), and multiple subdirectories, which are also applications in themselves. The reason I have laid my application out in this way is because the sub-applications are separated, but they would never be used on their own, outside the parent application. It therefore makes no sense

Django Facebook Connect App Recommendation

我与影子孤独终老i 提交于 2019-12-03 03:37:41
问题 I want to implement Facebook connect login for my Django site and I've checked the already existing apps. So far, I have found Django-Socialauth, django-socialregistration, and django-facebookconnect for this purpose. The question is which one to choose, and I would like to hear from other developers who have experience with any of these apps. It is important for me that the Facebook Connect login app plays nicely with @login_required, with the default auth system, and with django

Asset managers for Django - choose which one? [closed]

泄露秘密 提交于 2019-12-03 02:46:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I would like to bundle up css and javascript files. I also want to send far-future expire headers to clients, so I need file versioning. A quick search across the Internet has shown there are several asset managers developed for Django. Here is a list of those that I could reach: django-compress django-assets

Django sub-applications & module structure

扶醉桌前 提交于 2019-12-02 20:38:21
I am developing a Django application, which is a large system that requires multiple sub-applications to keep things neat. Therefore, I have a top level directory that is a Django app (as it has an empty models.py file), and multiple subdirectories, which are also applications in themselves. The reason I have laid my application out in this way is because the sub-applications are separated, but they would never be used on their own, outside the parent application. It therefore makes no sense to distribute them separately. When installing my application, the settings file has to include