Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django search box in navigation box to search postgresql
I want to put a search box in the base.html navigation bar that searches one table in my postgreSQL and produces a drop-down of matching names that then goes straight to the selected detail. So I know I need a form tag in base.html, and a url pattern and a CBV. Thanks in advance. -
Django override UserManager to use custom user model
I'm stuck trying to override UserManager to point to my custom user model so I can implement a user registration form. I keep getting the error message: Manager isn't available; 'auth.User' has been swapped for 'users.CustomUser' So I know the manager isn't pointing to CustomUser but instead to the default User model, but I can't figure out how to change this. My settings.py: AUTH_USER_MODEL = 'users.CustomUser' Within my users app here is forms.py: from django.contrib.auth.forms import UserCreationForm from .models import CustomUser class CustomUserCreationForm(UserCreationForm): class Meta(UserCreationForm.Meta): model = CustomUser fields = UserCreationForm.Meta.fields And here is my models.py file: from django.contrib.auth.models import AbstractUser from django.db import models class CustomUser(AbstractUser): pass class CustomUserManager(UserManager): pass How do I set CustomUserManager to point to my CustomUser model and then where do I point my code to CustomUserManager? Thanks for any help. -
Given a django assignment I'm struggling with
Basically, I'm supposed to have a login/reg page with validations (which is complete and working great.) Then have it redirect to a landing page that displays all the other users (not including the logged in user) on a table. Then it lists out all their information (see picture) with a button that allows you to poke other people and how many times they've been poked. There is also a list of people who have poked you and how many times they poked you. I really need help. How do you display the logged in users name at the top in jinja? Something like {{ user.alias }} which I can't get to work. User is the table name and alias is the field name in the db. How do you display all the records on the table? How do you display the poke history on the table? How do you add the list of people who've poked you and order it by descending order? I'm really at a loss on how to accomplish this. Any and all help would be appreciated. Am I supposed to create another table to track the pokes. I'd be willing to pay for a good answer … -
What does adding on_delete to models.py do, and what should I put in it?
FYI, the on_delete parameter in models is backwards from what it sounds like. You put "on_delete" on a Foreign Key (FK) on a model to tell django what to do if the FK entry that you are pointing to on your record is deleted. The options our shop have used the most are PROTECT, CASCADE, and SET_NULL. Here are the basic rules I have figured out: Use PROTECT when your FK is pointing to a look-up table that really shouldn't be changing and that certainly should not cause your table to change. If anyone tries to delete an entry on that look-up table, PROTECT prevents them from deleting it if it is tied to any records. It also prevents django from deleting your record just because it deleted an entry on a look-up table. This last part is critical. If someone were to delete the gender "Female" from my Gender table, I CERTAINLY would NOT want that to instantly delete any and all people I had in my Person table who had that gender. Use CASCADE when your FK is pointing to a "parent" record. So, if a Person can have many PersonEthnicity entries (he/she can be American Indian, Black, … -
Migration failing when pushing to Cloud foundry
When I do make migrations on my local computer its working fine and completes without any error but when I push my code to cloud Foundry it is ending in error. Log: 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] OUT Operations to perform: 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] OUT Apply all migrations: admin, auth, commonpage, contenttypes, sessions, taskmaster 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] OUT Running migrations: 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR Traceback (most recent call last): 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "manage.py", line 22, in 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR execute_from_command_line(sys.argv) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/core/management/init.py", line 363, in execute_from_command_line 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR utility.execute() 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/core/management/init.py", line 355, in execute 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR self.fetch_command(subcommand).run_from_argv(self.argv) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR self.execute(*args, **cmd_options) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR output = self.handle(*args, **options) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 204, in handle 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR fake_initial=fake_initial, 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/db/migrations/executor.py", line 115, in migrate 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.5/site-packages/django/db/migrations/executor.py", line 244, in apply_migration 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR state = migration.apply(state, schema_editor) 2017-12-21T02:03:34.85+0530 [APP/PROC/WEB/0] ERR … -
Django app on Heroku: can't open new browser window via webbrowser call
I have a django app on heroku that requires user authorization via the spotify web API. I am using the python webbrowser module to send the user to the authorization link. Everything works locally. To run on Heroku I have installed RQ, and am using the Redis To Go add-on, and have added workers to run the webbrowser call. Procfile: web: gunicorn app.wsgi --log-file worker: python app/worker.py When I look at the heroku logs I see that my worker is running and is executing the webbrowser call, however, a browser window doesn't pop up and my heroku app ends up timing out. Heroku log: 2017-12-20T07:27:19.057800+00:00 heroku[router]: at=info method=GET path="/" host=myapp.herokuapp.com request_id=e5212374-7a1a-4058-be2d- eb455018fed4 fwd="76.29.43.60" dyno=web.1 connect=0ms service=4ms status=200 bytes=1610 protocol=https 2017-12-20T07:27:19.129041+00:00 heroku[router]: at=info method=GET path="/static/app/indexcss2.css" host=myapp.herokuapp.com request_id=365c8ff9-e0a6-4713-91c0-8d32906201b8 fwd="76.29.43.60" dyno=web.1 connect=0ms service=3ms status=304 bytes=144 protocol=https 2017-12-20T04:37:24.436886+00:00 app[worker.1]: 04:37:24 default: app.auth.goToSpotify('https://accounts.spotify.com/authorize? client_id=clientid&response_type=code&redirect_uri=redirecturi') (49322ff7- e8b6-45a3-9eca-a26ea6e238ca) 2017-12-20T04:37:24.467101+00:00 app[worker.1]: 04:37:24 default: Job OK (49322ff7-e8b6-45a3-9eca-a26ea6e238ca) 2017-12-20T04:37:24.467238+00:00 app[worker.1]: 04:37:24 Result is kept for 500 seconds 2017-12-20T04:37:24.475089+00:00 app[worker.1]: 04:37:24 2017-12-20T04:37:24.475195+00:00 app[worker.1]: 04:37:24 *** Listening on high, default, low... 2017-12-20T04:37:54.068516+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/submit/" host=myapp.herokuapp.com request_id=3161d8be-6302-41ae-8b3a-2b28ebd2420c fwd="209.249.175.76" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https My app.goToSpotify function: import webbrowser def goToSpotify(auth_url): webbrowser.open(auth_url, new=1) return 1 Does anybody know … -
ValueError: Cannot assign must be an instance
I have the following pre-existing database table which contains and id and a description. I have to load this prior to my User table in order to associate the ForeignKey correctly. class QVDSSSecurityDimension(models.Model): coid = models.CharField(db_column='CM_Data_Restriction', serialize=False, max_length=10, primary_key = True) # Field name made lowercase. coid_name = models.CharField(db_column='CM_Company_Name', max_length=50, blank=True, null=True) # Field name made lowercase. class Meta: managed = False db_table = 'QV_DSS_Security_Dimension' My custom user model is built on the following: class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(unique=True) username = models.CharField(max_length=7, unique=True) formattedusername = models.CharField(max_length=11, unique=True, primary_key = True) first_name = models.CharField(max_length=40) last_name = models.CharField(max_length=140) date_joined = models.DateTimeField(default=timezone.now) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=False) is_cfo = models.BooleanField(default=False) facility = models.CharField(max_length=140) officename = models.CharField(max_length=100) jobdescription = models.CharField(max_length=140) positioncode = models.CharField(max_length = 100) positiondescription = models.CharField(max_length=140) coid = models.ForeignKey(QVDSSSecurityDimension, null=True, blank = True, db_constraint=False) streetaddress = models.CharField(max_length=140) title = models.CharField(max_length=100) USERNAME_FIELD = 'username' class Meta: app_label = 'accounts' db_table = "user" def save(self, *args, **kwargs): self.formattedusername = '{domain}\{username}'.format( domain='HCA', username=self.username) super(User, self).save(*args, **kwargs); def get_short_name(self): return self.username # REQUIRED_FIELDS = "username" def __str__(self): return '%s - %s %s' % (self.username, self.first_name, self.last_name) Everything works with the makemigrations and migrate, but if a User.coid doesn't exist in the database I get … -
How should I use Factory_boy in Django to create test data?
Python 3.6.3 Django 1.11.4 My structure is something like: myproject guys | models.py | factory.py models.py looks like: from django.db import models class Guy(model.Model): first_name = models.CharField(max_length=35) last_name = models.CharField(max_length=35) my factories.py looks like import factory import django from guys import models class GuyFactory(factory.Factory): class Meta: model = models.Guy first_name = factory.Faker('first_name') last_name = factory.Faker('last_name') django.setup() for i in range(1, 100): GuyFactory.create() But if I run this from the command line I get python3 authors/factories.py Traceback (most recent call last): File "guys/factories.py", line 5, in from guys import models ModuleNotFoundError: No module named 'guys' I'm not even sure if this is the right way to execute this script. I've been developing inside PyCharm. When I run the script inside PyCharm I get "django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet." -
Simplest Way to Run Matlab Script with Django
I would like to integrate a MATLAB script into a website I built with Django. The script accepts a few parameters and returns a table to the user. I am a novice Django user. I would like to know the simplest and fastest way to execute my MATLAB script using Django and return the results to the user. From what I have read online, it appears there are a few options: 1.) execute script using octave (free so I wouldn't need to pay for MATLAB license for the server) 2.) compile my MATLAB function as python library, write a python script with MATLAB function, and execute the script server-side using django and 3.) compile the MATLAB function as a standalone application and run that application on the server (unclear to me how exactly this would work). There are probably more options I am missing and I would appreciate recommendations on the simplest way to run a MATLAB script on a Django site. Also, the script is fast to execute and takes a 5< seconds to run on my computer, so I think I would not need to use a distributed task queue system like Celery. -
Django site creating a link from html page to another app's main html page
I have an index page in a django project that has (in it's header.html page) a navigation bar. I want the navigation bar to actually work ...currently when I click on 'teachers' in the nav bar I get an error. The code in header.html (which has the nav bar) </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <ul class="navbar-nav ml-auto"> <li class="nav-item mx-0 mx-lg-1"> <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="/teachers/teachers.html">Teachers</a> </li> </div> The link above in question is: href="/teachers/teachers.html">Teachers The file path/structure of where the teachers.html page is: C:\Users\User\Desktop\rast\teachers\templates\teachers The error: Using the URLconf defined in website.urls, Django tried these URL patterns, in this order: admin/ admin/ header/ [name='header'] [name='index'] teachers/ The current path, teachers.html, didn't match any of these. My question is - what do I need to write in the header.html page (or do I need to dos something else?) to get the nav bar button 'teachers' to go to the teachers.html page. -
Wagtail making pages expire
Is there a management command or something I should be running to make wagtail pick up expired pages? Example: I go into the admin dashboard and change the expiration time (not through the wagtail admin). Wagtail doesn't pick up that this post becomes expired / change the expired boolean to True. Since this is a non-editable field that isn't changeable through admin. Yes, I can mke my own but I'm curious as to why wagtail doesn't pick this up. -
Django: How to update user model without updating user password field
I'm trying to create a user update endpoint that only updates select fields of a user. My currently implementation is to save the model with ModelForm's save method but I've also tried with the base model save method. My request body doesn't contain a password field and I don't have a password field in my UserForm, however I'm unable to maintain the current session or logout and log back in with the current user after executing an update. I'm nearly positive this is because Django is changing my password somewhere during the update process. Other pertinent information: I'm using Django (not Django Rest Framework). I have a custom user model. I know I can solve this issue by using serializers with DRF but it seems hacky to use that for this issue alone. My endpoint looks like this: def saveAccountData (request): resp = {} if request.method == 'POST': form = UserForm(request.POST, instance=request.user) if form.is_valid(): form.save() resp['result'] = 'User updated' return HttpResponse( json.dumps(resp), status=200 ) else: return HttpResponse( json.dumps(form.errors), status=422, ) My Form looks like this: class UserForm(forms.ModelForm): class Meta: model = User fields = ['email', 'name', 'is_active', 'is_admin'] def save(self, commit=True): user = super(UserForm, self).save(commit=False) user.name = self.cleaned_data['name'] if commit: … -
how to integrate chatbot created with django in app mobile ionic(version >2)?
What do I need to do in ionic for it to use chatbot? did not want to use solutions like DialogFlow. I need to create something native to the company I work for. but, I do not know how to do integration with ionic. -
SharePoint API Call for File Upload
I'm building an app in Django and trying to upload a file to a SharePoint Online Site but I'm sure I've (at least) got the url wrong for the API call. I have the appropriate permissions allotted to the app in dev.microsoft.com but get back a 500 response when I try to upload. this is the basic api call I'm trying to use PUT /sites/{site-id}/drive/items/{parent-id}:/{filename}:/content I'm kind of going by these 2 resources to build the url but not sure of the site-id or parent-id. For the {YourSharepointTenant} i got the tenant-id from the Azure Portal under properties. Its a long list of characters that I omitted from my code i posted here https://www.coderedcorp.com/blog/uploading-files-to-sharepoint-with-django-and-pyth/ https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content Here is my code def save(self, *args, **kwargs): # Get the authenticated user credentials from office365-allauth social = request.user.social_auth.get(provider='office365') access_token = social.extra_data['access_token'] # build our header for the api call headers = { 'Authorization' : 'Bearer {0}'.format(access_token), } # build the url for the api call # Look at https://dev.onedrive.com/items/upload_put.htm for reference url = 'https://{YourSharepointTenant}.sharepoint.com/sites/ITSupport/drive/root:/' + design_document + ':/content' # Make the api call response = requests.put(url, data=open(design_document, 'rb'), headers=headers) return response super(LaserMaskDesign, self).save(*args, **kwargs) -
Do a manual orderby for a queryset in Django
I am using Django 1.11 and I am trying to figure out a way to change the order of a queryset manually. Here is my setup: models.py class Channel(models.Model): channel_no = models.CharField(max_length=4, unique=True) def __str__(self): return self.channel_no I have an array of channel numbers that I wish to use for my order: channel_order = ['2','4','6','8','10','1','3','5','7','9'] How can I use that order for a queryset? -
Django getting "first_name" is invalid keyword argument for this function" TypeError when creating an instance of my model class
Using Django 1.11 and django-pyodbc-azure latest version if it is relevant. I am new to Django and have been following along the 1.11 tutorial without any issues until this, and I am incredibly confused. Here is my models.py: from django.db import models # Create your models here. class Player(models.Model): first_name = models.CharField(max_length=20, name='First Name') last_name = models.CharField(max_length=20, name='Last Name') def __str__(self): return '{}, {} ({})'.format(self.last_name, self.first_name, self.id) class Game(models.Model): players = models.ManyToManyField(Player, name='Players') def __str__(self): return ' vs. '.join(self.players) class Round(models.Model): GIN = 'GI' UNDERCUT = 'UN' KNOCK = 'KN' ENDING_ACITONS = ( (GIN, 'Gin'), (UNDERCUT, 'Undercut'), (KNOCK, 'Knock'), ) game = models.ForeignKey(Game, on_delete=models.CASCADE, name='Parent Game') winner = models.ForeignKey(Player, on_delete=models.CASCADE, name='Winning Player') points = models.IntegerField(name='Points Awarded') end = models.CharField(max_length=2, choices=ENDING_ACITONS) def __str__(self): return '{} awarded {} points via {}'.format(self.winner, self.points, self.end.name) Now when I run manage.py shell and type: from game.models import * bobby = Player(first_name='Bobby', last_name='Fisher') I am met with this error: Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Users\mteper\PycharmProjects\GinRummy\venv\lib\site-packages\django\db\models\base.py", line 571, in __init__ raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0]) TypeError: 'first_name' is an invalid keyword argument for this function Any insight would be greatly appreciated, as, like … -
How to start periodic tasks by calling function in Celery with Django
I was working with period tasks and by their documentation I have successfully create one simple program but those period task execute only when app is get configured. I am talking about this decorator @app.on_after_configure.connect What I am trying to do is I need to execute one period task when I call any particular function so that it get scheduled and then worked accordingly. I tried this but no success: @app.task(name="project.tasks.report") def report(): app.add_periodic_task(10.0, say.s(2, 3), name='add every 10') print('I passed') Here I was trying to call say function with 2 parameters in periodic way for every 10 seconds but with this code snippet it is not working. So what I am really trying to do is: Call report function from views.py in Django Add this periodic task and execute it every x seconds. -
Multiple inheritance in Django Models using abstract classes calling attributes between classes
I have 2 abstract classes Note and Meta that I want to use on multiple models. Also a class Post. class Note(models.Model): def save(self, *args, **kwargs): # get the initial state, if is created or updated state = self._state.adding ......... if self.__original_is_active: action(created_by ...) class Meta: abstract = True class Meta(models.Model): created_by = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, related_name='%(app_label)s_%(class)s_created_by', on_delete=models.CASCADE) class Meta: abstract = True class Post(Meta,Note): is_active = models.BooleanField(default=False) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.__original_is_active = self.is_active As you can see, Note is using attributes defined on Post(is_active) and Meta(created_by) If I keep def init on Post I get the following error: 'Post' object has no attribute '_Note__original_is_active' If I move def init on the parent Note everything is ok, is working but I want to use original_is_active, later in the Post class on his own def save, or even in another abstract class, so I'm thinking maybe is a better solution. If in init I reverse the order of instructions: def __init__(self, *args, **kwargs): self.__original_is_active = self.is_active super().__init__(*args, **kwargs) I get the error: Post object has no attribute '_state' _state is from models.Model Meta and Note are not related in anyway, in Note I just get the user from created_by(which … -
Django: all identical UUIDs after migration
I have a mixin to add an UUID to any model: class UUIDable(models.Model): uuid = UUIDField(db_index=True, default=uuid.uuid4, editable=False) class Meta: abstract = True I have an existing database with Article objects inside. I just added an uuid field to the Article class using the mixin above. After running the migration, all my articles now have the SAME UUID. I expected all the objects to have a different UUID. Why? Here is the automatically created migration file: class Migration(migrations.Migration): dependencies = [ ('products', '0009_auto_20171218_1630'), ] operations = [ migrations.AddField( model_name='article', name='uuid', field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False), ), ] -
Django get_queryset method of a custom model manager has no effect on other built-in methods(get, filter, etc.)
I have created a model manager with a method that adds some string to the certain field and my goal is to apply this method every time when objects called. As I understand, this can be achieved by using the get_queryset method in the custom manager, however this only works if I call SomeModel.objects.all(). If I try to apply some filter, or get object by parametr, it simply returns me original data without my method applied. models.py: class BaseModelQuerySet(models.QuerySet): def edit_desc(self, string): if self.exists(): for obj in self: if 'description' in obj.__dict__: obj.__dict__['description'] += string return self class BaseModelManager(models.Manager): def get_queryset(self): return BaseModelQuerySet(self.model, using=self._db).edit_desc('...') class BaseModel(models.Model): objects = BaseModelManager() class Meta: abstract = True Output in django shell: >>> SomeModel.objects.all()[0].description 'Some example of description...' >>> SomeModel.objects.get(id=1).description 'Some example of description' People, what am I doing wrong, please help. Thanks thousand times in advance! -
I'm trying to print a html output from a oracle query in django
Giving a query from oracle using import cx_oracle on Django/python, I'm trying to print the result of the query in a HTML page but instead of printing this-> Série: ('FR2017', 207253, '110511', 'person name', 333.0, 62000001, 'ECO ABDOMINAL', 45.0, 5.0) Número: ('FR2017', 207253, '110511', 'person name', 333.0, 62000001, 'ECO ABDOMINAL', 45.0, 5.0) GTS: ('FR2017', 207253, '110511', 'person name', 333.0, 62000001, 'ECO ABDOMINAL', 45.0, 5.0) Nome: ('FR2017', 207253, '110511', 'person name', 333.0, 62000001, 'ECO ABDOMINAL', 45.0, 5.0) Valor: ('FR2017', 207253, '110511', 'person name', 333.0, 62000001, 'ECO ABDOMINAL', 45.0, 5.0) How can I print like this? -> Série: FR2017 Número: 207253 Gts: 110511 Nome: person name Valor: 45.0 -
Error saving tags in Django Taggit
I have my models.py as class TaggedActionsBefore(GenericTaggedItemBase): tag = models.ForeignKey(Tag, related_name="%(class)s_emotionsbefore") class TaggedActionsAfter(GenericTaggedItemBase): tag = models.ForeignKey(Tag, related_name="%(class)s_emotionsafter") class ActionJournal(models.Model): situation = models.TextField() actions_before = TaggableManager(blank=True, through=TaggedActionsBefore, help_text="") actions_after = TaggableManager(blank=True, through=TaggedActionsAfter, related_name="actionsafter", help_text="") I am getting the following error when I am trying to save tags get() returned more than one Tag -- it returned 2! through a form which is model a model form of the ActionJournal model. Please let me know what I am doing wrong. -
Deployment of Django in local network while continuing development
The question is in the title. I need to deploy a Django application in a local network (i still don't know how to do but i suppose it's quite easy) but i still need to develop it. My question is how to do to allow users to use the application while i'm still developing it ? Is it a solution to keep to versions of the application, one deployed and one in development ? In this way, I can replace the application deployed by the newly developed one when I finish coding it. Another question concerns the database, can I still modify the database if I just add new models without touching existing ones ? Thank you in advance, -
Start testing already existing Django project
I just read the whole Django documentation about testing and I need soon to start testing an existing project. The project, a dashboard, is pretty big and I was not involved in the development phase (yeah, it sucks). There will be unit tests and integration tests (with Selenium). Here are few questions: Is there any suggestion to start in the best way to test an existing project? Which framework / tools should I use? (actually using only 'coverage' and 'mommy_model') Should I start from the unit tests? Should I test the models first? I feel very disoriented because it's a whole new world for me, but I'm really exited at the same time. Hope some experienced tester can show me the right path. -
What are the difference and advantages among django and flask frameworks in python?
What is Django used for? What is Flask and its uses? Are there any similarities/differences? When should one prefer one over the other?